Ad Widget

Collapse

How do you monitor a service in Linux and restart is if it's not running?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • meatwad
    Junior Member
    • Aug 2020
    • 3

    #1

    How do you monitor a service in Linux and restart is if it's not running?

    Hi,

    I have a script that does this but I'm sure there's a better way to do it with Zabbix.

    I have a service that occasionally goes into an 'exited' state. What is the best way to monitor that service and have it be restarted if it's in any other state than 'running'?

    Thanks!
  • shamrock20
    Junior Member
    • Jul 2020
    • 5

    #2
    You can use action to restart the service (via remote command). I do something similar on Windows, I basically have it set to run the command to start a service that isn't running X number of times - before it gets escalated as an alert

    Comment

    Working...