i cant make non-official plugins to work

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post by Sander5 »

yes /usr/local/libexec/check_snmp_printer: function: not found

On CLI if i change the script #!/bin/sh to #!/bin/bash it gives me no errors. but when i leave it at /sh i comes with the function: not found error.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: i cant make non-official plugins to work

Post by scottwilkerson »

This could be an issue with the interpreter. If it is working on your system with #!/bin/bash I would change it to that.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post by Sander5 »

I changed it. and now it is back to (Return code of 127 is out of bounds - plugin may be missing) again....

(i also just changed the default shell from csh to bash, same result...return code of 127...)
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: i cant make non-official plugins to work

Post by abrist »

Does the altered check now work from the cli and is just reporting the 127 error through nagios?
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.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post by Sander5 »

Yes just the 127 error in nagios
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: i cant make non-official plugins to work

Post by slansing »

What are the permissions on this plugin now? Can you run the following:

Code: Select all

ll -la /usr/local/nagios/libexec/pluginname
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post by Sander5 »

-rwxr-xr-x 1 root wheel 32647 Sep 26 09:58 /usr/local/libexec/check_snmp_printer

This is what you meant, right?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: i cant make non-official plugins to work

Post by abrist »

Can you run the check as the user "nagios" ?
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.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post by Sander5 »

Yes i can run the command as nagios.

Altough i do not know which user runs the commands from the website, could it be another user?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: i cant make non-official plugins to work

Post by abrist »

The commands should be run as the user 'nagios'. Do you only have issues with this one plugin?
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