Ad Widget

Collapse

String/RegExp triggers acting weird with 1's and 0's, anyone experience this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monolithic
    Junior Member
    • May 2009
    • 21

    #1

    String/RegExp triggers acting weird with 1's and 0's, anyone experience this?

    Hey all,

    I'm 99% done with my DR environment including monitoring hardware with SNMP and mibs. I've managed to set up the traps to map to the appropriate hosts. The issue that i'm having has been inconsistent and hopefully someone can shed some light on this as I do not want to constantly monitor the "latest data" for snmp traps.

    Basically each host has an item "snmptrap" and when i send test traps they go there and are in the correct host's latest data. My issue is triggering. I use the following format:

    {mailserver-ilo:snmptrap.str(SNMP)}=0 &
    {mailserver-ilo:snmptrap.str(snmp)}=0

    This was working and from my understanding, whenever SNMP or snmp is found in that item it will trigger.

    At some point these stopped triggering and when I switched them to 1's instead of 0's it was triggering. (EG. {mailserver-ilo:snmptrap.str(snmp)}=1)

    I must be missing something. This seems to work for now though:
    {mailserver-ilo:snmptrap.regexp(SNMP)}#0

    Can anyone tell me what I'm doing wrong? Thanks again!
  • monolithic
    Junior Member
    • May 2009
    • 21

    #2
    I take it back:
    {mailserver-ilo:snmptrap.regexp(SNMP)}#0 Does not work either.

    Basically the snmptrap that comes in is of type "character" and in it, it contains SNMPv2-SMI::xxxx:xxxxx:xxx so i'm filtering for the "snmp" or "SNMP" string. I'm at a loss because sometimes the 1's work and then they don't when I test, and then i switch them to 0 and then they work. Please help!!

    Comment

    • Kai-Kai
      Senior Member
      • Apr 2009
      • 142

      #3
      {mailserver-ilo:snmptrap.str(SNMP)}=0 &
      {mailserver-ilo:snmptrap.str(snmp)}=0
      If I don't make a mistake, that means your last value from the item contains both "SNMP" AND "snmp".

      If you want the trigger to become active when you receive one of the two strings : SNMP or snmp, I think, it should be something like :

      {mailserver-ilo:snmptrap.str(SNMP)}=1 |
      {mailserver-ilo:snmptrap.str(snmp)}=1

      Str send 1 if it found the string, 0 if it doesn't. So if you want to test if SNMP or snmp is found, you need to test =1. Then, if you put & between the 2 possibilities, it means BOT should be ok to trigger. I don't thnik you'll find SNMP AND snmp, I think it's SNMP OR snmp, so you should put | instead of &.

      Am I right ?

      Hopping it helps.

      Comment

      • monolithic
        Junior Member
        • May 2009
        • 21

        #4
        Okay it happened again, i switched all my triggers to be
        {hostname:snmptrap.str(trap)}#0

        And now they don't work, however when I switch them to #1 they work.

        Is this a bug? Or is there anyway I can have a trigger that alerts when the string is not null? I can reset so the snmptrap item is null and whenever it receives any alert it will trigger? Anyone have any ideas? Thanks!

        Comment

        • Kai-Kai
          Senior Member
          • Apr 2009
          • 142

          #5
          Have you well replaced & by | ?

          What is the exact code of your trigger ?
          And can you give us an example of what is received by your item and you want the trigger to activate on ?

          I use .str(string)=1 to monitore logs, finding "string" in it, and it works very well...

          Is this a bug? Or is there anyway I can have a trigger that alerts when the string is not null? I can reset so the snmptrap item is null and whenever it receives any alert it will trigger? Anyone have any ideas? Thanks!
          If you want to make a trigger based on data received or not received, I think you can use the ".nodata()" function.

          Comment

          Working...