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.
bbailey6
Posts: 36 Joined: Fri Feb 06, 2015 2:19 pm
Post
by bbailey6 » Wed Mar 11, 2015 1:19 pm
Hi,
I am trying to wrap my head around nrpe. I currently have it working but I feel like I am doing something wrong. I cant get any data back from hosts I am trying to monitor without adding flags to my nrpe.cfg.
What I have right now, which works is:
Code: Select all
command[check_swap]=/usr/local/nagios/libexec/check_swap -w $ARG1$ -c $ARG2$
is it possible to just have a generic nrpe.cfg on all the clients I want to monitor? i.e.:
Code: Select all
command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$ $ARG2$
and then just pass the arguments through the defined service on my nagios? What the heck am I doing wrong? Do I need to create a custom template for each plugin?
Thanks
bbailey6
Posts: 36 Joined: Fri Feb 06, 2015 2:19 pm
Post
by bbailey6 » Wed Mar 11, 2015 1:54 pm
Hi Donald,
I've set the don't blame nrpe flag to 1 and also compiled with the --enable-command-args option.
Actually, since its been a few weeks of playing with it, is there a way to see if I did in fact run ./configure --enable-command-args
?
thanks
jdalrymple
Skynet Drone
Posts: 2620 Joined: Wed Feb 11, 2015 1:56 pm
Post
by jdalrymple » Wed Mar 11, 2015 2:13 pm
Code: Select all
[jdalrymple@localhost nrpe-2.15]$ grep "enable-command-args" config.status
with options \"'--enable-command-args'\"
echo "running /bin/sh ./configure " '--enable-command-args' $ac_configure_extra_args " --no-create --no-recursion" >&6
exec /bin/sh ./configure '--enable-command-args' $ac_configure_extra_args --no-create --no-recursion
If there is no output, you did not compile with the --enable-command-args flag
bbailey6
Posts: 36 Joined: Fri Feb 06, 2015 2:19 pm
Post
by bbailey6 » Wed Mar 11, 2015 2:37 pm
hi,
looks like its there
nrpe-2.15]# grep "enable-command-args" config.status
with options \"'--enable-command-args'\"
echo "running /bin/sh ./configure " '--enable-command-args' $ac_configure_extra_args " --no-create --no-recursion" >&6
exec /bin/sh ./configure '--enable-command-args' $ac_configure_extra_args --no-create --no-recursion
is it not possible to not add flags to my nrpe.cfg? id like to write all the custom services from the nagios side and all necessary flags there
I didn't install nrpe on the nagios side, only the client side. Do you have to install it on the nagios side with --enable-command-args?
jdalrymple
Skynet Drone
Posts: 2620 Joined: Wed Feb 11, 2015 1:56 pm
Post
by jdalrymple » Wed Mar 11, 2015 3:58 pm
It's very possible - have you tried?
Code: Select all
[jdalrymple@localhost libexec]$ ./check_nrpe -H localhost -c check_disk -a '-w 20 -c 10 -p /'
DISK OK - free space: / 13338 MB (79% inode=92%);| /=3471MB;17689;17699;0;17709
[jdalrymple@localhost libexec]$ ./check_nrpe -H localhost -c check_disk -a '-w 20 -c 10 -p /boot'
DISK OK - free space: /boot 427 MB (93% inode=99%);| /boot=31MB;464;474;0;484
Box293
Too Basu
Posts: 5126 Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:
Post
by Box293 » Thu Mar 12, 2015 1:37 am
I've struggled before with what you are trying to do.
This is how your generic command needs to be defined:
Code: Select all
command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$
Here's how you execute it from the nagios host:
Code: Select all
./check_nrpe -H remoteserver -c check_swap -a '-w 50 -c 20'
The key here is enclosing the arguments in single quotes. This means it is sent as one argument.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new
Privacy Policy .
bbailey6
Posts: 36 Joined: Fri Feb 06, 2015 2:19 pm
Post
by bbailey6 » Thu Mar 12, 2015 12:19 pm
Box293:
Thank you very much. That was driving me mad!
jdalrymple
Skynet Drone
Posts: 2620 Joined: Wed Feb 11, 2015 1:56 pm
Post
by jdalrymple » Thu Mar 12, 2015 12:31 pm
Sounds like this is resolved for you bbailey6?
Can we lock the thread?
bbailey6
Posts: 36 Joined: Fri Feb 06, 2015 2:19 pm
Post
by bbailey6 » Thu Mar 12, 2015 12:33 pm
Sure. And thanks!