Page 3 of 3

Re: 5.3.0 Upgrade

Posted: Mon Oct 24, 2016 12:50 pm
by brettmlawrence
Sure, sorry I'm a bit of a beginner with this. What is the correct way to run these on the command line?

Re: 5.3.0 Upgrade

Posted: Mon Oct 24, 2016 2:26 pm
by ssax
Please edit this file on the server:

Code: Select all

/usr/local/nagios/libexec/check_mssql
Around line 253 change this code:

Code: Select all

// 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.\n";
        exit(3);
    }
} else {
    print "UNKNOWN: You must specify a username for this DB connection.\n";
    exit(3);
}
To this:

Code: Select all

// 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.\n";
        exit(3);
    }
} else {
    print "UNKNOWN: You must specify a username for this DB connection.\n";
    exit(3);
}
That should resolve the issue, let us know the results.


Thank you

Re: 5.3.0 Upgrade

Posted: Tue Oct 25, 2016 7:54 am
by brettmlawrence
Disregard. This works.

Thank you very much. I need to get myself to a training class for this.

Re: 5.3.0 Upgrade

Posted: Tue Oct 25, 2016 10:16 am
by dwhitfield
Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!