Hi Guys.
I need to know if it's possible to pass a plugin option like "-w" or "-c" throuth nrpe like Argument.
I mean:
I have the next command definition: $USER1$/check_nrpe -H $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$
/check_nrpe -H x.x.x.x -c check_disk -w 20% -c 30% -p /
and it's call to the next client command: command[check_arg]=/usr/local/nagios/libexec/$ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$
There is any way to get some thing like this?
Thanks a lot.
Pass plugin options like arguments
Re: Pass plugin options like arguments
This should not be an issue.
On your remote client, we will have to modify the nrpe.cfg file to allow argument passing. Please note that enabling this option will make NRPE less secure.
Change:
to:
Restart xinetd:
From your Nagios host, you will now be able to pass command line arguments as follows:
Let me know if this helps - thanks!
On your remote client, we will have to modify the nrpe.cfg file to allow argument passing. Please note that enabling this option will make NRPE less secure.
Code: Select all
vi /usr/local/nagios/etc/nrpe.cfg
Code: Select all
dont_blame_nrpe=0
Code: Select all
dont_blame_nrpe=1
Code: Select all
service xinetd restart
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_disk -a '-w 20% -c 50% -p /'
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Pass plugin options like arguments
While not particularly safe, it's likely possible:
nrpe.cfg
nrpe.cfg
Code: Select all
command[check_arbitrary]=/usr/local/nagios/libexec/$ARG1$
Code: Select all
[jdalrymple@localhost libexec]$ ./check_nrpe -H 127.0.0.1 -c check_arbitrary -a 'check_dummy 0'
OK
[jdalrymple@localhost libexec]$ ./check_nrpe -H 127.0.0.1 -c check_arbitrary -a '../../../../bin/ls'
bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
sbin
selinux
srv
store
sys
tmp
usr
var