[Nagiosplug-devel] Patch for check_oracle.sh and compile error at check_ntp.c
Ton Voon
ton.voon at altinity.com
Thu Oct 26 23:11:53 CEST 2006
Florian,
Thanks for the patches. I've applied the check_oracle one, although I
have no access to Oracle to try it out. Can you test the cvs snapshot
at http://nagiosplug.sf.net/snapshot please?
I have no idea about the check_ntp one. Maybe Sean can help there?
Ton
On 20 Oct 2006, at 11:45, Florian Gleixner wrote:
> Hi,
>
> i realized, that you forgot to include my patch - probably because
> i did
> not use sourceforge's patch management. I've attached the old mails.
>
> I tried to make plugins-1.4.4 and got this error:
>
> make[2]: Entering directory `/var/tmp/nagios-plugins-1.4.4/plugins'
> if gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H
> -I. -I. -I.. -I.. -I../lib -I../intl -I/usr/include/ldap
> -I/usr/include/pgsql -I/usr/include -g -O2 -MT check_ntp.o -MD -MP
> -MF ".deps/check_ntp.Tpo" -c -o check_ntp.o check_ntp.c; \
> then mv -f ".deps/check_ntp.Tpo" ".deps/check_ntp.Po"; else rm -f
> ".deps/check_ntp.Tpo"; exit 1; fi
> cc1: warning: changing search order for system directory "/usr/
> include"
> cc1: warning: as it has already been specified as a non-system
> directory
> check_ntp.c: In function `setup_request':
> check_ntp.c:295: invalid operands to binary &
> check_ntp.c:295: invalid operands to binary &
> check_ntp.c:295: invalid operands to binary &
> check_ntp.c:295: invalid operands to binary &
> make[2]: *** [check_ntp.o] Error 1
> make[2]: Leaving directory `/var/tmp/nagios-plugins-1.4.4/plugins'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/var/tmp/nagios-plugins-1.4.4'
> make: *** [all] Error 2
>
> it's a pretty old machine with Suse Linux Enterprise 8 and a 2.4.19
> Linux Kernel.
>
> Florian Gleixner
>
> -------- Original Message --------
> Date: Thu, 17 Aug 2006 11:12:02 +0200
> From: Florian Gleixner <flo at bier.homeip.net>
> To: Nagios Plugin Development Mailing List
> Subject: Re: [Nagiosplug-devel] Patch for check_oracle.sh
>
>
> OOps, one forgot one NVL()!
>
>
> @@ -244,13 +244,14 @@
> 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
> +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
>
>
> Florian Gleixner wrote:
>> Hi,
>>
>> check_oracle gives
>>
>> /usr/local/nagios/libexec/check_oracle: [: : integer expression
>> expected
>> /usr/local/nagios/libexec/check_oracle: [: : integer expression
>> expected
>> /usr/local/nagios/libexec/check_oracle: [: : integer expression
>> expected
>>
>> if the table dba_free_space does not contain any free segment -> the
>> tablespace is 100% full. I changed the query so that it returns
>> 100% in
>> this condition.
>>
>> Here's the patch:
>>
>> diff -ud check_oracle.sh check_oracle
>> --- check_oracle_v14.sh 2006-08-17 10:57:29.605426000 +0200
>> +++ check_oracle 2006-08-17 10:59:16.006634000 +0200
>> @@ -244,13 +244,14 @@
>> 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
>> +select b.free,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
>>
>>
>>
>> Florian Gleixner
http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20061026/dacf6b0e/attachment.html>
More information about the Devel
mailing list