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 (\).




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:


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:


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:


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 - Last Check Time Not Updating
Viewed 13815 times since Tue, Jan 6, 2015
Nagios XI - Uploaded plugin returns "/bin/bash^M: bad interpreter: No such file or directory"
Viewed 4804 times since Thu, Feb 25, 2016
Nagios XI - Core 4 Load Spikes on 1.75 and 7 Hour Intervals
Viewed 3012 times since Mon, Jan 25, 2016
Backups are not being generated due to tar creation errors
Viewed 2247 times since Thu, Feb 27, 2020
Nagios XI - Performance Graph Problems
Viewed 18871 times since Fri, Dec 19, 2014
Nagios XI - ICMP and Ping Checks Stopped Graphing
Viewed 8202 times since Mon, Jan 25, 2016
Disabling Port 113 IDENT Requests
Viewed 3516 times since Tue, Mar 12, 2019
Nagios XI - Defining Global Environment Variables
Viewed 7115 times since Thu, Mar 17, 2016
Web Browser Reports 330 Error Content Encoding
Viewed 3411 times since Tue, Mar 7, 2017
Enabling Oracle Linux Optional Repository
Viewed 11561 times since Mon, May 14, 2018