check_mssql.pl: switched alarm timeout

- alarm() now uses -t option
    contributed by Bernd Arnold (wopfel@gmail.com)

    closes #991
This commit is contained in:
Bernd Apfel 2015-10-15 11:20:20 +02:00 committed by Oliver Skibbe
parent 3f17f18416
commit 223c594661

View file

@ -54,7 +54,7 @@ $SIG{'ALRM'} = sub {
print ("SQL UNKNOWN: ERROR connection $server (alarm timeout)\n");
exit $ERRORS{"UNKNOWN"};
};
alarm($TIMEOUT);
alarm($timeout);
unless ($dbh = DBI->connect("dbi:Sybase:server=".uc($server), "$username", "$password")) {
printf "SQL CRITICAL: Can't connect to mssql server $DBI::errstr\n";