Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
there's a problem with a nagios check. All other checks have a status information except service "Tablespace VPSTAB EASTPROD". See attached jpg.
The script is defined as
command[check_east_vpstab]=/usr/local/nagios/libexec/check_tablespace.bsh -d EASTPROD -t VPSTAB -w 85 -c 90
in nrpe.cfg.
At the end of the shell script check_tablespace.bsh there are some echos and exitsatus:
...
ECHO="/bin/echo -e"
...
sqlplus / as sysdba @/usr/local/nagios/libexec/belegung_tablespaces.sql
ZEILEN=$(awk -v TS="${TABLESPACE}" -v W="${WARNING}" 'match($0,TS) {if ($NF > W) print $NF}' /tmp/belegung_tablespace.txt|awk -F"." '{print $1}')
if [ -z ${ZEILEN} ];then
# Tablespace ist weniger als ${WARNING}% belegt -> alles OK
$ECHO "Tablespace ${TABLESPACE} der Instanz ${DATABASE} hat noch genug Platz.\n"
exitstatus=$STATE_OK
else
if [ ${ZEILEN} -gt ${CRIT} ];then
# Tablespace ist ueber 90% belegt -> kritisch
$ECHO "Tablespace ${TABLESPACE} der Instanz ${DATABASE} hat nicht mehr genug Platz.\n"
exitstatus=$STATE_CRITICAL
else
# Tablespace ist zwischen ${WARNING}% und ${CRIT}% belegt -> Warnung
$ECHO "Tablespace ${TABLESPACE} der Instanz ${DATABASE} muss vergroessert werden.\n"
exitstatus=$STATE_WARNING
fi
fi
exit ${exitstatus}
nagios@madpbk51:/usr/local/nagios/libexec> ./check_nrpe -H veastdb11 -c check_east_vpstab
SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 6 10:51:47 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
TABLESPACE_NAME MB_USED MB_FREE PERCENT_USED
-------------------- ---------- ---------- ------------
VPSTAB 272377 48510 82.19
SYSTEM 1400 272 80.57
SYSAUX 1300 298 77.06
USERS 500 193 61.31
UNDOTBS1 4096 4008 02.16
PSTAB 20480 20272 01.01
6 rows selected.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Tablespace VPSTAB der Instanz EASTPROD hat noch genug Platz.
I think, the last line of output should be the status information. Tablespace VPSTAB der Instanz EASTPROD hat noch genug Platz.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sorry for my answer took so much time. I'm not sure if I understand what you mean. No information goes to stderr. All echo commands print to stdout. There is no redirection form stdout to stderr.
Can you stick in an echo that does not sit inside an if statement? Just echo "DEBUG" or something in the first line of the script. I want to see if it can output anything at all.
Current Status:
WARNING
(for 1d 19h 22m 40s)
Status Information: Script is running
SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 26 13:38:00 2014
\nCopyright (c) 1982, 2011, Oracle. All rights reserved.
\n
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
\n
TABLESPACE_NAME MB_USED MB_FREE PERCENT_USED
-------------------- ---------- ---------- ------------
VPSTAB 277497 40162 85.53
SYSTEM 1400 264 81.14
SYSAUX 1300 287 77.94
USERS 500 193 61.31
UNDOTBS1 4096 4043 01.30
PSTAB 20480 20262 01.06
\n6 rows selected.
\nDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Tablespace VPSTAB der Instanz EASTPROD muss vergroessert werden.
Performance Data:
Current Attempt: 3/3 (HARD state)
Last Check Time: 26-03-2014 13:38:00
Check Type: ACTIVE
Check Latency / Duration: 0,000 / 0,000 seconds
Next Scheduled Check: 26-03-2014 14:38:00
Last State Change: 24-03-2014 18:16:13
Last Notification: 26-03-2014 10:20:19 (notification 11)
Is This Service Flapping?
NO
(0,00% state change)
In Scheduled Downtime?
NO
Last Update: 26-03-2014 13:38:49 ( 0d 0h 0m 4s ago)
Active Checks:
ENABLED
Passive Checks:
ENABLED
Obsessing:
ENABLED
Notifications:
ENABLED
Event Handler:
ENABLED
Flap Detection:
ENABLED
As you can see the line "Script is running" appears in the output.
nagios@madpbk51:/usr/local/nagios/libexec> ./check_nrpe -H veastdb11 -c check_east_vpstab
SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 6 10:51:47 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
TABLESPACE_NAME MB_USED MB_FREE PERCENT_USED
-------------------- ---------- ---------- ------------
VPSTAB 272377 48510 82.19
SYSTEM 1400 272 80.57
SYSAUX 1300 298 77.06
USERS 500 193 61.31
UNDOTBS1 4096 4008 02.16
PSTAB 20480 20272 01.01
6 rows selected.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Tablespace VPSTAB der Instanz EASTPROD hat noch genug Platz.
The first line is blank as seen directly under the command
Current Status: WARNING (for 2d 18h 40m 6s)
Status Information: Tablespace VPSTAB der Instanz EASTPROD muss vergroessert werden.
Performance Data:
Current Attempt: 3/3 (HARD state)
Last Check Time: 27-03-2014 12:56:00
Check Type: ACTIVE
Check Latency / Duration: 0,000 / 0,000 seconds
Next Scheduled Check: 27-03-2014 13:56:00
Last State Change: 24-03-2014 18:16:13
Last Notification: 27-03-2014 10:38:09 (notification 17)
Is This Service Flapping? NO (0,00% state change)
In Scheduled Downtime? NO
Last Update: 27-03-2014 12:56:13 ( 0d 0h 0m 6s ago)
Thanks for your investigation! Thread can be closed.