From b02a54d352d8d88f19f6fe638b7e8b7fa2cd0b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Gu=C3=B0j=C3=B3n=20Sigur=C3=B0sson?= Date: Wed, 25 Aug 2010 17:00:14 +0000 Subject: [PATCH] check mssql dbsize bugfix --- check_mssql/trunk/check_mssql_dbsize.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/check_mssql/trunk/check_mssql_dbsize.pl b/check_mssql/trunk/check_mssql_dbsize.pl index 08618d3..e9ca22e 100644 --- a/check_mssql/trunk/check_mssql_dbsize.pl +++ b/check_mssql/trunk/check_mssql_dbsize.pl @@ -7,9 +7,10 @@ $HOSTNAME=$ARGV[0]; -$databases = `check_nrpe -H $HOSTNAME -c listCounterInstances -a "SQLServer:Databases"`; +$databases = `/usr/lib/nagios/plugins/check_nrpe -H $HOSTNAME -c listCounterInstances -a "SQLServer:Databases"`; @array1 = split(/\,/, $databases); +print "$databases "; #[root@nagios ~]# check_nrpe -H $HOSTNAME -c CheckCounter -a "Counter:Vanskilaskra=\SQLServer:Databases(Vanskilaskra)\Data File(s) Size (KB)"# OK all counters within bounds.|'Vanskilaskra'=30996480;0;0; $num_databases = 0; @@ -20,7 +21,7 @@ foreach $database (@array1) $database =~ s/^\s*(.*?)\s*$/$1/; # Call check_nrpe - $dbSize = `check_nrpe -H $HOSTNAME -c CheckCounter -a 'Counter:$database=\\SQLServer:Databases($database)\\Data File(s) Size (KB)'`; + $dbSize = `/usr/lib/nagios/plugins/check_nrpe -H $HOSTNAME -c CheckCounter -a 'Counter:$database=\\SQLServer:Databases($database)\\Data File(s) Size (KB)'`; # Strip everything but the performance data $dbSize =~ s/^.*\|(.*?)$/$1/; @@ -31,4 +32,4 @@ foreach $database (@array1) } -print "$num_databases databases found | $perfdata \n"; +print "$num_databases databases found in $HOSTNAME | $perfdata \n";