Ad Widget

Collapse

Monitoring/starting a Windows Process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • melvin
    Junior Member
    • Sep 2013
    • 5

    #1

    Monitoring/starting a Windows Process

    Hello,

    For our company, some processes have to run. I have configured Zabbix to monitor our processes and send an e-mail when they stop running. Everything is working as expected. My question is: I would like to add another action that starts the process/application. I can't figure out how to do this.

    It is a Windows server 2008 R2 envirement with a graphical application that has to run. It is not a service.

    Our Zabbix version is: 2.2.1

    I have tried batch files, powershell, WMI and commands to start a Windows process. But the application does not start. I have managed to see the application/process in task manager but with no interface.

    Thank you!
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    (I assume you have an already logged in session on your windows box)

    Have a script on the windows box which periodically checks for the existance of a flagfile. You can configure to start it "on logon" via "scheduled tasks".

    while (true): {
    --if the flagfile exists:
    ----delete flagfile
    ----restart app
    ----wait
    }

    When zabbix detects that app is not running it places the flagfile. The watchdog-script would then restart the app.

    Hint: you don't need zabbix for that. Just let the watchdog script restart your app ...

    Comment

    • melvin
      Junior Member
      • Sep 2013
      • 5

      #3
      Thank you for your reply. Do you mean that i create an item that checks if the process is running (like proc.num[]), and if so, create an action that runs a script that puts a file somewhere on the filesystem. And then have a sheduled task check the existence of that file via a script?

      If i use task manager i can create a task whitout a trigger that starts the process. Then create an action in zabbix with the command: schtasks /Run /TN "TASKNAME".

      Maybe i have a wrong interpretation of your answer but if i understand you correctly, i was hoping to accomplish this with Zabbix. It is the same with Zabbix actions, for example, if i run a powershell script , i can send output to a file, but i can't do much more then that because then it won't work anymore.

      Thank you for your answering my question!

      Comment

      • EnigmA-X
        Senior Member
        Zabbix Certified Specialist
        • Oct 2010
        • 116

        #4
        Hi Melvin,

        Did you already look into using remote commands?

        Comment

        • melvin
          Junior Member
          • Sep 2013
          • 5

          #5
          Yes i have. That's what i use to execute a (Windows task sheduler) task that starts the application. example: Zabbix command: schtasks /Run /TN "TASKNAME".

          I was hoping to skip the part of creating a Windows sheduled task to start the application. For example, when i try to create an action with the remote command: notepad.exe or C:\Windows\System32\notepad.exe or start notepad.exe or any other flavor it does not start?

          Thank you for answering!

          Comment

          • steveboyson
            Senior Member
            • Jul 2013
            • 582

            #6
            It is probably because the process will run under the zabbix_agentd account and not in the account of the interactively "logged on" user.

            You could start the zabbix_agentd.exe under that user that is logged on all the time. Then the restart of $APP most likely will work.


            Remember: nowadays even Windows is a multiuser system

            Comment

            Working...