Custom Plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cvken
Posts: 5
Joined: Mon Apr 29, 2013 4:45 pm

Custom Plugin

Post by cvken »

I've created a custom plugin for nagios.
I can run the plugin as the nagios user from the command line.
Output of ls -l
-rwxr-xr-x 1 nagios nagios 2137 May 3 13:11 check_verify_count.pl
When I added the plugin as a command it runs from the command page and returns output. The plugin does call a windows mount that is mounted with nagios user and group.

When I added the command to a service check the output is blank and the service check returns. "(Return code of 127 is out of bounds - plugin may be missing)"
What have I done wrong here?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Custom Plugin

Post by abrist »

Permissions look fine.
cvken wrote:When I added the plugin as a command it runs from the command page and returns output.
Are you using the test check feature for this? Could you clarify how you are running this command from the command.
I assume the plugin script is located at: /usr/local/nagios/libexec
Is this correct?

Can you give us an example of this command running from the cli?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Custom Plugin

Post by sreinhardt »

In addition to abrist's path question, are you pre-appending $USER1$/ before your check name?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
cvken
Posts: 5
Joined: Mon Apr 29, 2013 4:45 pm

Re: Custom Plugin

Post by cvken »

Sorry, this was a case of stupid.
I had changed the name of the script...and not updated the command to reflect the new name.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Custom Plugin

Post by abrist »

No problem. I hear weekends fix even the worst cases of stupid. Have a good one and get well :P
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked