check_nrpe is showing incorrect output
-
Amit_Alone
- Posts: 89
- Joined: Fri May 08, 2020 11:47 am
Re: check_nrpe is showing incorrect output
Hi,
XXX.XXX.XXX.0/26 this allowed IP range is a NagiosXI IP.
Thanks.
XXX.XXX.XXX.0/26 this allowed IP range is a NagiosXI IP.
Thanks.
Re: check_nrpe is showing incorrect output
Hi,
When you express it as XXX.XXX.XXX.0/26 CIDR notation it can be any one of
64 IP addresses
The NRPE agent needs to know the IP of the Nagios XI server. It can't accept a range of IPs,
it isn't built that way.
So please update the line:
to use the IP4 (XXX.XXX.XXX.XXX) address of the Nagios XI server.
Thank you
When you express it as XXX.XXX.XXX.0/26 CIDR notation it can be any one of
64 IP addresses
The NRPE agent needs to know the IP of the Nagios XI server. It can't accept a range of IPs,
it isn't built that way.
So please update the line:
Code: Select all
only_from = 127.0.0.1 XXX.XXX.XXX.0/26Thank you
-
Amit_Alone
- Posts: 89
- Joined: Fri May 08, 2020 11:47 am
Re: check_nrpe is showing incorrect output
Hi Smith,
As suggested, I have updated the /etc/xinetd.d/nrpe file but still no luck. It's still displaying incorrect output.
Below data from Linux Oracle server.
Below is from NagiosXI server
Thanks.
As suggested, I have updated the /etc/xinetd.d/nrpe file but still no luck. It's still displaying incorrect output.
Below data from Linux Oracle server.
Code: Select all
[root@agasporap1855 ~]# vi /etc/xinetd.d/nrpe
[root@agasporap1855 ~]# systemctl restart xinetd.service
[root@agasporap1855 ~]# cat /etc/xinetd.d/nrpe
# default: off
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
disable = no
per_source = 25
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
only_from = 127.0.0.1 XX.XXX.XXX.26
log_on_success =
}
[root@agasporap1855 ~]#
Code: Select all
bash-4.2$ /usr/local/nagios/libexec/check_nrpe -H XX.XX.XX.55 -t 30 -c DBconnection_status
CRITICAL - Oracle DB Connection Failed
bash-4.2$
Re: check_nrpe is showing incorrect output
Hi
1. What happens when you do this on the Linux Oracle server:
2. Could you send me the check_dbconnection.sh please?
Thanks
1. What happens when you do this on the Linux Oracle server:
Code: Select all
sudo su - nagios
/usr/local/nagios/libexec/check_dbconnection.shThanks
-
Amit_Alone
- Posts: 89
- Joined: Fri May 08, 2020 11:47 am
Re: check_nrpe is showing incorrect output
Hi Smith,
As suggested, I run the cmd under nagios user on Linux Oracle server and observed the incorrect o/p.
I had PM the check_dbconnection.sh to you.
As suggested, I run the cmd under nagios user on Linux Oracle server and observed the incorrect o/p.
Code: Select all
[root@agasporap1855 ~]# /usr/local/nagios/libexec/check_dbconnection.sh
OK - Oracle DB connected Successfully
[root@agasporap1855 ~]# sudo su - nagios
Last login: Mon Aug 9 12:04:13 EDT 2021 on pts/0
[nagios@agasporap1855 ~]$ /usr/local/nagios/libexec/check_dbconnection.sh
CRITICAL - Oracle DB Connection Failed
[nagios@agasporap1855 ~]$
-
Amit_Alone
- Posts: 89
- Joined: Fri May 08, 2020 11:47 am
Re: check_nrpe is showing incorrect output
Now getting correct o/p after running the script as a nagios user on Linux Oracel server
However, still I'm observing the issue while running the command through check_nrpe from NagiosXI server.
Code: Select all
[nagios@agasporap1855 ~]$ /usr/local/nagios/libexec/check_dbconnection.sh
OK - Oracle DB connected Successfully
[nagios@agasporap1855 ~]$Code: Select all
bash-4.2$ /usr/local/nagios/libexec/check_nrpe -H XX.XX.XX.55 -t 30 -c DBconnection_status
CRITICAL - Oracle DB Connection Failed
bash-4.2$
Re: check_nrpe is showing incorrect output
Hi
Could you temporarily update your script as follows:
DBstatus=`echo "exit;" | sqlplus user/password@(connect string)" 2>&1 | tee /tmp/dbout.log| grep "Connected to:" | wc -l`
Then run the command through check_nrpe on the Nagios server.
Then take a look at and post /tmp/dbout.log
Thanks
Could you temporarily update your script as follows:
DBstatus=`echo "exit;" | sqlplus user/password@(connect string)" 2>&1 | tee /tmp/dbout.log| grep "Connected to:" | wc -l`
Then run the command through check_nrpe on the Nagios server.
Then take a look at and post /tmp/dbout.log
Thanks
-
Amit_Alone
- Posts: 89
- Joined: Fri May 08, 2020 11:47 am
Re: check_nrpe is showing incorrect output
Hi Smith,
As suggested, I have updated the script by adding the tee command and ran the script from NagiosXI server.
Below is the o/p of dbout.log file
Below is from NagiosXI server
Thanks.
As suggested, I have updated the script by adding the tee command and ran the script from NagiosXI server.
Below is the o/p of dbout.log file
Code: Select all
[root@agasporap1855 tmp]# cat dbout.log
/usr/local/nagios/libexec/check_dbconnection.sh: line 6: sqlplus: command not foundCode: Select all
bash-4.2$ /usr/local/nagios/libexec/check_nrpe -H 10.110.3.55 -t 30 -c DBconnection_status
CRITICAL - Oracle DB Connection FailedRe: check_nrpe is showing incorrect output
Hi
In your script please include the full path to sqlplus:
DBstatus=`echo "exit;" | sqlplus user/password@(connect string)" 2>&1 | tee /tmp/dbout.log| grep "Connected to:" | wc -l`
Let me know how that works please. If it gives you an error please post the contents of /tmp/dbout.log
Thanks
In your script please include the full path to sqlplus:
DBstatus=`echo "exit;" | sqlplus user/password@(connect string)" 2>&1 | tee /tmp/dbout.log| grep "Connected to:" | wc -l`
Let me know how that works please. If it gives you an error please post the contents of /tmp/dbout.log
Thanks
-
Amit_Alone
- Posts: 89
- Joined: Fri May 08, 2020 11:47 am
Re: check_nrpe is showing incorrect output
Hi Smith,
Not sure which oracle full path you're referring to add me. However, on the Linux Oracle server under the nagios profile I already mention Oracle Home path.
Not sure which oracle full path you're referring to add me. However, on the Linux Oracle server under the nagios profile I already mention Oracle Home path.
Code: Select all
[nagios@agasporap1855 ~]$ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
#PATH=$PATH:$HOME/.local/bin:$HOME/bin
PATH=$PATH:$HOME/.local/bin:$HOME/bin:/u01/app/grid/19.3.0/gridhome_1/bin/
export PATH
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
[nagios@agasporap1855 ~]$