q1x / zabbix-templates

My collection of Zabbix Templates
54 stars 50 forks source link

Update Version with backward compatibility #3

Closed pkleanthous-zz closed 8 years ago

pkleanthous-zz commented 10 years ago

You can run the script with no arguments and it will return all the services powershell .\service_lld_WMI.ps1

You can run the script with arguments and it will return only a family of services This script is getting 2 arguments as input -regex "The regular expression that will search each like to match" -sun "The Service Unique Name" powershell .\service_lld_WMI.ps1 -regex "Appication\w+" -sun "_App"

In Zabbix agent you must put the following lines in the config

UnsafeUserParameters=1 UserParameter=service2.lld[_],powershell "[PATH TO SCRIPT]\service_lldWMI.ps1" -regex "'$1'" -sun "$2" UserParameter=service.lld[],powershell "[PATH TO SCRIPT]\service_lld_WMI.ps1"

Without arguments you will have the old MACRO format {#SERVICESTATE} With arguments you will have the following MACRO format {#SERVICESTATE[$-sun passed argument]}

q1x commented 8 years ago

Thank you, but I'm deprecating the script as it is now a default discovery for Zabbix 3.0.