Ad Widget

Collapse

Restart Windows services with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • latenka
    Junior Member
    • Mar 2009
    • 1

    #1

    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
    Senior Member
    • May 2008
    • 124

    #2
    The command line for restarting the service on Windows is:
    Code:
    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.

    Comment

    • NOB
      Senior Member
      Zabbix Certified Specialist
      • Mar 2007
      • 469

      #3
      Originally posted by latenka
      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:
      1. 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.
      2. 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.

      Comment

      • rayglesias
        Junior Member
        • Apr 2020
        • 1

        #4
        Hello,

        Did you ever get this to work? I am trying to setup an action to restart ReportServer service that fixes an issue we randomly see. Please if you have any suggestions let me know.

        Thank you

        Comment

        Working...