Home » Categories » Products » Nagios XI » Troubleshooting » Common Problems

Nagios XI - MSSQL Query Wizard - Invalid characters in the username

Problem Description

After running the MSSQL Query wizard your new service has an UNKNOWN state with the following error:

UNKNOWN: Invalid characters in the username.

 

This problem can occur when trying to connect using Windows authentication and your username is something like user\domain, it is complaining about the backslash (\).

 

 

Resolution

The check_mssql plugin can be updated to allow the backslash. Establish a terminal session to your Nagios XI server as the user root.

Execute the following command to open the /usr/local/nagios/libexec/check_mssql file in vi:

vi /usr/local/nagios/libexec/check_mssql

When using the vi editor, to make changes press i on the keyboard first to enter insert mode. Press Esc to exit insert mode.

 

Jump to line 347 by typing the following:

:347

and press Enter.

 

The line you are looking for should look like this:

if (!preg_match("/^[a-zA-Z0-9-_]{2,32}$/", $db_user)) {

 

Change it to (add \\\\):

if (!preg_match("/^[a-zA-Z0-9-_\\\\]{2,32}$/", $db_user)) {

 

When you have finished, save the changes in vi by typing:

:wq

and press Enter.

 

After making these changes go back into the XI web interface and force an immediate check of the service to test that it is working correctly.

 


 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - MK Livestatus Problems With Mod-Gearman
Viewed 6120 times since Thu, Feb 25, 2016
OpenSSL causes issue with check_nrpe plugin with NSClient++
Viewed 9448 times since Fri, Apr 30, 2021
Turning Off PHP Notices and Deprecated Messages
Viewed 4477 times since Wed, Oct 20, 2021
Nagios XI - Notifications Not Sending In XI 5.3.0
Viewed 5672 times since Tue, Oct 4, 2016
Nagios XI - Error while converting SVG
Viewed 4906 times since Thu, Aug 3, 2017
Nagios XI - Issues with mod_gearman and Performance Data Newlines: "\n"
Viewed 4440 times since Tue, Feb 2, 2016
Disabling Port 113 IDENT Requests
Viewed 6049 times since Tue, Mar 12, 2019
NDOUtils - Message Queue Exceeded
Viewed 16445 times since Thu, Jan 21, 2016
VMWare checks timing out or slow
Viewed 3848 times since Fri, Feb 11, 2022
Nagios XI - HTTP 500 Error / White Screen After Login
Viewed 6789 times since Mon, Feb 29, 2016