I am attemping to obtain the ‘bytes per cluster’ of a group of hosts.
When running the following pattern against Server 2003, I am able to get this information. However, running against Server 2008 and 2008R2 returns an error:
RuleError on rule tpl_cluster_size_body_1 due to: Error while executing a rule — AttributeError: ‘NoneType’ object has no attribute ‘get’
From the host, I can execute the same command and retrieve the information.
Thanks in advance.
file_systems := search (in host traverse Mounter:FileSystemMount:MountedFileSystem:FileSystem where fs_kind = "LOCAL");
if file_systems then
for filesys in file_systems do;
log.info("Drive name: %filesys.mount%");
mount := filesys.mount;
cmd := "fsutil fsinfo ntfsinfo %mount%";
log.info("Command to run: %cmd%");
filesysinfo := discovery.runCommand(host, cmd);
//If I don't print this line, it jumps to the else. Otherwise, the error is logged.
log.info(filesysinfo.result);
if filesysinfo then
bytes_per_cluster := regex.extract(filesysinfo.result,regex'(?<=Bytes Per Cluster : )(.+)');
log.info ("Bytes per cluster on %host.name% for drive: %mount% --- %bytes_per_cluster%");
else
log.info("Error executing command: %cmd% on %host.name%");
end if;
end for;
else
log.info("No local file systems found on host %host.name%");
stop;
end if;
