Ad Widget

Collapse

SNMP: how to write trigger expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gorodgeroy
    Junior Member
    • Feb 2017
    • 18

    #1

    SNMP: how to write trigger expression

    Hi, guys!
    I need to monitor printer's toner level. So I have this OID:
    .1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.8.0
    It returns string like 0x63 01 04 00 00 00 01 11 01 04 00 00 00 96 41 01 04 00 00 26 AC 31 01 04 00 00 00 01 6F 01 04 00 00 22 C4 81 01 04 00 00 00 5A 86 01 04 00 00 00 10 FF

    Interesting part is 31 01 04 00 00 00 01 - last number shows level of toner (01 - full, 02 - low, 03 - empty, 04 - no device).

    How can I write expression to find if substring differs from 31 01 04 00 00 00 01? I've found no clues, I know only that I should do something with {#SNMPVALUE} to compare it with 31 01 04 00 00 00 01
  • batchenr
    Senior Member
    • Sep 2016
    • 440

    #2
    Originally posted by gorodgeroy
    Hi, guys!
    I need to monitor printer's toner level. So I have this OID:
    .1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.8.0
    It returns string like 0x63 01 04 00 00 00 01 11 01 04 00 00 00 96 41 01 04 00 00 26 AC 31 01 04 00 00 00 01 6F 01 04 00 00 22 C4 81 01 04 00 00 00 5A 86 01 04 00 00 00 10 FF

    Interesting part is 31 01 04 00 00 00 01 - last number shows level of toner (01 - full, 02 - low, 03 - empty, 04 - no device).

    How can I write expression to find if substring differs from 31 01 04 00 00 00 01? I've found no clues, I know only that I should do something with {#SNMPVALUE} to compare it with 31 01 04 00 00 00 01
    maybe the trigger should look somthing like this :
    Code:
     
    {Template SNMP Interfaces:ITEMKEY[{#SNMPVALUE}].str("31 01 04 00 00 00 03")}=1
    menning that when ever it catch this string 31 01 04 00 00 00 03 it will fire alert, try this first with 01 to check

    Comment

    • gorodgeroy
      Junior Member
      • Feb 2017
      • 18

      #3
      Originally posted by batchenr
      maybe the trigger should look somthing like this :
      Code:
       
      {Template SNMP Interfaces:ITEMKEY[{#SNMPVALUE}].str("31 01 04 00 00 00 03")}=1
      menning that when ever it catch this string 31 01 04 00 00 00 03 it will fire alert, try this first with 01 to check
      Thank you! It worked for me.

      Comment

      Working...