Code: Select all
https://exchange.nagios.org/directory/Plugins/Databases/SQLServer/check_mssql_sproc/detailsCode: Select all
https://github.com/brunocantisano/check_mssql_sproc_parametersMy question is there another or easier
Code: Select all
https://exchange.nagios.org/directory/Plugins/Databases/SQLServer/check_mssql_sproc/detailsCode: Select all
https://github.com/brunocantisano/check_mssql_sproc_parametersCode: Select all
./check_mssql_sproc_parameters.pl -H sqldev_digitallog,4000 -u DigitalLogNagios -P detak_22e -p "dbo.uspDgtlGetErrorLogs @DgtlLogMinutes = 999999, @DgtlLogSourceId = 16, @DgtlLogLevel = 4" -w 1 -c 2 Code: Select all
[root@nagios libexec]# ./check_mssql_sproc_parameters.pl -H 1.1.1.1,1433 -d database -u username -P password -p "get_gpa_stats_all @calendarID=57" -w 1 -c 2
DBI connect('Driver={ODBC Driver 11 for SQL Server};SERVER=1.1.1.1,1433','username',...) failed: [unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002) at ./check_mssql_sproc_parameters.pl line 71.
Error: Unable to connect to MS-SQL database!
[unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002)Code: Select all
#!/usr/bin/php
<?php
$dbh = new PDO("dblib:host=1.1.1.1;dbname=database", "username", "password");
$sth = $dbh->prepare("EXEC get_gpa_stats_all @calendarID=57");
$sth->execute();
while($result = $sth->fetch(PDO::FETCH_ASSOC)) {
var_dump($result);
}
?>
Code: Select all
./check_mssql_sproc.pl -H sqldev_digitallog,4000 -u DigitalLogNagios -P detak_22e -p "dbo.uspDgtlGetErrorLogs @DgtlLogMinutes = 999999, @DgtlLogSourceId = 16, @DgtlLogLevel = 4" -w 1 -c 2[root@nagiosl1t ~]# which perlYou might also check the output of which perl executed from both root and the nagios user to make sure the script's shebang is pointing to the correct executable.
Yes, I am using an AD service account with read rights to the MSSQL database.Also, you are using a MSSQL user and not Windows domain users correct?