I run a Nagios Core server on a LAN. I have 5 windows machines outside the network I am talking to via five ssh tunnels on 5 different ports listening to five custom NSClient++ apps. All is working well with this configuration, however I am noticing that check_nt MEMUSE is giving us odd numbers, when in fact all we want/need is the actual Physical memory.
After much digging I discovered check_nrpe, which look like it will give me the data I'm looking for.
I put the following in the commands.cfg:
define command {
command_name CheckWindowsPhysicalMem
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckMEM -a MaxWarn=$ARG1$% MaxCrit=$ARG2$% ShowAll=long type=physical
}
And I put the following in my windows.cfg
define service{
use generic-service
host_name HOSTNAME
service_description Physical Memory
check_command CheckWindowsPhysicalMem!80!90
}
I restarted both nagios and nagios-nrpe-server, and now I'm getting this error:
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected)
I am not sure what I missed here, but if seems like a dependency or a package. Google-fu lost on this one.
1. Testing NRPE connection
You can test your connection between your windows and Nagios via NRPE like this :
If you don't pass any arguments to your check_nrpe, the server (windows client) will responde with his version number.
2. Testing your command
On your windows client, you can test locally your command in a console with
nscp test
.If your command return good result, you can test from your nagios server without arguments :
3. NRPE arguments
By default, NRPE not allow the send of arguments from Nagios to a remote client for security considerations. So, you must enable it in the nsclient.ini for each windows station.