[Nagiosplug-devel] Patch for check_oracle on Solaris and/or Oracle 8.X

Florian Gleixner flo at bier.homeip.net
Wed Sep 5 13:30:32 CEST 2007


Hi

There are 2 bugs in check oracle: on Solaris the /usr/bin/awk behaves
different than on Linux. But Solaris has /usr/xpg4/bin/awk and nawk that
behaves like the Linux one.
The second bug: Unfortunately the syntax of joins did change: Oracle 8.X
only knows the (+) operator while with Oracle 9 the "LEFT OUTER JOIN"
Syntax was established. As far as i can see the outer join operator is
still supported in Oracle 10g.
Below a patch that should fix these issues.

Florian Gleixner


--- check_oracle        2007-09-05 13:17:01.000000000 +0200
+++ check_oracle.orig   2007-07-27 11:53:42.000000000 +0200
@@ -12,10 +12,6 @@

 . $PROGPATH/utils.sh

-if [ `uname -s` = "SunOS" ] ; then
-  PATH=/usr/xpg4/bin:$PATH
-  export PATH
-fi

 print_usage() {
   echo "Usage:"
@@ -253,10 +249,11 @@
 select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total *
1000) / 10 prc
 from (
 select tablespace_name,sum(bytes)/1024/1024 total
-from dba_data_files group by tablespace_name) A,
+from dba_data_files group by tablespace_name) A
+LEFT OUTER JOIN
 ( select tablespace_name,sum(bytes)/1024/1024 free
 from dba_free_space group by tablespace_name) B
-WHERE a.tablespace_name=b.tablespace_name(+) AND a.tablespace_name='${5}';
+ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}';
 EOF`

     if [ -n "`echo $result | grep ORA-`" ] ; then




More information about the Devel mailing list