Ad Widget

Collapse

How do I monitor a service in Linux for when it goes down?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NewUser1
    Member
    • Oct 2022
    • 36

    #1

    How do I monitor a service in Linux for when it goes down?

    I currently have the item and trigger configured as follows

    item: proc.num["isc-dhcp-server",,trace]
    trigger: min(/server/proc.num["isc-dhcp-server",,trace],5m)

    the goal is to get a notification when the service goes down for more than 5 mins. Is this the correct way to do it?
    Last edited by Alex.S; 04-01-2023, 09:22.
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    I think you're close, but the trigger min(....) needs " = 0" added.

    Comment

    • NewUser1
      Member
      • Oct 2022
      • 36

      #3
      Originally posted by LenR
      I think you're close, but the trigger min(....) needs " = 0" added.
      This seems to work but it doesn't resolve in Monitoring > Problems when the service comes back on.

      Comment


      • tomijs
        tomijs commented
        Editing a comment
        You could try to add a recovery expression in the same trigger for it to resolve when it comes back online, that might work. Add a check for last received value and if it is 1 then the problem should resolve.
        last(/server/proc.num["isc-dhcp-server",,trace])=1
    • NewUser1
      Member
      • Oct 2022
      • 36

      #4
      I noticed the problem was I was looking for the service and not the process! got it to work now Thank you!

      Comment

      • LenR
        Senior Member
        • Sep 2009
        • 1005

        #5
        FYI agent2 can monitor systemd https://www.zabbix.com/integrations/systemd

        Comment

        • wdw
          Junior Member
          • Jul 2024
          • 5

          #6
          Would you mind posting your full solution?

          Comment

          Working...