Ad Widget

Collapse

Using SNMP returned value as trigger name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • myRCzabbix
    Member
    • Jun 2018
    • 39

    #1

    Using SNMP returned value as trigger name

    What I am trying to achieve: monitor our printers' toner levels and send an alert when the toners are empty but I also want to include the toner part number (because there are many different types) in the alert.

    How I am trying to achieve this: created a trigger inside a template with the name "Black toner cartridge is empty. Replacement {ITEM.VALUE2} required." with the following expression: {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last(0)}=0 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Cartridge-Black.prev()}<>0. I have an item (Toner_Cartridge-Black) in the template that gets the toner part number via SNMP.

    The problem: when showing the alert on the dashboard, the value of the toner part number is truncated and shows up as "NPG-71/NPG-71L..." instead of "NPG-71/NPG-71L Black Toner"

    Question: is my method the best way of achieving what I want or is there a better way? If it's the best way to do this, then how can I fully show the toner part number and not have it truncated?
  • myRCzabbix
    Member
    • Jun 2018
    • 39

    #2
    Interestingly enough, if I update the expression from:

    {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last(0)}=0 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Cartridge-Black.prev()}<>0

    to:

    {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last()}>-1 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last()}<16 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Cartridge-Black.prev()}<>0

    the trigger is not "triggered" at all. I have been scratching my head as to why it would break.

    Anyone have any ideas?

    Comment

    • myRCzabbix
      Member
      • Jun 2018
      • 39

      #3
      Nevermind ... I found the solution to both my problems. Posting here in case anyone else encounters the same issue.

      1. Truncating of returned value (toner part number) is fixed via the suggestion in this article: https://www.zabbix.com/forum/zabbix-...-20-characters (editing ITEM_VALUE_TYPE_TEXT in my case since I didn't use LOG type).
      2. Broken expression when indicating a range is fixed by changing the expression from:

      {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last()}>-1 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last()}<16 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Cartridge-Black.prev()}<>0

      to:

      {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last()}>-1 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Level-Black.last()}<16 and {Template - Printer - Canon iR-ADV C5535 C5550 C5560:Toner_Cartridge-Black.strlen()}>0

      Comment

      Working...