Page 2 of 3

Re: Tablespace monitoring

Posted: Tue Feb 16, 2021 9:20 am
by kalyanpabolu
Hello,

We cross verified the login details. Also, all the tablespaces have some space allocated. Also, all of them are mounted on the same filesystem, so there cannot be any discrepancies. There is no permission issue as well.

We also ran the script by logging in Databases with the nagios user and password and the script was running perfectly fine. It is giving output. The only thing is, it is not showing data in Nagios. I am attaching the screenshot of status in nagios for your reference.

If you see the screenshot, it gives OK - % used but no value.

Looking forward for your help!!

Re: Tablespace monitoring

Posted: Tue Feb 16, 2021 4:42 pm
by vtrac
Hi kalyanpabolu,
I have talked to my team here at Nagios and they don't think it is related to the "check_oracle" script since we have proved that it worked on one of the tablespace.

We believe that it is best that you work with your Oracle DBA to try to resolve this.

Here's the one that is working for the below tablespace of "BIPRD" database.

Code: Select all

[root@monprdmgtss03 plugins]# ./check_oracle --tablespace BIPRD "nagios" "n46105" 'BIPRD1117_BIPLATFORM' 90 85
BIPRD : BIPRD1117_BIPLATFORM OK - 80.70% used [ 116488 / 601083 MB available ]|BIPRD1117_BIPLATFORM=80.70%;85;90;0;100
Is EBSPRD reside on the same system as your Nagios XI?

Can you please run the below commands from your Nagios XI machine (command prompt)?
I want to know if Nagios XI machine can communicate with the oracle machine <oracle-port-number>
Please input the correct port and IP (below):

Code: Select all

ping <IP of EBSPRD>
nmap -Pn -p <oracle-port-number> <IP of BIPRD server>
nmap -Pn -p <oracle-port-number> <IP of BESPRD server>
Also, try the below command as well (on Nagios XI command prompt), list ALL opened port on BIPRD and BESPRD:

Code: Select all

nmap -Pn <IP of BIPRD server>
nmap -Pn <IP of BESPRD server>
Regards,
Vinh

Re: Tablespace monitoring

Posted: Wed Feb 24, 2021 4:19 am
by kalyanpabolu
Hello,

The IP address of EBSPRD and BIPRD is same as both DBs are on same server.

Below is the output of commands:

[root@monprdmgtss03 ~]# ping 10.50.32.9
PING 10.50.32.9 (10.50.32.9) 56(84) bytes of data.
64 bytes from 10.50.32.9: icmp_seq=1 ttl=64 time=0.387 ms
64 bytes from 10.50.32.9: icmp_seq=2 ttl=64 time=0.386 ms
64 bytes from 10.50.32.9: icmp_seq=3 ttl=64 time=0.217 ms
^C
--- 10.50.32.9 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.217/0.330/0.387/0.079 ms
[root@monprdmgtss03 ~]#



[root@monprdmgtss03 ~]# nmap -P0 -p 1521 10.50.32.9

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2021-02-24 13:15 GST
Interesting ports on 10.50.32.9:
PORT STATE SERVICE
1521/tcp open oracle

Nmap finished: 1 IP address (1 host up) scanned in 0.087 seconds
[root@monprdmgtss03 ~]#



[root@monprdmgtss03 ~]# nmap -P0 10.50.32.9

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2021-02-24 13:16 GST
Interesting ports on 10.50.32.9:
Not shown: 1672 filtered ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
443/tcp closed https
892/tcp open unknown
1521/tcp open oracle
1522/tcp closed rna-lm
1523/tcp closed cichild-lm
2049/tcp open nfs

Nmap finished: 1 IP address (1 host up) scanned in 21.542 seconds
[root@monprdmgtss03 ~]#


Is EBSPRD reside on the same system as your Nagios XI? - No

Re: Tablespace monitoring

Posted: Wed Feb 24, 2021 7:21 pm
by ssax
Please edit your /usr/local/nagios/libexec/check_oracle file and change this:

Code: Select all

   exit "$STATE_OK"
To this:

Code: Select all

   echo "$result"
   exit "$STATE_OK"
Then run the plugin from the command line (from an SSH session) against one of the failing ones and send me the entire output.

Revert the change once you are done.


Does this one work for you?

Code: Select all

. /usr/local/nagiosxi/etc/configwizards/oracle/oracle && /usr/local/nagios/libexec/check_oracle_health --connect 'X.X.X.X:1521/XE' --username 'username' --password 'password' --mode tablespace-free  --warning 5: --critical 2: -d -v
If not, make sure this file has the proper oracle_home/ld_library_path paths:

Code: Select all

/usr/local/nagiosxi/etc/configwizards/oracle/oracle

Re: Tablespace monitoring

Posted: Thu Feb 25, 2021 7:37 am
by kalyanpabolu
Hello,

When I am trying to run the plugin from command line, gettignbelow error:

[root@monprdmgtss03 plugins]# ./check_oracle --tablespace -s BIPRD -d 'BIPRD1117_BIPLATFORM' -w 80 -c 90
./check_oracle: line 244: [: -w: integer expression expected
CRITICAL - ORA-12154: TNS:could not resolve the connect identifier specified
[root@monprdmgtss03 plugins]#

Re: Tablespace monitoring

Posted: Fri Feb 26, 2021 5:54 pm
by vtrac
Hi,
Please check the syntax for "check_oracle" as follows:

Code: Select all

print_usage() {
  echo "Usage:"
  echo "  $PROGNAME --tns <Oracle Sid or Hostname/IP address>"
  echo "  $PROGNAME --db <ORACLE_SID>"
  echo "  $PROGNAME --login <ORACLE_SID>"
  echo "  $PROGNAME --connect <ORACLE_SID>"
  echo "  $PROGNAME --cache <ORACLE_SID> <USER> <PASS> <CRITICAL> <WARNING>"
  echo "  $PROGNAME --tablespace <ORACLE_SID> <USER> <PASS> <TABLESPACE> <CRITICAL> <WARNING>"
  echo "  $PROGNAME --oranames <Hostname>"
  echo "  $PROGNAME --help"
  echo "  $PROGNAME --version"
}
So, your syntax for checking "tablespace" is:

Code: Select all

./check_oracle  --tablespace <ORACLE_SID> <USER> <PASS> <TABLESPACE> <CRITICAL> <WARNING>
Example:

Code: Select all

./check_oracle --tablespace BIPRD "nagios" "n46105" 'BIPRD1117_BIPLATFORM' 90 85
Regards,
Vinh

Re: Tablespace monitoring

Posted: Sun Feb 28, 2021 11:43 pm
by kalyanpabolu
Hello,

Below is the output:

[opc@monprdmgtss03 plugins]$ ./check_oracle --tablespace BIPRD "nagios" "n46105" 'BIPRD1117_BIPLATFORM' 90 85
BIPRD : BIPRD1117_BIPLATFORM OK - 80.70% used [ 116478 / 601083 MB available ]|BIPRD1117_BIPLATFORM=80.70%;85;90;0;100
[opc@monprdmgtss03 plugins]$
[opc@monprdmgtss03 plugins]$
[opc@monprdmgtss03 plugins]$ ./check_oracle --tablespace BIPRD "nagios" "n46105" 'BIPRD1117_IAS_TEMP' 90 85
./check_oracle: line 287: [: : integer expression expected
./check_oracle: line 291: [: : integer expression expected
./check_oracle: line 295: [: : integer expression expected
BIPRD : BIPRD1117_IAS_TEMP OK - % used [ / MB available ]|BIPRD1117_IAS_TEMP=%;85;90;0;100
[opc@monprdmgtss03 plugins]$


For one tablespace getting correct output, but getting some error message for the other one.
Please suggest.

Re: Tablespace monitoring

Posted: Mon Mar 01, 2021 4:49 pm
by vtrac
Hi,
Please run the below sqlplus select commands and post the outputs/results here.
This will give us a better understanding of why'BIPRD1117_BIPLATFORM'works and 'BIPRD1117_IAS_TEMP' did not.

#1A) Check STATUS of 'BIPRD1117_IAS_TEMP':

Code: Select all

result=`sqlplus -s "nagios"/"n46105"@"BIPRD" << EOF
select STATUS
from DBA_TABLESPACES
WHERE tablespace_name='BIPRD1117_IAS_TEMP';
EOF`
echo $result
#1B) Check STATUS of 'BIPRD1117_BIPLATFORM':

Code: Select all

result=`sqlplus -s "nagios"/"n46105"@"BIPRD" << EOF
select STATUS
from DBA_TABLESPACES
WHERE tablespace_name='BIPRD1117_BIPLATFORM';
EOF`
echo $result
#2A) Check 'BIPRD1117_IAS_TEMP' in DBA_DATA_FILES:

Code: Select all

result=`sqlplus -s "nagios"/"n46105"@"BIPRD" << EOF
select BYTES
from DBA_DATA_FILES
WHERE tablespace_name='BIPRD1117_IAS_TEMP';
EOF`
echo $result
#2B) Check 'BIPRD1117_BIPLATFORM' in DBA_DATA_FILES:

Code: Select all

result=`sqlplus -s "nagios"/"n46105"@"BIPRD" << EOF
select BYTES
from DBA_DATA_FILES
WHERE tablespace_name='BIPRD1117_BIPLATFORM';
EOF`
echo $result
#3A) Check 'BIPRD1117_IAS_TEMP' in DBA_FREE_SPACE:

Code: Select all

result=`sqlplus -s "nagios"/"n46105"@"BIPRD" << EOF
select BYTES
from DBA_FREE_SPACE
WHERE tablespace_name='BIPRD1117_IAS_TEMP';
EOF`
echo $result
#3B) Check 'BIPRD1117_BIPLATFORM' in DBA_FREE_SPACE:

Code: Select all

result=`sqlplus -s "nagios"/"n46105"@"BIPRD" << EOF
select BYTES
from DBA_FREE_SPACE
WHERE tablespace_name='BIPRD1117_BIPLATFORM';
EOF`
echo $result
Regards,
Vinh

Re: Tablespace monitoring

Posted: Wed Mar 03, 2021 5:53 am
by kalyanpabolu
Hello,

PFA the output.

Re: Tablespace monitoring

Posted: Wed Mar 03, 2021 5:55 am
by kalyanpabolu
Hello,

Attached is the last screenshot