Ad Widget

Collapse

alert regarding host tag value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ignace_Frometon
    Junior Member
    • Dec 2021
    • 26

    #1

    alert regarding host tag value

    Hello there !


    i would like to configure a trigger and/or action if a host has a particular tag value during a period of time

    for example : if host SERVER01 has the tag STATUS : FALSE, i would like to receive a notification


    how could i achieve that without external script ?


    cheers !
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Tags are not meant for trigger expressions. They are for tagging generated events. So, at first event is generated and then tags are added to it...

    If you already have something that updates tags, then you may aswell have an item for that and use it for trigger.

    Comment

    • Ignace_Frometon
      Junior Member
      • Dec 2021
      • 26

      #3
      Hello Cyber,

      thanks for your answer.

      i explain my need : we have several servers that are shut down every evening and started in the morning. This is made with ansible. While those servers are not running, they are in maintenance state in zabbix (this is also made with ansible). I would like to have a notification if the maintenance is still valid during office hours (meaning that ansible did not work properly).

      as i did not find how to configure a trigger or action regarding maintenance state, i tried to play with tags with no luck so far. I have a workaround : a bash script that would query zabbix api, get the list of hosts under maintenance in a json file, and create items and triggers with that file. But if it is possible, i would prefer to avoid such a solution.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        Idea is OK, but I have some doubts.. If you set your maintenance periods correctly, then I don't see a way, how it will not end as needed.. And if it fails to enter it at all, then it will also not be active during office hours .. Because it was never entered...
        So all you can achieve here is to monitor if ansible did its run correctly, but your maintenance will never be active during office hours...

        Comment

        • Ignace_Frometon
          Junior Member
          • Dec 2021
          • 26

          #5
          we want the maintenance to be deleted by ansible, instead of scheduling the end : we have a lot of server in that case, each with a particular time period for shutting down, and we do not want them to be started without immediatly ending the maintenance.

          we already had the case where ansible did not start properly and deleted maintenance for just one host, and this is the case where we should be alerted.

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #6
            Got the point, but I don't have any other suggestions, but to try to add endings to maintenances... It would reduce the risk of having them active, when not needed. It might be tricky, if you do not exactly know when startup is done, but maybe you can predict it at least with 0.5-1 h precision? Would not lose too much if not deleted in time, but at least ends..

            Comment

            Working...