Hello,
I am running the following powershell script to get drive E: fragmentation percentage:
$drive = Get-WmiObject -Class Win32_Volume -Filter "DriveLetter = 'E:'"
$result = $drive.DefragAnalysis()
if ($result.ReturnValue -eq 0)
{
$result.DefragAnalysis.FilePercentFragmentation
}
Zabbix Item:
system.run[powershell.exe -command c:\zabbix\scripts\fragmentacion_e.ps1]
It works OK but when I try to get the same info for drive C: I get no value. I have run the script directly in the machine I am monitoring and it works OK.
I have also checked agent log (LogRemoteCommands=1) and the script is executed but no value is displayed in Zabbix "Latest data".
Any ideas?
Thanks in advance.
I am running the following powershell script to get drive E: fragmentation percentage:
$drive = Get-WmiObject -Class Win32_Volume -Filter "DriveLetter = 'E:'"
$result = $drive.DefragAnalysis()
if ($result.ReturnValue -eq 0)
{
$result.DefragAnalysis.FilePercentFragmentation
}
Zabbix Item:
system.run[powershell.exe -command c:\zabbix\scripts\fragmentacion_e.ps1]
It works OK but when I try to get the same info for drive C: I get no value. I have run the script directly in the machine I am monitoring and it works OK.
I have also checked agent log (LogRemoteCommands=1) and the script is executed but no value is displayed in Zabbix "Latest data".
Any ideas?
Thanks in advance.
Comment