Ad Widget

Collapse

"is the zabbix server offline?"-check on the server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • janh²
    Junior Member
    • Oct 2012
    • 7

    #1

    "is the zabbix server offline?"-check on the server

    Hi Everyone,

    I'm new to zabbix and I love it so far.
    With a little googling I was able to get everything done the way I like it (the quick start documentation is nice!).

    Now, the reason I post here is that I want the zabbix server to check wether it can actually talk to the outside world. I'm monitoring general availability of hosts and if the zabbix server's data center loses its connection to the rest of the world, it obviously cannot check the monitored servers. Since my zabbix server is in another DC than my servers, it might happen, allthough it probably won't on a regular basis. My simple solution: if you cannot ping google, it's probably your fault and you're the one that's offline, not everyone else, so don't send emails for every server (emails are given to exim locally which will send them via a smarthost when it can talk to it again).
    How would I implement that? I went for a trigger on a host group-template that checks the ping and sets the information with the host availability-trigger depending on said "is google reachable"-trigger. While that worked, it also seemed to mean that a ping check was made for every host that had said item & trigger activated. Is there a smarter way to do that?

    I thought of adding a single host with a ping check that triggers a custom action on the zabbix server which will write a file if "google is offline" (and removes the file if I can ping google again) and than have a custom check in an item on the zabbix server for each monitored server that just checks wether said file exists. That'd probably work and I wouldn't have the multitude of pings, but I'm wondering if there's a solution that is more straigh forward. As I said I'm new to zabbix and while I think I get the basic system, I'm far from a professional.

    Any input is appreciated.

    Thanks

    jan
  • kevind
    Member
    • Sep 2011
    • 40

    #2
    It doesn't have to be that complicated. Zabbix has a feature called "dependencies" which can be defined for each trigger for exactly this purpose.

    You create a trigger called, say, "link_down" that is set whenever the link is down. For each trigger that depends on the link, you set a dependency in that trigger. Then if the link goes down, all the triggers which depend upon it will not fire.

    Comment

    • janh²
      Junior Member
      • Oct 2012
      • 7

      #3
      Yeah, I wanted to do that with dependencies, but it is not that easy

      The direct network connection of my zabbix server doesn't fail, but there might be a problem at the backbone (I've had multiple incidents where I couldn't reach a certain DC for about 10 minutes, and I don't want the zabbix server to go crazy on messaging in those 10 minutes).

      It's just: having a network connection does not necessarily mean I can reach outside of the DC if some uplink is down. If I check that for every host, I'll ping flood my "am I online"-check-host. How did you solve that?

      Comment

      • kevind
        Member
        • Sep 2011
        • 40

        #4
        You don't need to have each host have a separate item to check the link, creating lots of activity.

        You would have one item on one host check the link, and trigger when the link is down. No ping floods required. And it doesn't necessarily have to use pings to check the link, it could use any tests you want.

        Then, all triggers on all hosts which depend on the link, have a dependency on that single trigger on that single host (a trigger can depend on any other trigger, it doesn't have to be a trigger on the same host).

        Comment

        • janh²
          Junior Member
          • Oct 2012
          • 7

          #5
          Ah, I see. Thank you.
          I figured that a trigger can only depend on triggers on the same host and added that general trigger to a template hoping that zabbix would recognize it's about to run the same command multiple times and just automagically transfer the result.

          I will try what you suggested. Thanks!

          Comment

          • kevind
            Member
            • Sep 2011
            • 40

            #6
            If your triggers are in templates, there are some restrictions under Zabbix 1.8, which I think required any dependencies inside templates to refer to the same template.

            Zabbix 2.0 doesn't have that restriction.

            Comment

            • janh²
              Junior Member
              • Oct 2012
              • 7

              #7
              I have now tested it and it works as you said. Also, it does work in 1.8.2, so I'm staying there for now (I like it to be installable by apt-get). I just didn't realize you could change Groups & Hosts when selecting a trigger to depend on.

              Thanks again!

              Comment

              Working...