Using Domain login

nice plugin, perfect for what I need

Made the following modifications to allow for using a windows login instead of a SQL server account

edited /etc/freetds.conf and added the following entries to the [global] section.

tds version = 7.0
use ntlmv2 = yes (required in my environment anyways)

You could also create a .freetds.conf file in the nagios home folder if you prefer.

changed the regex slightly to allow for backslashes in username

was
// Validate the username
if (isset($db_user)) {
if (!preg_match(“/^[a-zA-Z0-9-]{2,32}$/”, $db_user)) {
print “UNKNOWN: Invalid characters in the username.
“;
// exit(3);

changed to

// Validate the username
if (isset($db_user)) {
if (!preg_match(“/^[a-zA-Z0-9-]{2,32}$/”, $db_user)) {
print “UNKNOWN: Invalid characters in the username.
“;
// exit(3);

supply –username as follows

check_mssql -H sqlserver –username DOMAINuser.id –password 12345