SQLServer

check_mssql_sproc

Description:

This script will connect to an MS SQL server, run a stored procedure, and alert based on the results. NOTE: Tested and works on Windows. Should work on *nix, unable to test right now

Current Version

Last Release Date

June 7, 2009

Compatible With


Project Files
Project Notes
From the Help file: Usage: check_mssql_sproc.pl -H HOSTNAME -p PROCEDURE -u user -P password -w -c check_mssql_sproc.pl 1.01 Copyright (c) 2005 Jeremy D. Pavleck This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -p, --procedure Stored procedure to execute -H, --hostname Hostname of database server -d --database Database to run Stored Procedure against -u, --user SQL Username -P, --password SQL Password -c, --critical Value at which when met or exceeded will send a critical alert -w, --warning Value at which when met or exceeded (but is lower then critical value) will send a warning alert. -h, --help Display detailed help -v, --version Show version information This program will connect to a remote MS SQL server, execute a stored procedure, and then process the results to determine if there is an error state or not. Currently it only works if the stored procedure returns a single result in one column. It has not been tested to work with any other result sets; There is currently a sister script which DOES handle these things, as well as boolean and word results. It should be available shortly. Additional Notes & Tips: If you don't wish to have your SQL passwords exposed to the world you can do one of two things - 1. Set $USERx$ in resource.cfg to the password - this will be passed to the program by Nagios, but will not be visible from the web console or 2. If you have a universal SQL login for all of your Nagios queries, then you may hardcode the username & password into the beginning of this script.
Reviews (2) Add a Review
updated plugin
by bruno.cantisano, April 30, 2017

I made an update in the original code, because it works with procedures that only return one column, but does not allow parameters and doesn't work if the procedure returns more than one column. With this update the procedure must return the first column as an int (procedure return) called "retorno". More info: https://github.com/brunocantisano/check_mssql_sproc_parameters This plugin helped me a lot, so I had to update the code as a thanking way. :) Thanks Jeremy D. Pavleck (the original author)



Good But...
by dcoote, April 30, 2011

I must admit I haven't tested thoroughly but I did wrestle for hours before finding out. A quick change is required to make this work on *nix systems. Damn case sensitive. For *nix systems $conn{"dsn"} = "dbi:ODBC:Driver={SQL Server};SERVER=" . $conn{"server"}; Should read $conn{"dsn"} = "dbi:ODBC:DRIVER={SQL Server};SERVER=" . $conn{"server"};



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3 (2)
Favorites
0
Views
108,324