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:
parent
2778fcb5a4
commit
b02a54d352
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user