Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Help writing custom Perl nagios plugins

by vroom (Pope)
on Jan 10, 2003 at 16:56 UTC ( #225861=perlquestion: print w/replies, xml ) Need Help??
vroom has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to write some custom Perl nagios plugins for monitoring some of the systems I'm responsible for. Basically most of them boil down to sending an LWP request to a webserver and making sure that the response that comes back is what is expected.
I've been directed to for some help but was wondering if anyone had any experience writing Nagios plugins. What are the basic things that are required for a Perl plugin to work correctly? Are there any gotchas I should look out for? Any insight or examples would be most helpful.

Thanks in advance,

  • Comment on Help writing custom Perl nagios plugins

Replies are listed 'Best First'.
Re: Help writing custom Perl nagios plugins
by dug (Chaplain) on Jan 10, 2003 at 20:45 UTC
Re: Help writing custom Perl nagios plugins
by waswas-fng (Curate) on Jan 10, 2003 at 20:28 UTC
    That doc describes all of the caveats for writing ePN plugins, the big ones being no named subs, no BEGIN/END blocks and close your files (as exit is never called). The output generated should be pretty short and readable even with a few chars fubarded on a alpha page. and the exit status codes (even though the table in the doco says the numerics) should be pulled out of (%ERRORS).

Re: Help writing custom Perl nagios plugins
by Notromda (Pilgrim) on Jan 10, 2003 at 19:35 UTC
    Ironic that one of my employees just brought the nagios project to my attention. So ++ to anyone who can shed more light on this. :)
      i wrote a nagios plugin that validates the xml of a site. the most important thing is the return codes. Nagios expects one of 4 exit codes: exit code status description 0 OK all good 1 warning working, but needs attention 2 critical not working correctly 3 unknown plugin could not determine the state install the plugin in /usr/lib/nagios/plugins make is executable create the check.. thats it..

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://225861]
Approved by krujos
Front-paged by tye
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-01-19 11:00 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (170 votes). Check out past polls.