Hi,
For the past few days i've been trying to set up a userparameter under windows server 2008 r2 that runs a powershell script.
I have this same userparameters and scripts running under windows server 2012R2 and working fine.
My issue is, that when i execute the script from the cmd, i get the correct execution however whener it is called by the zabbix agent, i believe it is calling a 32bit version of powershell for wich some of my items just dont work. Has anyone had problems like this?
Running the script from the cmd works fine:
However, when i call it using zabbix_get:
How exactly does the zabbix agent call for cmd commands?
Anyhelp will be welcome!
For the past few days i've been trying to set up a userparameter under windows server 2008 r2 that runs a powershell script.
I have this same userparameters and scripts running under windows server 2012R2 and working fine.
My issue is, that when i execute the script from the cmd, i get the correct execution however whener it is called by the zabbix agent, i believe it is calling a 32bit version of powershell for wich some of my items just dont work. Has anyone had problems like this?
Code:
UserParameter=apppool.discovery,powershell -NoProfile -ExecutionPolicy Bypass -File "C:\ZabbixAgent\userparams_scripts\get_apppool.ps1"
Code:
C:\ZabbixAgent\userparams_scripts>powershell -NoProfile -ExecutionPolicy Bypass
-File get_apppool.ps1
{
"data":[
{ "{#APPPOOL}" : "borrar" },
{ "{#APPPOOL}" : "clasico2" },
{ "{#APPPOOL}" : "ws_predictor" }
]
}
C:\ZabbixAgent\userparams_scripts>
Code:
zabbix_get -s 10.XX.XX.34 -p 10050 -k site.discovery
Get-ChildItem : Cannot retrieve the dynamic parameters for the cmdlet. Retrievi
ng the COM class factory for component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF0
0DC944A6} failed due to the following error: 80040154.
At C:\ZabbixAgent\UserParameterScripts\get_sites.ps1:2 char:23
+ $sites = Get-ChildItem <<<< -Path IIS:\Sites -Name
+ CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterB
indingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShe
ll.Commands.GetChildItemCommand
{
"data":[
{ "{#SITE}" : "" }
]
}
Anyhelp will be welcome!
Comment