check_logfiles HPUX

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

check_logfiles HPUX

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_logfiles HPUX

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: check_logfiles HPUX

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_logfiles HPUX

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: check_logfiles HPUX

Post by msanbrug »

In file check_logfiles appear, this: #! /usr/bin/perl -w

How I can modify this file?

Regards,
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: check_logfiles HPUX

Post 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.
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: check_logfiles HPUX

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_logfiles HPUX

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: check_logfiles HPUX

Post 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,
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_logfiles HPUX

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked