Page 1 of 1

plugin writing help

Posted: Thu May 24, 2018 2:06 pm
by benhank
Hey guys I am going to attempt to write my own plugin to check certain iyems on an apc pdu. Is there any docs out there that shouw how to write plugings using snmp polling?

Re: plugin writing help

Posted: Thu May 24, 2018 3:17 pm
by npolovenko
Hi, @benhank. I think we've got some plugins on the exchange that you can look at:
https://exchange.nagios.org/index.php?o ... =apc%20pdu
You might be able to find an existing plugin that does what you need.

Re: plugin writing help

Posted: Thu May 31, 2018 12:08 pm
by benhank
Those plugins will most likely work, But I am looking for info that will help me write my own.

Re: plugin writing help

Posted: Thu May 31, 2018 3:17 pm
by tmcdonald
Really depends on the language you wanna use. Straight-up Bash? Then any command you can run from the command line is up for grabs. Python? Perl? You'll wanna look into some of the libraries that are available to you:

Python: https://easysnmp.readthedocs.io/en/latest/
Perl: http://search.cpan.org/~dtown/Net-SNMP- ... et/SNMP.pm

Aside from the SNMP-specific stuff, the rest is just building the logic to determine thresholds and process arguments. That's a little outside the scope of what we can directly assist with, but Google is your friend here and there are plenty of guides and code samples to guide you.

Re: plugin writing help

Posted: Thu May 31, 2018 3:33 pm
by benhank
yeah I was thinking bash. you can lock this one.