Hello Everyone,
I am having an issue with getting zabbix agent to run a powershell script for an sql query.
When I am running the command manually I am getting the expected output with no issue, but when the zabbix agent is running the command or If I trigger it using zabbix_get I am getting the following error
I'am having no issues with other servers monitored by the same proxy and I am getting the proper output(both when executed manually and through zabbix). So where could the issue be present?
The following UserParameters are returning this error
The system details are
OS: Windows 2012
Agent Version: 3.0.0
Proxy Version: 3.0.4
I am having an issue with getting zabbix agent to run a powershell script for an sql query.
When I am running the command manually I am getting the expected output with no issue, but when the zabbix agent is running the command or If I trigger it using zabbix_get I am getting the following error
Code:
Invoke-Sqlcmd : The term 'Invoke-Sqlcmd' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At C:\Windows\zabbix_agents_3.0.0.windows\bin\state.p s1:10 char:17
+ $colItems = Invoke-Sqlcmd -ServerInstance xyz -Database
"abc" ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-Sqlcmd:String) [], Comma
ndNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
{
"data":[
]
}
The following UserParameters are returning this error
Code:
UserParameter=Backup.discovery, powershell -NoProfile -ExecutionPolicy Bypass -File c:\windows\zabbix_agents_3.0.0.windows\bin\Backup. ps1 UserParameter=Backup.time[*], powershell -NoProfile -ExecutionPolicy Bypass -File c:\windows\zabbix_agents_3.0.0.windows\bin\Backup. ps1 $1 "$2" UserParameter=session.discovery, powershell -NoProfile -ExecutionPolicy Bypass -File c:\windows\zabbix_agents_3.0.0.windows\bin\session .ps1 UserParameter=session.time[*], powershell -NoProfile -ExecutionPolicy Bypass -File c:\windows\zabbix_agents_3.0.0.windows\bin\session .ps1 $1 "$2" UserParameter=conn, powershell -NoProfile -ExecutionPolicy Bypass -File c:\windows\zabbix_agents_3.0.0.windows\bin\connect ion.ps1 UserParameter=db.discovery, powershell -NoProfile -ExecutionPolicy Bypass -File c:\windows\zabbix_agents_3.0.0.windows\bin\state.p s1 UserParameter=db.state[*], powershell -NoProfile -ExecutionPolicy Bypass -File c:\windows\zabbix_agents_3.0.0.windows\bin\state.p s1 $1 "$2"
OS: Windows 2012
Agent Version: 3.0.0
Proxy Version: 3.0.4
Comment