Page 3 of 6

Re: Plugins Helps

Posted: Tue Jul 26, 2016 9:11 pm
by kwhogster
if I remove the .cfg then I am back to the original error.

I ran find / -name check_nrpe

see attached file

Re: Plugins Helps

Posted: Tue Jul 26, 2016 10:23 pm
by Box293
Your output indicates that you do not have the check_nrpe plugin installed on your Nagios server.

In this guide you referenced:
http://xmodulo.com/nagios-remote-plugin ... linux.html
It was supposed to be installed with:

Code: Select all

apt-get install nagios-nrpe-plugin
And should be installed here:

Code: Select all

/usr/lib/nagios/plugins/check_nrpe
This guide also shows how to install check_nrpe from Source (it's down the bottom).
https://support.nagios.com/kb/article.php?id=515

Re: Plugins Helps

Posted: Tue Jul 26, 2016 10:40 pm
by kwhogster
Ok I ran
apt-get install nagios-nrpe-plugin

Now I have check_nrpe in /usr/lib/Nagios/plugins the install placed it in there

I changed my commands.cfg to remove the .cfg

define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe.cfg -H '$HOSTADDRESS$' -c '$ARG1$'
}

is now this

define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c '$ARG1$'
}

the ran this

/usr/local/nagios/bin/nagios -vv /usr/local/nagios/etc/nagios.cfg

All good

/etc/init.d/nagios reload

OK

service nagios restart

Checked the web interface

Now getting a warning not critical getting much closer this is the warning msg

No handler for command: check_disk_space

Thoughts

Re: Plugins Helps

Posted: Tue Jul 26, 2016 10:51 pm
by Box293
On your NRPE client look in the nrpe.cfg file.

Down the bottom of the file you'll see command examples. check_disk_space is most likely not defined.

Re: Plugins Helps

Posted: Tue Jul 26, 2016 11:53 pm
by kwhogster
My nrpe.cfg which is in /usr/local/Nagios/etc/objects

#######################################################################################################
#
# NRPE.CFG
#
# Defined Hosts and Services for the Ngios Plugins
#
#######################################################################################################

# Define Plugin Hosts


# Define Plugin Services

define service {
host_name TGCS011
service_description Check Disk Usage
check_command check_nrpe!check_disk_space! -v -w 80 -c 90 -p C
check_interval 1
use generic-service
}

Re: Plugins Helps

Posted: Tue Jul 26, 2016 11:54 pm
by Box293
No, this file you showed us is from your Nagios server.

On the machine running the NRPE client there is a nrpe.cfg file which looks completely different.

Re: Plugins Helps

Posted: Wed Jul 27, 2016 7:14 am
by kwhogster
nrpe client??????

I do not have nrpe client installed on any windows computer.

I have nsclient ++ installed on all my windows computers


I thought NRPE could communicate with nsclient ++

is there something I need to do in the nsclinet.ini ????

Re: Plugins Helps

Posted: Wed Jul 27, 2016 9:44 am
by rkennedy
NRPE can be used through Linux, or also as part of the NSClient++ package on Windows.

Yes, you need to modify your nsclient.ini file to define the command and plugin to use for check_disk_space. Specifically, under this section (add it if you do not have it anywhere) -

Code: Select all

[/settings/external scripts/scripts]
Then, under that section, you need to define it (change check_disk_space.vbs to the plugin you're trying to execute on the windows machine - most plugins will tell you exactly how to define the command) -

Code: Select all

check_disk_space=cscript.exe //nologo //T:30 scripts\\check_disk_space.vbs "$ARG1$" "$ARG2$" "$ARG3$"
(this is just an example)

Re: Plugins Helps

Posted: Wed Jul 27, 2016 4:28 pm
by Box293
If you're using NSClient++ then there's no need for any extra scripts, it has a built in module to do that. See examples here:

http://sites.box293.com/nagios/guides/c ... disk-usage

Re: Plugins Helps

Posted: Wed Jul 27, 2016 6:43 pm
by kwhogster
I am running nsclient ++ 0.4.1.73


This is from the link you posted

NSClient++ 0.4.1
No additional configuration is required
Command:
check_nrpe -H 192.168.142.137 -t 30 -c CheckDriveSize -a ShowAll MinWarn=10G MinCrit=5G CheckAll perf-unit=G

Output:
OK: C:\: 11.5G, D:\: 90.4M|'C:\ %'=81%;83;91 'C:\'=11.51G;10;5;0;59 'D:\ %'=100%;49;74 'D:\'=0.08G;10;5;0;19.99

Do I create this command in the nrpe.cfg file?

I ran it on the server

root@TGCS017:/usr/lib/nagios/plugins# ./check_nrpe -H 10.2.8.30 -t 30 -c CheckDriveSize -a Showall MinWarn=10G MinCrit=5G checkall perf-unit=g
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).


I ran this too

root@TGCS017:/usr/lib/nagios/plugins# ./check_nrpe -H 10.2.8.30
I (0,4,1,73 2012-12-17) seem to be doing fine...


I am attaching my nsclient.ini also