check_log3 plugin not working on Linux
check_log3 plugin not working on Linux
Hi Team,
I have copied check_log3 plugin into plugins file (/usr/lib64/nagios/plugins) on Linux server.
Then I have modified nrpe.cfg file
command[check_log3]=/usr/lib64/nagios/plugins/check_log3.pl $ARG1$
When I am checking it from Nagios XI server, get below error
[root@auscrpmonprd00 libexec]# ./check_nrpe -H 192.168.153.197 -c check_log3.pl -l /oracle/app/oracle/diag/rdbms/aldb2/aldb2/trace/alert_aldb2.log -p 'ORA-00060'
Incorrect command line arguments supplied
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]
.
.
.
how can I fix it
I have copied check_log3 plugin into plugins file (/usr/lib64/nagios/plugins) on Linux server.
Then I have modified nrpe.cfg file
command[check_log3]=/usr/lib64/nagios/plugins/check_log3.pl $ARG1$
When I am checking it from Nagios XI server, get below error
[root@auscrpmonprd00 libexec]# ./check_nrpe -H 192.168.153.197 -c check_log3.pl -l /oracle/app/oracle/diag/rdbms/aldb2/aldb2/trace/alert_aldb2.log -p 'ORA-00060'
Incorrect command line arguments supplied
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]
.
.
.
how can I fix it
Re: check_log3 plugin not working on Linux
You command is not correct. You need to pass arguments using the "-a" flag../check_nrpe -H 192.168.153.197 -c check_log3.pl -l /oracle/app/oracle/diag/rdbms/aldb2/aldb2/trace/alert_aldb2.log -p 'ORA-00060'
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <remote ip> -c <command> -a <arguments>command[check_log3]=/usr/lib64/nagios/plugins/check_log3.pl $ARG1$
Try running:
Code: Select all
./check_nrpe -H 192.168.153.197 -c check_log3 -a '-l /oracle/app/oracle/diag/rdbms/aldb2/aldb2/trace/alert_aldb2.log -p ORA-00060'Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_log3 plugin not working on Linux
Hi
When I command from XI, I get below error
However, when I try to test the command from remote server, command works fine
When I command from XI, I get below error
Code: Select all
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 192.168.153.195 -t 600 -c check_log3 -a '-l /oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log -p ORA-00060'
OUTPUT: Cannot read '/oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log'
Code: Select all
[root@AUSVADNODB01 plugins]# ./check_log3.pl -l /oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log -p ORA-00060
WARNING: Found 7 lines (limit=1/0): ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/ndb2_ora_27340.trc.|lines=7
[root@AUSVADNODB01 plugins]#
Re: check_log3 plugin not working on Linux
On the remote server, can you try it as the 'nagios' user instead of the 'root' user?
Former Nagios Employee.
me.
me.
Re: check_log3 plugin not working on Linux
We have installed nrpe agent on remote server with root account and not with nagios account. so cannot use nagios user on server
[root@AUSVADNODB01 plugins]# sudo su - nagios
This account is currently not available.
[root@AUSVADNODB01 plugins]#
[root@AUSVADNODB01 plugins]# sudo su - nagios
This account is currently not available.
[root@AUSVADNODB01 plugins]#
Re: check_log3 plugin not working on Linux
What's the output of ps -ef | grep nag
How about this command?
How about this command?
Code: Select all
find / -name "nrpe.cfg" -exec cat {} \; | grep -Ev '(#.*$)|(^$)'Former Nagios Employee.
me.
me.
Re: check_log3 plugin not working on Linux
[root@AUSVADNODB01 ~]# ps -ef | grep nag
root 24231 20349 0 17:20 pts/0 00:00:00 grep nag
nrpe 28387 1 0 14:59 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
[root@AUSVADNODB01 ~]# find / -name "nrpe.cfg" -exec cat {} \; | grep -Ev '(#.*$)|(^$)'
log_facility=daemon
pid_file=/var/run/nrpe/nrpe.pid
server_port=5666
nrpe_user=nrpe
nrpe_group=nrpe
allowed_hosts=127.0.0.1, 10.161.4.180
dont_blame_nrpe=1
allow_bash_command_substitution=0
debug=0
command_timeout=60
connection_timeout=300
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
command[check_log3]=/usr/lib64/nagios/plugins/check_log3.pl $ARG1$
include_dir=/etc/nrpe.d/
[root@AUSVADNODB01 ~]#
root 24231 20349 0 17:20 pts/0 00:00:00 grep nag
nrpe 28387 1 0 14:59 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
[root@AUSVADNODB01 ~]# find / -name "nrpe.cfg" -exec cat {} \; | grep -Ev '(#.*$)|(^$)'
log_facility=daemon
pid_file=/var/run/nrpe/nrpe.pid
server_port=5666
nrpe_user=nrpe
nrpe_group=nrpe
allowed_hosts=127.0.0.1, 10.161.4.180
dont_blame_nrpe=1
allow_bash_command_substitution=0
debug=0
command_timeout=60
connection_timeout=300
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
command[check_log3]=/usr/lib64/nagios/plugins/check_log3.pl $ARG1$
include_dir=/etc/nrpe.d/
[root@AUSVADNODB01 ~]#
Re: check_log3 plugin not working on Linux
Do "nrpe" user/group exist on this system?nrpe_user=nrpe
nrpe_group=nrpe
Can you run successfully your command as the "nrpe" user on the client machine?
Code: Select all
su nrpe
cd /usr/lib64/nagios/plugins/
./check_log3.pl -l /oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log -p ORA-00060Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_log3 plugin not working on Linux
Ohh yes. When I log in with nrpe account I get permission issue
[root@AUSVADNODB01 ~]# su nrpe
bash-3.2$ cd /usr/lib64/nagios/plugins/
bash-3.2$ ./check_log3.pl -l /oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log -p ORA-00060
Cannot read '/oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log'
bash-3.2$
[root@AUSVADNODB01 ~]# su nrpe
bash-3.2$ cd /usr/lib64/nagios/plugins/
bash-3.2$ ./check_log3.pl -l /oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log -p ORA-00060
Cannot read '/oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log'
bash-3.2$
Re: check_log3 plugin not working on Linux
It seems like that "nrpe" user doesn't have sufficient permissions. You will have to probably add "nrpe" user to sudoers in order to make this work.Cannot read '/oracle/app/oracle/diag/rdbms/ndb2/ndb2/trace/alert_ndb2.log'
Be sure to check out our Knowledgebase for helpful articles and solutions!