Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_iferror.py

Rating
0 votes
Favoured:
1
Current Version
0.6
Last Release Date
2013-12-28
Compatible With
  • Nagios 2.x
  • Nagios 3.x
License
GPL
Hits
25125
Files:
FileDescription
check_iferror.pyPython plugin
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Nagios plugin to check interface error count OIDs via SNMP, caching the result and alerting if the user defined threshold in the user defined timeframe is reached.

Optionally:
- Checks operational state of the interface as well. Works with Counter32 and HexString values;
- Returns perfdata;
- Supports preset OIDs;

Caveats / todo:
- Supports SNMPv1 only.
- For simplicity uses filesystem mtime
- Tested with Python 2.6, 2.7 (should work with 2.4, though)
- Needs python > 2.6, pysnmp > 4.2.5, python-argparse. On older systems use 'pip' or easy_install to get get a corresponding version of pysnmp if the package system's version is too old.
$ ./check_iferror.py -h
usage: check_iferror.py [-h] -H HOST [-C COMMUNITY] [-o OID] [-O IFOID]
[-S IFUPSTATE] [--warnifdown] [--okifdown]
[-i INTERFACE] [--preset PRESET] [-P PORT]
[-w WARNING] [-c CRITICAL] [-t TIME] [-s SCRATCH] [-p]
[-d] [-T] [-V]

Nagios plugin, interned to check error count OIDs via SNMP. A non-zero exit
code is generated, if the counter delta exceeds the waring / critical values
inthe evaluation time period. Additionally the plugin checks for the interface
state if arguments --ifoid and --ifupsate are supplied. The plugin will exit
critical/warning if the the interface is down.Recommendation: Use longer
check_intervals with a low recheck count.

optional arguments:
-h, --help show this help message and exit
-H HOST, --host HOST SNMP Agent IP / hostname
-C COMMUNITY, --community COMMUNITY
Read community name (default: "public")
-o OID, --oid OID Error count base OID
-O IFOID, --ifoid IFOID
Interface base OID
-S IFUPSTATE, --ifupstate IFUPSTATE
Expected interface operational state (integer)
--warnifdown Exit with warning instead of critical if interface is
down
--okifdown Exit with ok instead of critical if interface is down
-i INTERFACE, --interface INTERFACE
Interface number. Appended to the base OID
--preset PRESET Use OID preset
-P PORT, --port PORT SNMP port
-w WARNING, --warning WARNING
Warning threshold (Count)
-c CRITICAL, --critical CRITICAL
Critical threshold (Count)
-t TIME, --time TIME Evaluation time period. (in hours, default 24h)
-s SCRATCH, --scratch SCRATCH
Scratch / temp base directory. Must exist. (default:
/tmp)
-p, --perfdata Print performance data, (default: off)
-d, --debug Verbose mode
-T, --test Run test case; needs WAN connection
-V, --version show program's version number and exit

Currently only SNMPv1 and plain OIDs are supported. Needs python > 2.6, pysnmp
> 4.2.5, python-argparseThis program is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License, or
at your option) any later version. Author: Daniel Helgenberger