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 »

I did not create a additional nagios directory. must i move all plugins to the libexec directory?
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 »

Yes, it is suggested. Otherwise you must use a different path when referencing them.
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 »

I moved all the plugins to libexec from libexec/nagios. still the same message.

Code: Select all

sudo -u nagios bash /usr/local/libexec/check_snmp_printer -H 10.240.2.102 -C public -x "CONSUM black"
Canon C-EXV 29 Black Toner is at 89% - OK! | Canon C-EXV 29 Black Toner=89;20;5;
this works but in the website it won't work. I dont understand why it refuses to work, has it something to do with bash?

I just added this 2>&1 to the end of variable in the command.cfg. now it shows this in nagios webui: /usr/local/libexec/check_snmp_printer: function: not found
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: i cant make non-official plugins to work

Post by sreinhardt »

You should not be referencing direct paths within nagios. It is suggested to reference all plugins in the libexec dir with the $USER1$ variable. Such as: $USER1$/check_snmp_printer -H 10.240.2.102 -C public -x "CONSUM black"
Just to verify, you are just using core, and not nrpe or another remote agent?
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.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post by Sander5 »

Just core.

it is still not working.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: i cant make non-official plugins to work

Post by lmiltchev »

What is the value of $USER1$ in "/usr/local/nagios/etc/resource.cfg" file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post by Sander5 »

$USER1$=/usr/local/libexec

It was /usr/local/libexec/nagios
Well you should not have a nagios directory under your libexec directory, all of your plugins should go into libexec
i did change it.
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 »

It seems like you have shell issues. What is your default shell?

Code: Select all

env | grep SHELL
Where is bash located:

Code: Select all

which bash
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 »

1. SHELL=/bin/csh


2. /usr/local/bin/bash
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 »

Just out of curiosity, if you change the default shell for nagios to bash, do you still have function problems with the plugins?
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