This is a cache of https://support.nagios.com/kb/article/nagios-xi-mssql-query-wizard-invalid-characters-in-the-username-734.html. It is a snapshot of the page at 2025-05-14T00:09:02.470+0000.
Nagios <strong>xi</strong> - MSSQL Query Wizard - Invalid characters in the username
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 - Event Data Is Stale
Viewed 5983 times since Wed, Jan 27, 2016
Nagios xi - MRTG Reports SNMP_Session Errors
Viewed 5875 times since Wed, Jul 27, 2016
Nagios xi - mysql_error out of range value for column
Viewed 6700 times since Tue, Aug 14, 2018
Nagios xi - Installing Latest SourceGuardian Loaders
Viewed 8129 times since Mon, Jun 18, 2018
Nagios xi - Empty Screen for Wizard, Component, Dashlet
Viewed 8075 times since Wed, Jan 27, 2016
Nagios xi - Uploaded plugin returns "/bin/bash^M: bad interpreter: No such file or directory"
Viewed 7413 times since Thu, Feb 25, 2016
SSL Certificate does not validate properly
Viewed 5363 times since Wed, Jan 20, 2021
Web Browser Reports 330 Error Content Encoding
Viewed 8620 times since Tue, Mar 7, 2017
Nagios xi - Resetting The nagiosadmin Password
Viewed 46825 times since Mon, Jan 25, 2016
Nagios xi - WMI Authentication Problems
Viewed 7613 times since Thu, Feb 25, 2016