Ad Widget

Collapse

'Item became unsupported trigger'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • v.rusinov
    Junior Member
    • Apr 2008
    • 22

    #1

    'Item became unsupported trigger'

    Hi.

    Sometimes I have problems with items that beacames unsupported (due to fs permission/selinux/template changes). They becomes silently disabled and triggers of course too.

    I'd like to add trigger which would fire when one or more items becomes unsupported for host. So I'd be able to see e-mail and check why is became unsupported.
    It seems I need to create 'number of not supported items' item. Is there any way to do that without directly running sql on db?

    Thank you.
  • Calimero
    Senior Member
    • Nov 2006
    • 481

    #2
    Originally posted by v.rusinov
    Hi.

    Sometimes I have problems with items that beacames unsupported (due to fs permission/selinux/template changes). They becomes silently disabled and triggers of course too.

    I'd like to add trigger which would fire when one or more items becomes unsupported for host. So I'd be able to see e-mail and check why is became unsupported.
    It seems I need to create 'number of not supported items' item. Is there any way to do that without directly running sql on db?
    zabbix' behavior regarding unsupported items is indeed a bit annoying. I expected it to still evaluate triggers (especially the .nodata() function) on unsupported items but zabbix totaly ignores unsupported items. I don't understand the rationale behind this...

    I've eventually patched zabbix (2 lines) to run .nodata() against unsupported items.

    There's a built-in item "number of unsupported items" (zabbix[items_unsupported]) as you said but it's not per host. Only the global value is returned.

    If you don't want to patch zabbix it seems the only solution is an external script that will query the database as you said.

    Comment

    • Padawan.AVT
      Junior Member
      • May 2009
      • 26

      #3
      Please tell me more about your patch

      Comment

      • Calimero
        Senior Member
        • Nov 2006
        • 481

        #4
        Originally posted by Padawan.AVT
        Please tell me more about your patch
        So far it's rather ... crude. But as long as we get SMS/mail notifications we're happy. And only a few items/triggers are concerned.

        I haven't patched the UI to have a consistent behavior and my changes in zabbix_server's code are just quick hacks... Triggers that will go ON because of unsupported items (through .nodata()) will generate events (Monitoring > Events) but won't appear in Monitoring > Overview, Monitoring > Triggers or the dashboard. Actions are correctly handled.

        On one hand that hack improves reliability/fault detection, on the other hand it's really ugly and it would require more work and maintenance to be really acceptable. As I said in another thread I think I'll try and improve/harden the UserParameter scripts we use, trying to catch "every" error so that I won't end up with unsupported items. I'll probably drop the patch because my client probably won't maintain it anyway.

        Code:
        Index: zabbix_server/timer/timer.c
        ===================================================================
        --- zabbix_server/timer/timer.c (.../upstream/current/src)      (revision 24)
        +++ zabbix_server/timer/timer.c (.../local/current/src) (revision 24)
        @@ -70,11 +70,12 @@
                */
        
                        result = DBselect("select distinct %s, functions f where h.hostid=i.hostid and h.status=%d"
        -                               " and i.status=%d and f.function in ('nodata','date','dayofweek','time','now')"
        +                               " and i.status in (%d, %d) and f.function in ('nodata','date','dayofweek','time','now')"
                                        " and i.itemid=f.itemid" DB_NODE,
                                        ZBX_SQL_ITEM_SELECT,
                                        HOST_STATUS_MONITORED,
                                        ITEM_STATUS_ACTIVE,
        +                               ITEM_STATUS_NOTSUPPORTED,
                                        DBnode_local("h.hostid"));
        
                        while (NULL != (row = DBfetch(result))) {
        Index: libs/zbxserver/functions.c
        ===================================================================
        --- libs/zbxserver/functions.c  (.../upstream/current/src)      (revision 24)
        +++ libs/zbxserver/functions.c  (.../local/current/src) (revision 24)
        @@ -140,8 +140,7 @@
                zabbix_log( LOG_LEVEL_DEBUG, "In update_triggers [itemid:" ZBX_FS_UI64 "]",
                        itemid);
        
        -       result = DBselect("select distinct t.triggerid,t.expression,t.description,t.url,t.comments,t.status,t.value,t.priority,t.type from triggers t,functions f,items i where i.status<>%d and i.itemid=f.itemid and t.status=%d and f.triggerid=t.triggerid and f.itemid=" ZBX_FS_UI64,
        -               ITEM_STATUS_NOTSUPPORTED,
        +       result = DBselect("select distinct t.triggerid,t.expression,t.description,t.url,t.comments,t.status,t.value,t.priority,t.type from triggers t,functions f,items i where i.itemid=f.itemid and t.status=%d and f.triggerid=t.triggerid and f.itemid=" ZBX_FS_UI64,
                        TRIGGER_STATUS_ENABLED,
                        itemid);

        Comment

        • v.rusinov
          Junior Member
          • Apr 2008
          • 22

          #5
          Calimero, thank you for your help and patch. I've understood the idea and may be I'd have some time to improve patch (show triggers on web-interface).
          Currently I use trigger with zabbix[items_unsupported] diff to fire an alert when items became broken.

          Comment

          • bast
            Junior Member
            • Sep 2008
            • 11

            #6
            I have open a bug, and I will apply your patch.

            Comment

            • zabbix_zen
              Senior Member
              • Jul 2009
              • 426

              #7
              Has there been any progress on this?

              Comment

              • andrewd
                Junior Member
                • Jun 2010
                • 26

                #8
                If it helps, I've made a template which checks for unsupported items and triggers on a per host basis. You'll get one alert per host for unsupported items and there is also an item that contains the items in error.

                I'm using this at work as so far it's worked well and made life a lot easier. Let me know if you encounter any issues.

                Screenshot and download link

                Comment

                • emmanux
                  Member
                  Zabbix Certified Specialist
                  • Mar 2013
                  • 47

                  #9
                  Solved in 2.2:

                  Comment

                  • mschedrin
                    Senior Member
                    • Jun 2009
                    • 179

                    #10
                    Originally posted by emmanux
                    Unfortunately this does not allow to trigger on item becoming unsupported. Executing an action is often not suitable. I have several cases when I have to flash a trigger when item becomes unsupported.

                    Comment

                    • rekeds
                      Junior Member
                      • Feb 2014
                      • 21

                      #11
                      Originally posted by mschedrin
                      Unfortunately this does not allow to trigger on item becoming unsupported. Executing an action is often not suitable. I have several cases when I have to flash a trigger when item becomes unsupported.
                      you are the man!

                      I totally agree, I don't want the NOC to receive emails, better they see the changes in Dashboard!

                      Comment

                      • mschedrin
                        Senior Member
                        • Jun 2009
                        • 179

                        #12
                        Originally posted by rekeds
                        you are the man!

                        I totally agree, I don't want the NOC to receive emails, better they see the changes in Dashboard!
                        Then go and vote for it https://support.zabbix.com/browse/ZBX-7494
                        I have put a more detailed explanation there.

                        Comment

                        • rekeds
                          Junior Member
                          • Feb 2014
                          • 21

                          #13
                          Originally posted by mschedrin
                          Then go and vote for it https://support.zabbix.com/browse/ZBX-7494
                          I have put a more detailed explanation there.
                          done, bro!

                          Comment

                          Working...