AnsweredAssumed Answered

Build a tag with Scan time

Question asked by Hans-Juergen Kreutzer on Oct 24, 2018
Latest reply on Oct 26, 2018 by DMFezzaReed

I can to create a Assettag which show me the scantime in MInutes

I think it could be a groovy script


After reading the different discussion i fell that  mus like like this

// Skip testing on non-VM hosts.
if(asset.getAssetType()!=Asset.AssetType.HOST) return false;
// Scan time in minutes

host_scan_time = asset.resultsForQid(45038L);

// return false if the asset doesn't have QID 45038
// or the results for some reason is not the expected length
if(host_scan_time == null || host_scan_time.length() <= 16)
return false;

// Parse for duration.
host_scan_time = host_scan_time.substring(15,host_scan_time.indexOf(' seconds'));
// Convert number of seconds to integer
host_scan_time = host_scan_time.toInteger();
return host_scan_time;


How can i convert the second in Minutes ? And if the script leave is the responce correct in Minutes ?