5.3.0 Upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
brettmlawrence
Posts: 31
Joined: Tue Oct 27, 2015 11:48 am

Re: 5.3.0 Upgrade

Post 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?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: 5.3.0 Upgrade

Post 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
brettmlawrence
Posts: 31
Joined: Tue Oct 27, 2015 11:48 am

Re: 5.3.0 Upgrade

Post by brettmlawrence »

Disregard. This works.

Thank you very much. I need to get myself to a training class for this.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: 5.3.0 Upgrade

Post 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!
Locked