Page 1 of 2

check_logfiles HPUX

Posted: Thu Jan 26, 2012 12:21 pm
by msanbrug
Hello,

I have to monitoring a log in a machine HPUX B.11.00. I defined config file:

$seekfilesdir = '/opt/tools/capmau/log';
@logs = (
{
tag => 'sybase',
logfile => '/opt/sybase/ASE-12_0/install/errorlog',
criticalpatterns =>[
'.*Severity: 21.*',
],
},
);


and defined in nrpe.cfg:

command[check_logfiles]=/opt/tools/capmau/libexec/check_logfiles -f /opt/tools/capmau/check_logfile.cfg

but not find perl:

interpreter "/opt/nagios/bin/perl" not found
ksh: /opt/tools/capmau/libexec/check_logfiles: not found

Any idea? I have monitoring machines Linux, are monitoring correctly.

Re: check_logfiles HPUX

Posted: Thu Jan 26, 2012 12:44 pm
by scottwilkerson
msanbrug wrote:interpreter "/opt/nagios/bin/perl" not found
Do you have perl installed on the HPUX machine?

Code: Select all

which perl
If so, it might not be in the nagios users path, if that is the case you could add the path to the beginning of the command.

The next error,
msanbrug wrote:ksh: /opt/tools/capmau/libexec/check_logfiles: not found
makes it look like it cannot find the file /opt/tools/capmau/libexec/check_logfile

does it exist on this machine?

Re: check_logfiles HPUX

Posted: Thu Jan 26, 2012 1:00 pm
by msanbrug
Hello,

Perl is installed in the machine

which perl
/usr/bin/perl


I don't know if nor find check_logfiles, because not find perl:

/opt/tools/capmau/libexec/check_logfiles
interpreter "/opt/nagios/bin/perl" not found
ksh: /opt/tools/capmau/libexec/check_logfiles: not found

check_logfiles exist in tha machine:

-rwxr-xr-x 1 capmau capmau 97254 Apr 22 2008 /opt/tools/capmau/libexec/check_logfiles

Regards.

Re: check_logfiles HPUX

Posted: Thu Jan 26, 2012 2:38 pm
by scottwilkerson
O would open the file /opt/tools/capmau/libexec/check_logfiles in an editor and see what the top line looks like

You are going to need to make it look like

Code: Select all

#!/usr/bin/perl

Re: check_logfiles HPUX

Posted: Fri Jan 27, 2012 2:13 am
by msanbrug
In file check_logfiles appear, this: #! /usr/bin/perl -w

How I can modify this file?

Regards,

Re: check_logfiles HPUX

Posted: Fri Jan 27, 2012 3:27 am
by msanbrug
I edit the file and put: #!/usr/bin/perl -w.

If I execute command line in local machine:


/opt/tools/capmau/libexec/check_logfiles -f /opt/tools/capmau/check_logfile.cfg
OK - no errors or warnings|sybase_lines=0 sybase_warnings=0 sybase_criticals=0 sybase_unknowns=0


but in Nagios appear this:


Current Status: CRITICAL
Status Information: CHECK_NRPE: Socket timeout after 10 seconds.


nrpe is is working properly, as I have in the file nrpe.cfg, process definitions and filesystems, they are working properly.

In nrpe.cfg, timeout is: command_timeout=60

Regards.

Re: check_logfiles HPUX

Posted: Fri Jan 27, 2012 9:00 am
by msanbrug
After, modify that I explained in the previous post, I activated debug in nrpe.cfg, and I have seen in syslog, this:

Jan 27 14:41:26 maresme nrpe[16853]: Could not read request from client, bailing out...
Jan 27 14:42:03 maresme nrpe[17560]: Could not read request from client, bailing out...
Jan 27 14:44:26 maresme nrpe[21627]: Could not read request from client, bailing out...


Any idea?

Regards.

Re: check_logfiles HPUX

Posted: Fri Jan 27, 2012 11:27 am
by scottwilkerson
From your Nagios server can you run the following

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H <IP_ADDRESS>
and post the output

and also

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H <IP_ADDRESS> -c check_logfiles

Re: check_logfiles HPUX

Posted: Mon Jan 30, 2012 4:01 am
by msanbrug
This is the output:

[capmau@monitor01 libexec]$ ./check_nrpe -H 10.17.32.28 -c check_logfiles
CHECK_NRPE: Received 0 bytes. Are we allowed to connect to the host?

I checked other, tat is ok in Nagios

[capmau@monitor01 libexec]$ ./check_nrpe -H 10.17.32.47 -c check_logfiles
CHECK_NRPE: Error receiving data from host.

If it helps you, in my machine 10.17.32.2, only no working, monitoring log. I monitoring process and filesystems and it's ok:

command[check_procs_cron]=/opt/iexpress/nagios/libexec/check_procs -c 1: -a cron
command[check_procs_sendmail]=/opt/iexpress/nagios/libexec/check_procs -c 1: -a sendmail
command[check_disk_/]=/opt/iexpress/nagios/libexec/check_disk -w 10% -c 5% -p /
command[check_disk_/stand]=/opt/iexpress/nagios/libexec/check_disk -w 10% -c 5% -p /stand


Regards,

Re: check_logfiles HPUX

Posted: Mon Jan 30, 2012 12:49 pm
by scottwilkerson
Do you have check_logfiles defined in each of the clients nrpe.cfg files?

Did you restart nrpe after adding it?

Did you add the server IP to the allowed list in each client?

Did you restart nrpe after adding it?