How do I add a custom plugin to Nagios?

0

1

The Nagios documentation seems to go out of it's way to obscure this basic piece of information. I'm finding bits and pieces of the answer all over the web for the past couple hours. Either I can't brain today because I have the dumb or this is just way harder than it needs to be.

  • I have a executable python script that accepts a couple parameters.
  • It outputs a Nagios format string to the console as well as return codes as per Nagios specification.
  • It's in the plugins location with all the other system checks.
  • It's chown'd to nagios ownership
  • I've created a command definition for it in commands.cfg.
  • I've created a service definition for it in ../etc/nagios/servers as generic-service
  • I see it in Nagios in System Configuration for Commands
  • Nagios has been restarted

I've arrived at these things as I've said by combing webpages. Are they the right things to do? I feel like something is missing and I see no indication in Nagios that my plugin has run. How do I confirm a plugin is properly configured? How do I set the frequency at which it executes? Thanks.

fbonds66

Posted 2014-01-08T01:22:28.120

Reputation: 9

That sounds like what I've always done. Is it working? – Bandrami – 2014-01-08T03:46:53.397

I can't tell. When you add a custom plugin, where do you see the results? – fbonds66 – 2014-01-08T18:06:34.447

Answers

0

I had the dumb..

#cfg_dir=/opt/local/etc/nagios/servers

I neglected to uncomment this line in nagios.cfg

fbonds66

Posted 2014-01-08T01:22:28.120

Reputation: 9

Ah, yeah. That would do it... – Bandrami – 2014-01-08T18:36:14.650