THIS KNOWLEDGE BASE HAS BEEN ARCHIVED AND IS NO LONGER BEING UPDATED
Please visit library.nagios.com/docs for the latest and most up-to-date documentation.
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!

1 (2)
Article Rating (2 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 - Migrate Performance Data
Viewed 16545 times since Tue, Jan 26, 2016
CCM says unapplied changes exist, but none listed
Viewed 8334 times since Mon, Feb 27, 2017
Slack Notifications Stopped Working
Viewed 6835 times since Wed, Mar 18, 2020
Nagios XI - Configuration Applies, No Changes Take Place
Viewed 11299 times since Tue, Jan 27, 2015
Upgrading to NDO 3 after having been downgraded in newer versions of Nagios XI
Viewed 6483 times since Fri, Jan 15, 2021
Nagios XI - Can’t Log Into The Web Interface
Viewed 70049 times since Tue, Jan 27, 2015
Nagios XI - NSP: Sorry Dave, I can’t let you do that
Viewed 25869 times since Tue, Jan 27, 2015
VMWare checks timing out or slow
Viewed 6132 times since Fri, Feb 11, 2022
Nagios XI - Resetting The nagiosadmin Password
Viewed 54194 times since Mon, Jan 25, 2016
Nagios XI - Unable to Delete Host
Viewed 27922 times since Tue, Dec 16, 2014