Ad Widget

Collapse

Trigger if host reboots multiple times in X perioid of time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ttsumak
    Junior Member
    • Feb 2019
    • 1

    #1

    Trigger if host reboots multiple times in X perioid of time

    Hey,

    So i've got some hosts, like routers and such. I have a simole working trigger to report if a host reboots or goes down.

    Usually these alerts are not needed, so i would like to make it more usable.

    Currently this reports me if a host reboots:
    template:system.uptime.change(0)}<0


    How could that be changed to only trigger if the host reboots lets say >3 times in 3 hours?
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    This may not be pretty, but you could create an action on your existing reboot trigger that runs a command. This command could be a zabbix_sender to send a value to an item for the rebooted host like "rebooted" = "1". I think it needs to be text. Now you create a new trigger using the count function of 3 in 3 hours.

    Comment

    • totenkult
      Junior Member
      • Apr 2019
      • 2

      #3
      Originally posted by LenR
      This may not be pretty, but you could create an action on your existing reboot trigger that runs a command. This command could be a zabbix_sender to send a value to an item for the rebooted host like "rebooted" = "1". I think it needs to be text. Now you create a new trigger using the count function of 3 in 3 hours.
      I'm actually trying to do this same thing.
      Could you elaborate on how exactly I would go about creating that action and corresponding command?

      Comment

      • dmarsh
        Junior Member
        • Jun 2009
        • 17

        #4
        Code:
        {Template OS Linux:system.uptime.count(5400,600,lt)}>1
        Some caveats but that's the closest I've come.

        Change 5400 to period of time to watch for multiple reboots. I've made it 90mins as that will catch "reboot every hour, oops I meant every day" in cron

        Change 600 many seconds you are collecting system.uptime

        Change >1 to how many reboots you want to alert on

        You might also want to change the 'lt' to 'le' less or equal, change numbers for macros etc
        Last edited by dmarsh; 02-02-2021, 06:39.

        Comment

        • sajid4uu2c
          Junior Member
          • Oct 2020
          • 24

          #5
          Hi,

          I am using the below condition in the trigger.
          Could you please suggest if this works.

          {Template Module Windows generic by Zabbix agent:system.uptime.last(#2,5m)}=1

          I want trigger to fire, only when there are 2 host restarts in last 5 mins

          Comment

          • coec
            Junior Member
            • Jan 2022
            • 2

            #6
            Hey There,

            Trying to get this set up and running into some issues, can you let me know if I have made any mistakes here?

            Thanks!

            Collin




            Click image for larger version

Name:	Screenshot 2022-01-18 151124.png
Views:	1084
Size:	32.9 KB
ID:	438277

            Comment

            • TimTaler
              Junior Member
              • Aug 2023
              • 1

              #7
              I am trying to create a trigger that checks how often the system uptime of a host is below 600 seconds within the last 5400 seconds. However, I keep running into syntax errors in Zabbix.

              I originally tried the following trigger expression:
              zabbix
              Code:
              count(/HOST/system.uptime,5400,600,lt)>1
              But Zabbix immediately returns an error:
              Code:
              Invalid parameter "/1/expression": incorrect expression starting from "count(/HOST/system.uptime,5400,600,lt)>1".
              I also tried using the older syntax with {} brackets:
              Code:
              {HOST:system.uptime.count(5400,600,lt)}>1
              But this also does not work.

              I am using Zabbix Zabbix 7.0.3. and would appreciate any help on how to correctly structure this trigger expression.

              Thanks in advance!

              Comment

              Working...