Zabbix Share

Zabbix templates, modules & more
Log in
Choose social to login:
Login With Google
Login With Github

Nav view search

Navigation

Advanced Search
  • Applications
  • Cloud
  • Databases
  • Network Appliances
  • Network Devices
  • Official Templates
  • Operating Systems
  • Power (UPS)
  • Printers
  • SCADA, IoT, Energy, Home Automation, Industrial monitoring
  • Server Hardware
  • Storage Devices
  • Telephony
  • Unsorted
  • Virtualization
  • Zabbix
    • API Libraries
      • Bash
      • C#
      • Clojure
      • PHP
      • Powershell
      • Python
      • Ruby
    • DB (Partitioning, storage solutions)
    • Icon sets
    • Installers
    • Notifications
    • Provisioning and deploy
    • Tools and utilities
    • Web Addons
    • Zabbix module language bindings

Return a value on "No such instance"

I needed to check whether an snmp value existed in a table or not. This script will return 'something' if the snmp value doesn't exist so you can use it in triggers etc.

My use case:
We monitor a lot of Cisco switches. I want to know when a port is in "error disabled" state which could by caused by bpduGuard (spanning tree problems) 802.1X auth probblems, floodcontrol etc.

Cisco uses a table which lists all ports that've been disabled:

1.3.6.1.4.1.9.9.548.1.3.1.1.2.{#SNMPINDEX}.0

So, if the value exists in the table, there's a problem with the port and the integer value will tell you exactly what the problem is. If the value is NOT present, that means the port is working as expected.

Because this will cause Zabbix to generate a "No such instance currently exists at this OID' you can't do anything with this. I had a trigger on this which would never recover because Zabbix can't handle the non existing value.

This script takes 5 arguments:

  1. Host
  2. The requested oid
  3. Error value (The error value you want to replace) (optional)
  4. Return value (something like 0/1, FALSE/TRUE) (optional)
  5. SNMP Version (optional)

By default, it will return 0 instead of 'No such...'

Script should work on all zabbix versions.

 IMPORTANT UPDATE!

The previous version wasn't working! I made an error which caused the script to always return 0. Please use the new version.

Rating
501
1 vote

Listing Details

Type
Module
Min Zabbix version
1.8.x
Features
  • SNMP Agent
Created
2018-09-01
Modified
2020-04-06 15:14:14
Version 1.8
Download (232 downloads)
3 version, '2018-09-03 14:31' modified
Author
Michel van Son
Owner
Solved-IT
RecommendReportOwner's listing
All resources created by third parties; use at your own risk
© 2001-2018 by Zabbix SIA. All rights reserved. Trademark Policy · Contact us