Ad Widget

Collapse

Trigger on string change

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mvrasmussen
    Junior Member
    • Apr 2011
    • 14

    #1

    Trigger on string change

    Hello

    I need some advice on creating functional triggers based on what string is present as value

    I have an specifik SNMP item on one of our printers, on normal curcumstances it says:
    Code:
     "Ready           "
    If there is no paper left (or the paper tray is opened it changes to
    Code:
    "Load Paper"
    So it resembles whats in the display

    What i'm trying to do is triggering when the value changes to "Load Paper" -so an action can be issued.

    I've tried the directions in http://www.zabbix.com/forum/showthread.php?t=12402 but it doesent accept it

    Any clues?

    Thanks
    Mads
    Denmark
  • Davidus
    Senior Member
    • Dec 2010
    • 281

    #2
    Probably might work for you,

    {HOSTNAME:itemname.strlen(0)}=10
    Word "Load Paper" contains 10 characters. Therefore, this trigger will fire up if string length equals to 10
    Choose “Character” for your item type

    good luck

    Comment

    • mvrasmussen
      Junior Member
      • Apr 2011
      • 14

      #3
      Originally posted by Davidus
      {HOSTNAME:itemname.strlen(0)}=10
      Thank you for your reply, unfortionally it only returns:

      Code:
      Not allowed value detected in element: Check expression part starting from ' strlen(0)}=10 '
      When i tried to add the trigger

      My trigger looks like this:
      Code:
      {HP LaserJet P2055dn:display.strlen(0)}=10
      Do i understand it right, there is'nt a way to trigger with a string?
      Last edited by mvrasmussen; 21-06-2011, 09:42.

      Comment

      • Davidus
        Senior Member
        • Dec 2010
        • 281

        #4
        Code:
        {HP LaserJet P2055dn:display.strlen(0)}=10
        This condition is right

        What is your item type? Is it zabbix trapper, agent or..?
        What is your Type of information? Is it Character, Log…?

        Comment

        • Davidus
          Senior Member
          • Dec 2010
          • 281

          #5
          try also,
          Code:
          {HP LaserJet P2055dn:display.strlen(15)}#15
          Usually string is 15character long and trigger will fire up if this string will be less or grater than 15

          this one might not be right, but take a shot...

          Comment

          • mvrasmussen
            Junior Member
            • Apr 2011
            • 14

            #6
            It's SNMP

            See attachment
            Attached Files

            Comment

            • mvrasmussen
              Junior Member
              • Apr 2011
              • 14

              #7
              Originally posted by Davidus
              try also,
              Code:
              {HP LaserJet P2055dn:display.strlen(15)}#15
              Usually string is 15character long and trigger will fire up if this string will be less or grater than 15

              this one might not be right, but take a shot...
              Same error ;/

              Comment

              • Davidus
                Senior Member
                • Dec 2010
                • 281

                #8
                The only issue could be with data type
                Honestly, have never worked with SNMP yet…

                My item looks like this:
                Type: zabbix trapper
                Type of information: character

                My zabbix trapper sends 0 to item if everything is ok, else my strings length is more than 1 (example: “cant ping server”) and my trigger expression looks like this {HOSTNAME:itemname.strlen(0)}#1
                It works for me

                Comment

                • Davidus
                  Senior Member
                  • Dec 2010
                  • 281

                  #9
                  ok, why do you have "display" for your item name? "display" is your item description

                  Comment

                  • mvrasmussen
                    Junior Member
                    • Apr 2011
                    • 14

                    #10
                    I cant get the data anywhere else than snmp

                    the item is called display because it resembles whats written in the display on the printer

                    Comment

                    • Davidus
                      Senior Member
                      • Dec 2010
                      • 281

                      #11
                      No, I mean that you should have SNMP OID in your trigger expression instead of item description

                      Code:
                      {HP LaserJet P2055dn:display.strlen(0)}=10
                      In this case there is no link to your snmp item

                      Comment

                      • mvrasmussen
                        Junior Member
                        • Apr 2011
                        • 14

                        #12
                        I really don't understand that.. the data comes back on the item just fine, i have a similar trigger working on the printer where i'm using another item with a diffent OID and that works fine (but thats a numeric value)

                        Comment

                        • Davidus
                          Senior Member
                          • Dec 2010
                          • 281

                          #13
                          Can you show me the other trigger which is working good?

                          Comment

                          • mvrasmussen
                            Junior Member
                            • Apr 2011
                            • 14

                            #14
                            The other item i have is attached

                            The trigger used:

                            Code:
                            {HP LaserJet P2055dn:paper.last(0)}=0
                            This is working fine

                            (The problem with it is that it goes to 0 with all errors, not just paper)
                            Attached Files

                            Comment

                            • Davidus
                              Senior Member
                              • Dec 2010
                              • 281

                              #15
                              In this case I`m out of options, sorry

                              Comment

                              Working...