CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

6 posts / 0 new
Last post
RodriMaroto
Offline
Last seen: 4 years 9 months ago
Joined: 19.02.2015 - 10:43
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

Good morning,

I have done a script in perl to read the log.

When I execute the script I have the next error:

CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

 

I execute in localhost.cfg:

command_line    $USER1$/check_nrpe -H 192.168.247.1 -c find.pl

 

Also I tried

command_line perl "C:\Program Files (x86)\ICW\plugins\find.pl" and appeared the Error:

Status Information: (No output on stdout) stderr:

 

My script is:

----------------------------------------------------------------------------------------------------

#!/usr/bin/perl

use Getopt::Long;
&Getopt::Long::config('auto_abbrev');

my %STATUSCODE = (  'UNKNOWN' => '-1',
                    'OK' => '0',
                    'WARNING' => '1',
                    'CRITICAL' => '2');

$nombre_del_archivo='C:\Users\rdomingo\Desktop\answer.xml';
$Patron=Error;
open(ARCHIVO,$nombre_del_archivo);

while (<ARCHIVO>)
{

if ($Patron eq 'Error')
{
print "Restart the service and read logfile, because there are" ." ". $Patron ." " ."in the file\n";
exit($STATUSCODE{"CRITICAL"});
}
else
{
print "There is not" . " " . $Patron. " " ."in" ." ". $nombre_del_archivo ."\n"}
exit($STATUSCODE{"OK"});
}

close(ARCHIVO);

---------------------------------------------------------------------------

 

Thanks for your time.

Regards

 

itefix
Offline
Last seen: 2 hours 33 min ago
Joined: 01.05.2008 - 21:33
This is actually not a nagwin

This is actually not a nagwin problem. It seems that your plugin doesn't produce anything. To make this work:

  • You need to install an nrpe daemon (winrpe or nsclient) on 192.168.247.1
  • move copy.pl to 192.168.247.1
  • make sure that you have perl installed
  • configure nrpe to process that command

 

I recommend strongly to read how nrpe is supposed to work and have a look at our usage examples.

RodriMaroto
Offline
Last seen: 4 years 9 months ago
Joined: 19.02.2015 - 10:43
Solved

Thanks for your reply.

The IP 192.168.247.1 is my localhost where I have Nagwin, and I thought that It was not necessary to install nsclient because in the pluggin folder was the check_nrpe.

I installed the nsclient ++, and I configured the NSC.ini and my script run very well.

But I have a question:

If I execute:

C:\Program Files (x86)\ICW\plugins>check_nrpe -H localhost
CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.

 

C:\Program Files (x86)\ICW\plugins>check_nrpe -H 192.168.247.1
I (0.3.9.328 2011-08-16) seem to be doing fine...

 

Localhost and 192.168.247.1 they are the same IP

Thanks for your time and quick response.

Regards

itefix
Offline
Last seen: 2 hours 33 min ago
Joined: 01.05.2008 - 21:33
If you want to run the plugin

If you want to run the plugin on your Nagwin machine directly, you don't need nrpe at all - it is designed to pick up results from remote hosts. You can just define a command running your perl script and a service running this command. Check examples in localhost.cfg.

Regarding results from check_nrpe - it seems that specifying name instead of an ip address is the problem.

RodriMaroto
Offline
Last seen: 4 years 9 months ago
Joined: 19.02.2015 - 10:43
Thanks for your reply. I

Thanks for your reply.

I don´t understand...

How would it execute check_nrpe in my localhost?

If I execute:

C:\Program Files (x86)\ICW\plugins>check_nrpe -c find.pl
Incorrect command line arguments supplied

C:\Program Files (x86)\ICW\plugins>check_nrpe -H 192.168.247.1 -c find.pl
UNKNOWN: No handler for that command

C:\Program Files (x86)\ICW\plugins>check_nrpe -H localhost -c find.pl
CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.

Only it is correct with NSCLIENT++, and by invoking the NSC.ini file

Thanks

Regards

itefix
Offline
Last seen: 2 hours 33 min ago
Joined: 01.05.2008 - 21:33
You need to define NRPE

You need to define NRPE commands to be processed. Specifying your script directly will not help. Nsclient has a configuration file in where you specify the command which will run your script. check_nrpe connects to an nrpe daemon and runs a command configured in it. Please consult NRPE documentation.