We have a situation where we need to run a script on a windows machine which is written in Windows Powershell to interrogate the state of one of the registry values. In order to make this work in Zabbix 1.6.6 we had to run the script in a batch file e.g.:
We have created a brand new instance of 1.8.2 and have created new entries in Zabbix to run these scripts and we now get the following error in Zabbix:
On the surface it looks like the problem is with the batch file not being able to the execute poweshell script hence the return value is of the wrong type. However if we run the script manually with the same user the agent runs as it works absolutely fine. We have upgraded the agent to 1.8.2 recently (though the config file remains as per the 1.6.6 version) and have done an initial check of the config file to make sure the remote running of commands is enabled (which it is)...
Could there be anything else in the config files we've missed or has the agent changed in the way it executes batch files on Windows. As I mentioned this worked well under 1.6.6 but doesn't under 1.8.2 and the only change is the version of Zabbix.
Thanks
Code:
@echo off C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe D:\Monitoring\Scripts\CheckRegistryForChange.ps1 -path \"hklm:\SOFTWARE\Fred\" -key \"DateTime Of Last Run\" -outname NewOrder
Code:
Item [webNNN:system.run[D:\Monitoring\BatchFiles\CheckNewOrderRegistry.bat]] error: Type of received value [File D:\Monitoring\Scripts\CheckRegistryForChange.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.At line:1 char:49+ D:\Monitoring\Scripts\CheckRegistryForChange.ps1 <<<< -path "hklm:\SOFTWARE\Fred" -key "DateTime Of Last Run" -outname NewOrder + CategoryInfo : NotSpecified: (:) [], PSSecurityException + FullyQualifiedErrorId : RuntimeException] is not suitable for value type [Numeric (float)]
Could there be anything else in the config files we've missed or has the agent changed in the way it executes batch files on Windows. As I mentioned this worked well under 1.6.6 but doesn't under 1.8.2 and the only change is the version of Zabbix.
Thanks
Comment