Ad Widget

Collapse

zabbix 1.5.3/1.5.4rev800 trigger creation fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mr_
    Junior Member
    • Jun 2008
    • 4

    #1

    zabbix 1.5.3/1.5.4rev800 trigger creation fails

    hi,
    i'm running centos 5.x with php5.1.6.x and i tested this issue on 1.5.3 and 1.5.4rev8000.
    when tryng to create a trigger i get the following error:
    * Error in query [select distinct t.description,h.host,t.expression,t.triggerid from triggers t left join functions f on t.triggerid=f.triggerid left join items i on f.itemid=i.itemid left join hosts h on i.hostid=h.hostid where t.triggerid=] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    * mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/var/www/html/zabbix/include/db.inc.php:499]

    so it seems an error on the triggerid field.

    Then i have tried to link a template, copy a trigger end edit it; the result is a working trigger, but as i unlink and clear the template from the host the new trigger edited by me is deleted as well.

    I'm pretty new and i don't know if there is an other workaround.

    Can you fix it please? then i'll rebuild the svn version and give you feedback!

    tnx

    P.S. i need to create triggers for RHCS snmp MIBs, if you already have some work done please put in some "contrib" stuff
    Last edited by mr_; 29-06-2008, 13:59.
  • boehser_nick
    Junior Member
    • Jul 2008
    • 5

    #2
    i got the same error

    I got the same error if I want to create a trigger on an item with return type "Text". It should fire if the returned string doesn't contain "keine neuen Anrufe". So I write this expression for the trigger to fire:

    {ZABBIX Server:myself.foncalls[fritz.box,process].str(keine neuen Anrufe)}=0

    If I want to save this trigger I get the same error as mr_.

    If I quote the string I get the same result. I also tried to use just "keine", but I get the error again.

    Is there any solution to solve this problem?

    PS: I'm using zabbix 1.5.3 on an ubuntu server system. PHP Version is 2.5.3.

    thx

    Comment

    • boehser_nick
      Junior Member
      • Jul 2008
      • 5

      #3
      I changed something in DB

      I think this is a problem with functions which can handle text and the php-frontend. I did the following steps to make my trigger work (see above post).

      I created a trigger {ZABBIX Server:myself.foncalls[fritz.box,process].last(0)}=0. Zabbix accepted such a trigger and I did not get the SQL Error from mr_. After this, I searched in the database table "triggers" for the 'triggerid' which belonged to my created trigger. In table "functions" I searched for this 'triggerid'. To make the trigger work, I changed "last" in row 'function' to "str". Furthermore I changed "0" in row 'parameter' to "keine neuen Anrufe". But do this only for the detected "triggerid".
      Back in zabbix frontend, I had 2 triggers. One with the old function and the other one with the new function. I deleted the old one and tested the new trigger. And it works.

      But you have to be careful, beacuse working directly on database is always very dangerous.

      Comment

      • Aly
        ZABBIX developer
        • May 2007
        • 1126

        #4
        Can not confirm this on the latest rev. 5826. Trigger with .str() could be created with no problem.
        Zabbix | ex GUI developer

        Comment

        • mr_
          Junior Member
          • Jun 2008
          • 4

          #5
          with that revision i still get
          * Error in query [select distinct t.description,h.host,t.expression,t.triggerid from triggers t left join functions f on t.triggerid=f.triggerid left join items i on f.itemid=i.itemid left join hosts h on i.hostid=h.hostid where t.triggerid=] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
          * mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/var/www/html/zabbix/include/db.inc.php:499]


          so maybe i'm doing something wrong?

          i created the item ad shown in item.jpg

          then i try to create a trigger as shown in trigger.jpg

          any idea?

          thanks

          P.S. where should i post the complete italian traslation?
          Attached Files

          Comment

          • mr_
            Junior Member
            • Jun 2008
            • 4

            #6
            i also tried to create a trigger of this type

            "{centos_repo:RhcsServicesAllUp. last( 0 ) }=0"

            it is succesfully created!

            then if i try to change it with

            "{centos_repo:RhcsServicesAllUp.str(All services and nodes functional)}=0"

            and clic on "Save", the result is "Trigger updated" but i still see
            "Severity Status Name up Expression Error
            Not classified Enabled Cluster has all services and nodes functional {centos_repo:RhcsServicesAllUp. last( 0 ) }=0 "


            i really like zabbix, is easy and fast to configure thanks to autodiscovering and templates, but i need to use snmp!

            i also finished translating in italian.

            Please help!

            Comment

            • Aly
              ZABBIX developer
              • May 2007
              • 1126

              #7
              I have some doubts in you zabbix version. Because there is no such rev. in our svn: 1.5.4rev8000. So the question is, from where have downloaded your zabbix distro?
              Zabbix | ex GUI developer

              Comment

              • mr_
                Junior Member
                • Jun 2008
                • 4

                #8
                command
                svn co svn://svn.zabbix.com/trunk/

                gives you revision 5826

                (anyway this is only the latest revision i'm trying, also with 1.5.3 did not work)

                Comment

                • boehser_nick
                  Junior Member
                  • Jul 2008
                  • 5

                  #9
                  It works

                  I just installed zabbix 1.5.4 rev 5826 from svn (where I had to create a complete new database ).
                  Now, if I try to define "Text" for "Type of Information" and use ".str" function in trigger zabbix complains and says that ".str" function is only allowed with type "Character" and "Log" (I think it is wonderful to have a well formatted message now, rather than an ugly sql statement ). So I changed the type of my item to "Character" and the gui accepts it. Till now, I thought "Character" is only one character, but it also works with more characters. Now, I just don't understand the difference between "Character" and "Text".

                  Then I tried the ".last" function with information type "Character". But the frontend doesn't accept it and shows a Incorrect trigger expression. [ ... =keine neuen Anrufe] message. I tried to quote the string or just use one word, but with no success.

                  I dont't know which function can be used with what type of information and how to write the particular expression (syntax). But I think it is just a problem of documentation

                  Comment

                  • bill.unger
                    Member
                    • Jun 2007
                    • 79

                    #10
                    Does anyone know if there is a fix for this yet? I just upgraded to v1.5.3 (via the download link on the Zabbix website) and am getting the same errors as above...

                    Comment

                    Working...