A better Nagios SNMP plugin
Posted by broseJul 9
The nagios plugin that you find in the package nagios-plugins-snmp was insufficient for my needs in a new nagios deployment. The biggest reason that it was insufficient was that it gets integer values, and then can only issue a warning or alert if that integer value is GREATER than what value you gave it. The deployment I’m setting up required that the values could be checked against a range, which is necessary when receiving SNMP data from a thermometer or hygrometer. This plugin supports receiving a range of values to check against, and then it returns the appropriate exit code.
I’ve written a tad bit of documentation in the top of the file, but here it is again, in block quotes! Download link is just below the block quote area.
# This script written with haste by Benjamin Rose, July 8th 2009 @ 11:45:42 AM
# It was written because the check_snmp plugin provided by the nagios package
# does not support range matching. It can check if the snmp value is greater than
# a given number but not less than, nor a range consisting of either a high value
# or a low value. Hence, this script, given a mode of 1 and a good range with
# which to work, will report back appropriately.
#
# Modes:
# 1 = Number comparison, reports on a given range. Argument order given in
# the usage statement.
# 2 = String comparison, which for now is just “Open” or otherwise.
#
# TODO:
# 1) Change the order of the arguments, putting mode in front of the
# variables, and then change the usage based on the given mode.
# 2) Allow the user to configure which strings are “good” and which are “bad”.
Plugin link: [snmp_plugin_wrapper]
6 comments
Comment by Mary Starr on July 10, 2009 at 4:19 pm
Benjamin,
Thank you for writing and sharing this plugin with other Nagios users. We would really appreciate if you could add this to the official Nagios Exchange website found here:
http://exchange.nagios.org/
Thanks again, Mary Starr
Comment by brose on July 11, 2009 at 12:01 am
Mary,
I’d be happy to contribute the plugin to the exchange repository. I am currently in the process of writing several more plugins, I’ll post them both here and on the exchange site.
One question, though… how did you end up finding my blog? Just wondering. 🙂
Thanks!
–Ben
Comment by Mary Starr on July 30, 2009 at 2:34 pm
Nagios News alerts!
Comment by Vladislav42 on March 17, 2010 at 12:00 pm
Спасибо афтуру за хороший пост. Внимательно прочел, почерпнул много важного для себя.
Comment by Francesco on June 3, 2010 at 5:56 am
Hi Benjamin,
I’m new to nagios and I’m looking for some help – hints, ideas – to set up a cisco ASA 5510 to sent snmp to nagios. I’ve configured already the server and it receives rta but what I wanted to know is: if I configure the asa to send snmp to nagios, do I have to configure also an snmp server on nagios, or will it handle the messages by default?
Thanks
Comment by sitystroyinfo on July 13, 2010 at 5:21 am
Админчег 🙂 У меня к тебе небольшое предложение, хоть и не по теме блога 😉 Напиши пожалуйста свой обзор передачи Гордон Кихот. Особенно прошлый выпуск, про Шансон. Спасибо 🙂 Удачи дружище