summaryrefslogtreecommitdiffstats
path: root/web/attachments/126077-check_oracle.diff
blob: 2266ce3dd3e003426c3c867931505f0e1a97922d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- check_oracle.new	2005-03-17 15:12:05.000000000 +0100
+++ /home/stefan/packages/nagios-plugins-1.4/plugins-scripts/check_oracle.sh	2004-12-01 21:09:59.000000000 +0100
@@ -241,36 +241,17 @@
 	echo "UNKNOWN - Warning level is more then Crit"
 	exit $STATE_UNKNOWN
     fi
-
-
-    if [ ${5} = 'TEMP' ] ; then
-      	result=`sqlplus -s ${3}/${4}@${2} << EOF
-        set pagesize 0
-        set numf '9999999.99'
-
-        select b.free,a.total,100 - trunc(b.free/a.total * 1000) / 10 prc 
-        from ( 
-        select tablespace_name,sum(bytes)/1024/1024 total 
-        from dba_temp_files group by tablespace_name) A, 
-        ( select tablespace_name,sum(bytes_free)/1024/1024 free 
-        from v\\$temp_space_header group by tablespace_name) B 
-        where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}';
-        EOF`
-   else
-        result=`sqlplus -s ${3}/${4}@${2} << EOF
-        set pagesize 0
-        set numf '9999999.99'
-
-        select b.free,a.total,100 - trunc(b.free/a.total * 1000) / 10 prc 
-        from ( 
-        select tablespace_name,sum(bytes)/1024/1024 total 
-        from dba_data_files group by tablespace_name) A, 
-        ( 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}';
-        EOF`
-   fi
-																			
+    result=`sqlplus -s ${3}/${4}@${2} << EOF
+set pagesize 0
+set numf '9999999.99'
+select b.free,a.total,100 - trunc(b.free/a.total * 1000) / 10 prc
+from (
+select tablespace_name,sum(bytes)/1024/1024 total
+from dba_data_files group by tablespace_name) A,
+( 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}';
+EOF`
 
     if [ -n "`echo $result | grep ORA-`" ] ; then
       error=` echo "$result" | grep "ORA-" | head -1`