Nagios illegal Characters in cfg file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Nagios illegal Characters in cfg file

Post by kwhogster »

Nagios 4.1.1
Raspberry Pi Raspbian Jesse
Apache 2


Updated my windows.cfg today with all the services I need to monitor,

I have a few SQL services

Error: The description string for service 'MSSQL$SHAREPOINT' on host 'SERV010' contains one or more illegal characters.
Error: The description string for service 'MSSQL$WRESTLING' on host 'SERV010' contains one or more illegal characters.
Error: The description string for service 'SQLAgent$Sharepoint' on host 'SERV010' contains one or more illegal characters.
Error: The description string for service 'SQLAgent$Wrestling' on host 'SERV010' contains one or more illegal characters.

How do I get around the special characters in the cfg files?

Thanks
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

Here is what I tried so far


#########################Double Quotes Test############################

define service{
use generic-service
host_name SERV010
service_description "MSSQL$SHAREPOINT"
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$SHAREPOINT'
}

root@raspberrypi:~# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: The description string for service '"MSSQL$SHAREPOINT"' on host 'SERV010' contains one or more illegal characters.
Checked 238 services.
Checked 6 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 6 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.


##########Single Quotes Test###################

define service{
use generic-service
host_name SERV010
service_description 'MSSQL$SHAREPOINT'
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$SHAREPOINT'
}

root@raspberrypi:~# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: The description string for service ''MSSQL$SHAREPOINT'' on host 'SERV010' contains one or more illegal characters.
Checked 238 services.
Checked 6 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 6 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.


What am I missing here?
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

When I look at the Services on the Nagios Page

The status column has this MSSQL$SHAREPOINT$: Not found

It is adding a dollar $ sign on the end of the service

Why can I not add a service name that has a $ sign in its name?


Thoughts
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios illegal Characters in cfg file

Post by Box293 »

Make sure the service is define in CCM as follows:

Code: Select all

MSSQL\$$SHAREPOINT
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

Thanks for the reply

Tried that same results

define service{
use generic-service
host_name SERV010
service_description MSSQL\$$SHAREPOINT
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$SHAREPOINT'
}



root@raspberrypi:/# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: The description string for service 'MSSQL\$$SHAREPOINT' on host 'SERV010' contains one or more illegal characters.
Checked 314 services.
Checked 10 hosts.
Checked 3 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 10 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

root@raspberrypi:/#



Thoughts?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios illegal Characters in cfg file

Post by Box293 »

kwhogster wrote:define service{
use generic-service
host_name SERV010
service_description MSSQL\$$SHAREPOINT
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$SHAREPOINT'
}
As a test just call the service MSSQL SHAREPOINT

I would put the escaping in the check_command:

Code: Select all

define service{
use generic-service
host_name SERV010
service_description MSSQL SHAREPOINT
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL\$$SHAREPOINT'
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

WE getting close on this

The config did not error this time but in the



this is from the display a warning the service looks right not sure why the warning

MSSQL SHAREPOINT WARNING 10-26-2015 02:42:10 0d 0h 3m 2s 2/3 MSSQL$SHAREPOINT: Error


The Service

Name : MSSQL$SHAREPOINT
DisplayName : SQL Server (SHAREPOINT)
Status : Running
DependentServices : {SQLAgent$SHAREPOINT}
ServicesDependedOn : {}
CanPauseAndContinue : True
CanShutdown : True
CanStop : True
ServiceType : Win32OwnProcess


Thoughts
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios illegal Characters in cfg file

Post by Box293 »

What is the output from the command line?

Code: Select all

./check_nt -H xxx -P 12489 -v SERVICESTATE -d SHOWALL -l 'MSSQL\$$SHAREPOINT'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

Here is the output it did not like the -P 12489 had to remove it


root@raspberrypi:/usr/local/nagios/libexec# ./check_nt -H SERV010 -P 12489 -v SERVICESTATE -d SHOWALL -l 'MSSQL\$$SHAREPOINT'
./check_nt: invalid option -- 'P'
Usage:
check_nt -H host -v variable [-p port] [-w warning] [-c critical]
[-l params] [-d SHOWALL] [-u](DEPRECATED) [-t timeout]
root@raspberrypi:/usr/local/nagios/libexec# ./check_nt -H SERV010 -v SERVICESTATE -d SHOWALL -l 'MSSQL\$$SHAREPOINT'
CRITICAL - Socket timeout after 10 seconds
root@raspberrypi:/usr/local/nagios/libexec#


Thoughts


Update

changed to lower case -p

Now this
root@raspberrypi:/usr/local/nagios/libexec# ./check_nt -H SERV010 -p 12489 -v SERVICESTATE -d SHOWALL -l 'MSSQL\$$SHAREPOINT'
NSClient - ERROR: Invalid password.
root@raspberrypi:/usr/local/nagios/libexec#



Update

Forgot the password

now I get the same thing
root@raspberrypi:/usr/local/nagios/libexec# ./check_nt -H serv010 -p 12489 -s xxxxxxxx -v SERVICESTATE -d SHOWALL -l 'MSSQL\$$SHAREPOINT'
MSSQL\$$SHAREPOINT: Error
root@raspberrypi:/usr/local/nagios/libexec#




Thoughts



Update again


tried this too this worked

root@raspberrypi:/usr/local/nagios/libexec# ./check_nt -H SERV010 -p 12489 -s xxxxx -v SERVICESTATE -d SHOWALL -l 'MSSQL$SHAREPOINT'
MSSQL$SHAREPOINT: Started
root@raspberrypi:/usr/local/nagios/libexec#
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios illegal Characters in cfg file

Post by Box293 »

kwhogster wrote:tried this too this worked

root@raspberrypi:/usr/local/nagios/libexec# ./check_nt -H SERV010 -p 12489 -s xxxxx -v SERVICESTATE -d SHOWALL -l 'MSSQL$SHAREPOINT'
MSSQL$SHAREPOINT: Started
If you go back to your service definition and change it to 'MSSQL$SHAREPOINT' and restart Nagios does it work OK?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked