1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-22 10:23:46 +01:00

check mssql dbsize bugfix

This commit is contained in:
Páll Guðjón Sigurðsson 2010-08-25 17:00:14 +00:00
parent 2778fcb5a4
commit b02a54d352

View File

@ -7,9 +7,10 @@
$HOSTNAME=$ARGV[0]; $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); @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; #[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; $num_databases = 0;
@ -20,7 +21,7 @@ foreach $database (@array1)
$database =~ s/^\s*(.*?)\s*$/$1/; $database =~ s/^\s*(.*?)\s*$/$1/;
# Call check_nrpe # 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 # Strip everything but the performance data
$dbSize =~ s/^.*\|(.*?)$/$1/; $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";