View Full Version : Restart Windows services with Zabbix
Hi all, I'm newbie on this forum & on Zabbix too :)
I've setup an Ubuntu Server with Zabbix and I've created a small lab of 5 WIndows 2003 VM Machine (DC, 2 node cluster etcetc...).
I want to monitor a service (ex. print spooler) and, in case of failure/stop/hang, create an action to restart it automatically....but I dunno the correct syntax...Please, can someone help me?? Thanks in advance for all & to all. :)
jroberson
17-03-2009, 22:49
The command line for restarting the service on Windows is:
net stop "service name"
net start "service name"
I haven't gotten Zabbix setup to do this, but I think there is a whay if you "enable remote commands" in your conf file. Check the Zabbix manual on that.
Hi all, I'm newbie on this forum & on Zabbix too :)
I've setup an Ubuntu Server with Zabbix and I've created a small lab of 5 WIndows 2003 VM Machine (DC, 2 node cluster etcetc...).
I want to monitor a service (ex. print spooler) and, in case of failure/stop/hang, create an action to restart it automatically....but I dunno the correct syntax...Please, can someone help me?? Thanks in advance for all & to all. :)
How to do it:
Be sure to enable remote commands on the agent in the zabbix_agentd.conf file (see the comments in it). These are not allowed normally for security reasons, I guess.
Create an item, define a trigger and an action with remote command like net start service
Special checks are required to stop starting the service for more than, say, 3 times. In that case the service definitely has a problem.
The trigger can be based on the service state and should consider the start pending state, too.
I have implemented it - funny enough for the Print Spooler service, too. And it works well.
Regards
Norbert.