Hey guys.
I'm using Zabbix 6.2 and, every now and then, I get some Windows "service is not running" event. Some of those services, I can just restart.
Basically, I'm using "Windows services discovery" to find and monitor those services, and the associated trigger offers the following event name:
So, a simple command or two to restart the service was enough for me.
For that, I created a script to issue the above command while using a macro function.
I believe the syntax is correct, but when I test it, the Net Start output shows me the command is wrong.
So, it seems "{EVENT.NAME}" macro was not properly filtered with the "regsub" function.
Maybe I'm doing something wrong... Any ideas?
Thanks
I'm using Zabbix 6.2 and, every now and then, I get some Windows "service is not running" event. Some of those services, I can just restart.
Basically, I'm using "Windows services discovery" to find and monitor those services, and the associated trigger offers the following event name:
Code:
"{#SERVICE.NAME}" ({#SERVICE.DISPLAYNAME}) is not running (startup type {#SERVICE.STARTUPNAME})
So, a simple command or two to restart the service was enough for me.
Code:
NET START "{#SERVICE.NAME}"
For that, I created a script to issue the above command while using a macro function.
Code:
NET START {{EVENT.NAME}.regsub(^\"(.*)\".*,\1)}
I believe the syntax is correct, but when I test it, the Net Start output shows me the command is wrong.
System error 123 has occurred.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
So, it seems "{EVENT.NAME}" macro was not properly filtered with the "regsub" function.
Maybe I'm doing something wrong... Any ideas?
Thanks
Comment