CHECK_NRPE: Received 0 bytes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: CHECK_NRPE: Received 0 bytes

Post by avandemore »

There are a lot of variables at play here so that requested debug.log would be useful.

Also from the nagios side, you can increase the check_nrpe timeout with the -t argument.
Previous Nagios employee
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: CHECK_NRPE: Received 0 bytes

Post by tgriep »

I thing I found the issue.
Can you edit the nsclient.ini file on that Windows system and change the following lines from

Code: Select all

check_process2 = cscript.exe //T:115 //NoLogo scripts\\check_process2.vbs $ARGS"$
check_cpu_queue = cscript.exe //T:115 //NoLogo scripts\\check_cpu_queue.vbs $ARGS"$
to

Code: Select all

check_process2 = cscript.exe //T:115 //NoLogo scripts\\check_process2.vbs $ARG1$ $ARG2$
check_cpu_queue = cscript.exe //T:115 //NoLogo scripts\\check_cpu_queue.vbs $ARG1$ $ARG2$
Restart NSClient and see if that fixes it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: CHECK_NRPE: Received 0 bytes

Post by gormank »

Duh... That's does look wrong. Good eye.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: CHECK_NRPE: Received 0 bytes

Post by gormank »

They still do the same after the change. I remember the person who set things up with that extra quote said it was needed at the time...
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: CHECK_NRPE: Received 0 bytes

Post by tgriep »

Yesterday, avandemore suggested turning on debugging for the nsclient.log file, can you do that, restart nsclient, run the check a few times and post the nsclient.log file so we can view the errors?
Then, remove the debugging setting so the log file will not get really large.
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: CHECK_NRPE: Received 0 bytes

Post by gormank »

Sorry, I missed the debug request. I'll get it.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: CHECK_NRPE: Received 0 bytes

Post by tgriep »

No Problem, whenever you are ready.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: CHECK_NRPE: Received 0 bytes

Post by gormank »

I've attached the log (starting yesterday) and the events from midnight today . See line 2041 and 2043 for the 1st error after midnight at 00:59.
If you look at the log bit pasted below, you'll see 3 lines w/ --- showing the command sent, the failure, and the successful retry.
I don't see any useful info, but one odd thing is the times of the errors logged don't seem to quite match. I checked time sync, and compared time between the Nagios and app server and they were the same to the second.

Code: Select all

# grep Win /usr/local/nagios/var/nagios.log | cut -c 1-105 | perl -pe 's/(\d+)/localtime($1)/e' | grep UNKNOWN | grep txslm2mwapp008
[Thu Nov 17 00:59:35 2016] SERVICE ALERT: txslm2mwapp008;FS_Win_IO;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from dae
[Thu Nov 17 01:50:05 2016] SERVICE ALERT: txslm2mwapp008;CPU_Win_Queue;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from
[Thu Nov 17 02:40:35 2016] SERVICE ALERT: txslm2mwapp008;FS_Win_IO;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from dae
[Thu Nov 17 03:31:05 2016] SERVICE ALERT: txslm2mwapp008;CPU_Win_Queue;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from
[Thu Nov 17 04:21:35 2016] SERVICE ALERT: txslm2mwapp008;FS_Win_IO;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from dae
[Thu Nov 17 05:12:05 2016] SERVICE ALERT: txslm2mwapp008;CPU_Win_Queue;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from
[Thu Nov 17 06:03:05 2016] SERVICE ALERT: txslm2mwapp008;CPU_Win_Queue;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from
[Thu Nov 17 07:27:35 2016] SERVICE ALERT: txslm2mwapp008;FS_Win_IO;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from dae
[Thu Nov 17 07:44:05 2016] SERVICE ALERT: txslm2mwapp008;CPU_Win_Queue;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from
[Thu Nov 17 09:08:35 2016] SERVICE ALERT: txslm2mwapp008;FS_Win_IO;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from dae
[Thu Nov 17 10:50:05 2016] SERVICE ALERT: txslm2mwapp008;CPU_Win_Queue;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from
[Thu Nov 17 12:14:35 2016] SERVICE ALERT: txslm2mwapp008;FS_Win_IO;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from dae
[Thu Nov 17 15:20:35 2016] SERVICE ALERT: txslm2mwapp008;FS_Win_IO;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from dae
[Thu Nov 17 16:11:05 2016] SERVICE ALERT: txslm2mwapp008;CPU_Win_Queue;UNKNOWN;SOFT;1;CHECK_NRPE: Received 0 bytes from

Code: Select all

---2016-11-17 00:58:55: debug:D:\source\nscp\modules\CheckExternalScripts\CheckExternalScripts.cpp:459: Command line: cscript.exe //T:115 //NoLogo scripts\\winFSIO.vbs
2016-11-17 00:59:15: debug:D:\source\nscp\include\nrpe/server/protocol.hpp:74: Accepting connection from: 10.133.134.84, count=1
2016-11-17 00:59:25: debug:D:\source\nscp\include\nrpe/server/protocol.hpp:74: Accepting connection from: 10.133.134.84, count=1
2016-11-17 00:59:25: debug:D:\source\nscp\modules\CheckExternalScripts\CheckExternalScripts.cpp:459: Command line: cscript.exe //T:115 //NoLogo scripts\\check_cpu_queue.vbs 4 6
2016-11-17 00:59:35: debug:D:\source\nscp\include\nrpe/server/protocol.hpp:74: Accepting connection from: 10.133.134.84, count=1
2016-11-17 00:59:35: debug:D:\source\nscp\modules\CheckExternalScripts\CheckExternalScripts.cpp:459: Command line: cscript.exe //T:115 //NoLogo scripts\\Virus_detected.vbs
---2016-11-17 00:59:41: error:D:\source\nscp\include\socket/connection.hpp:149: Failed to send data: The file handle supplied is not valid
2016-11-17 00:59:55: debug:D:\source\nscp\include\nrpe/server/protocol.hpp:74: Accepting connection from: 10.133.134.84, count=1
---2016-11-17 00:59:55: debug:D:\source\nscp\modules\CheckExternalScripts\CheckExternalScripts.cpp:459: Command line: cscript.exe //T:115 //NoLogo scripts\\winFSIO.vbs
2016-11-17 00:59:57: debug:D:\source\nscp\include\nrpe/server/protocol.hpp:74: Accepting connection from: 10.133.134.84, count=1
2016-11-17 00:59:57: debug:D:\source\nscp\include\compat.cpp:22: Created command: warn=free<=20% crit=free<=10% "detail-syntax=%(drive): Total: %(size) - Used: %(used) (%(used_pct)%) - Free: %(free) (%(free_pct)%)" show-all "filter=type in ('fixed')"
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: CHECK_NRPE: Received 0 bytes

Post by tgriep »

I setup my Windows system with the scripts that you uploaded and configured the nsclient.ini file like yours.
I have the winfsio script running without any errors. See below

Code: Select all

./check_nrpe -H 192.168.5.223 -c winfsio
Total Summary: 0 IO/s, Write/s 99 Reads/s: 0 Transfers/s: 99|'split_total'=0 'tps_total'=99;;;0
I an running an older version of NSClient 0.4.4.10, maybe there is a bug in the newer one.

I couldn't get the check_cpu_queue.vbs script to work, it has a compilation error.
It looks like the script that was uploaded is incomplete.
Also, it writes to a file in c:\temp make sure that exists on the Windows server.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: CHECK_NRPE: Received 0 bytes

Post by gormank »

As I've said numerous times, the scripts work, they just fail a little less than once an hour on a few of the hundreds of boxes they run on. They succeed a few seconds later when retried, as shown in the log snippet and log.
See attached.
You do not have the required permissions to view the files attached to this post.
Locked