Ad Widget

Collapse

Disabling FS triggers created from prototypes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • legoman
    Junior Member
    • Jan 2014
    • 4

    #1

    Disabling FS triggers created from prototypes

    Hi all,

    In 2.0.8, I created a new template and linked it to Template OS AIX. I cloned some items and triggers, disabled the ones from the linked template, then linked the new template to discovered hosts and all's well.

    I recently upgraded to 2.2.1 (surprisingly very easy -- TYVM!) and decided to modify the trigger prototypes for Mounted filesystem discovery by giving the values of the "vfs.fs.size" a range in order to prevent stacking of error severities. e.g.:
    {Template My OS AIX:vfs.fs.size[{#FSNAME},pfree].last(0)}<20&{Template My OS AIX:vfs.fs.size[{#FSNAME},pfree].last(0)}>9.999999

    I then disabled the original trigger prototype and allowed the new one to propagate to the linked hosts. It did, but the original triggers remain. In other words, the disabled status of the trigger prototype did not propagate to the linked systems and their respective file systems.

    With over 1000 total triggers, it's going to take a very long time to find and disable the ones created from the original prototype. Is there an easier way to do this?

    Thanks!
    Rich
  • thiagolmelo
    Junior Member
    Zabbix Certified Trainer
    Zabbix Certified Specialist
    • Dec 2009
    • 27

    #2
    Hey legoman... Letme know if you tried to restart proxy/server after that?

    Pay attention that the trigger will be disabled only when Discovery run again.

    Regards

    Thiago Leão Melo
    ----------------------
    Unirede Soluções Corporativas
    www.unirede.net
    __________________
    --
    Thiago Melo
    [url]www.zabbix.com.br[/url]
    [url]www.uniredeinfo.com.br[/url]
    Porto Alegre - RS - Brasil

    Comment

    • legoman
      Junior Member
      • Jan 2014
      • 4

      #3
      Hi Thiago,

      Yesterday, I restarted the Zabbix server ("/etc/init.d/zabbix restart" on Linux), and Discovery has run several times since, but the hosts still have the propagated trigger enabled.

      Thanks for the suggestion though...

      Rich

      Comment

      • legoman
        Junior Member
        • Jan 2014
        • 4

        #4
        Well, I ended up manually disabling every trigger generated on every discovered host. I first modified the prototype to have a severity of "Not classified" so that it would be easier to sort the trigger list for disabling. This did propagate to every host (yay!).

        I then went to the Configuration->Hosts->Triggers page. I sorted the list by Severity to get the "Not classified" ones at the top, but for some reason the checkbox on these triggers is disabled. So I still had to disable them one-by-one.

        It seems that there's the potential for a bugfix and maybe an enhancement request here, but without some information, I'm not which is applicable...

        Thanks,
        Rich

        Comment

        • izto
          Junior Member
          • May 2014
          • 1

          #5
          Do it in the database

          I found myself in the same position as legoman: Trying to disable a bunch of LLD generated triggers after I realized I didn't need them (The FS free space below 20% one, BTW).

          I'll leave here a description of what I did to solve the issue in case someone arrives to this thread in the future:

          As noted in earlier posts the "Enabled/Disabled" status will NOT be propagated to the created items whether set in the template discovery rule definition nor in the host's discovery rule definition, so if you're using the GUI you are pretty much stuck with manually enabling / disabling the affected triggers one by one or deleting and recreating the host (Hopefully via host export -> delete -> host import). It also seems that Aleksandr intends to keep it that way according to this:



          I had a bunch of hosts (About 40) and a bunch of triggers on each host to disable. 230 triggers in total. I guess there are people with lots more. So I went to the source in triggers.php. As far as I can tell when you click on "Disable" on the trigger list the code in that file ends up changing 3 fields in the "triggers" table from the zabbix database:

          status => TRIGGER_STATUS_DISABLED (Defined as 1 in include/defines.inc.php)
          value_flags => TRIGGER_VALUE_FLAG_UNKNOWN (Also defined as 1)
          error => 'Trigger status became "Disabled"'

          So if you can come up with a SELECT query that lists the triggerid for the triggers you want to disable then mass-disabling them is easy. In my case the SELECT was this:

          Code:
          SELECT triggerid
          FROM   triggers
          WHERE description ~* 'disk space.*less.*20%' AND NOT description  ~* '{#';
          And the PostgreSQL mass-disable query ended up looking like this:

          Code:
          UPDATE triggers
          SET status=1, value_flags=1, error='Trigger status became "Disabled"'
          WHERE triggerid IN ( 
             SELECT triggerid
             FROM   triggers
             WHERE description ~* 'disk space.*less.*20%' AND NOT description  ~* '{#'
          );
          I hope this helps. YMMV.

          Comment

          • Burps
            Junior Member
            • Nov 2014
            • 10

            #6
            Same with MySQL

            Hello,

            I had the same issue to disable a trigger on several network interface.
            Using Zabbix 2.4.2, MySQL :

            Code:
            SELECT triggerid, description,  status, flags, error 
            FROM   triggers 
            WHERE description LIKE 'Operational status was changed on interface e%';
            And to update (MySQL != PostgreSQL) :
            Code:
            UPDATE triggers 
            SET status=1 
            WHERE triggerid IN (
            	SELECT triggerid FROM (
            		SELECT triggerid
            		FROM   triggers 
            		WHERE description 
            			LIKE 'Operational status was changed on interface e%'
            		) as x
            	)
            ;
            I looked at the flags and error values after changing them on the GUI, but they did not change, so I decided to exclude them from the SQL update

            Comment

            Working...