LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-28-2009, 06:28 AM   #1
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Rep: Reputation: 17
Nagios: Illegal characters in config file


Hi,

I have made a nagios config file to monitor one of our servers which runs an instance of MS SQL. When verifying the config file i get the following message:
  • The description string for service MSSQL$MCAFEEDLPREPORTS on host 'Test' contains one or more illegal characters.

The Nagios documentation says that the $-sign is an illegal character, but it does not say how to solve this issue (or i accidentally skipped that part).

I tried the following methods to escape the illegal character:
  • 'MSSQL$MCAFEEDLPREPORTS'
  • 'MSSQL$$MCAFEEDLPREPORTS'
  • MSSQL\$MCAFEEDLPREPORTS
  • MSSQL"$$"MCAFEEDLPREPORTS

All help to solve this little inconvenience will be appreciated.
 
Old 10-28-2009, 07:44 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Escape the dollar sign AND put quotes around the whole thing.

"MSSQL\$MCAFEEDLPREPORTS"

This works for me on the services where I have MSSQL$...
 
Old 10-28-2009, 08:10 AM   #3
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Original Poster
Rep: Reputation: 17
I tried "MSSQL\$MCAFEEDLPREPORTS" but it does not do the trick. Still got the same error.
 
Old 10-28-2009, 08:34 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Get the entire line from your services.cfg that contains the MSSQL$ and post it.

It should start with a command. Verify that command is defined appropriately (e.g. in checkcommands.cfg or commands.cfg). In mine I'm passing it in as $ARG$. Post that as well.
 
Old 10-28-2009, 09:41 AM   #5
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Original Poster
Rep: Reputation: 17
Below is the only part in the cfg file i use to monitor the sql server. I have nothing configured in the command.cfg or any other cfg file.

define service{
use generic-service
host_name TEST
service_description "MSSQL\$MCAFEEDLPREPORTS"
check_command check_nt!SERVICESTATE!-d SHOWALL -l "MSSQL\$MCAFEEDLPREPORTS"
}
 
Old 10-28-2009, 12:10 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
There are default things configured in commands.cfg e.g.:
# 'check_nt' command definition
Code:
define command{
        command_name    check_nt
        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
When you do "check_command check_nt" you're telling it to get the check_nt definition from the commands.cfg (later Nagios) or check_commands.cfg (earlier Nagios).

Your definition in whatever config you're using (services.cfg, windows.cfg?) is:
Code:
define service{
use generic-service
host_name TEST
service_description "MSSQL\$MCAFEEDLPREPORTS"
check_command check_nt!SERVICESTATE!-d SHOWALL -l "MSSQL\$MCAFEEDLPREPORTS"
}
Which is calling the check_nt defined in commands.cfg.

We do it slightly different here because we defined a check_nt_service command in commands.cfg so the "SERVICESTATE!-d SHOWALL -l" is there rather than services.cfg and in services.cfg we just call check_nt_service with the argument in quotes and escaped as I said.

In your syntax $ARG2$ is actually -d SHOWALL -l "MSSQL\$MCAFEEDLPREPORTS" so it might be worthwhile to remove the quotes I suggested and add quotes around all of it so it becomes:
"-d SHOWALL -l MSSQL\$MCAFEEDLPREPORTS"
It might also be necessary to put quotes around the whole thing and within like:
"-d SHOWALL -l "MSSQL\$MCAFEEDLPREPORTS""
 
Old 10-29-2009, 06:28 AM   #7
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Original Poster
Rep: Reputation: 17
I verified that my command.cfg has an entry for check_nt (it looks the same as your include check_nt).

I both used "-d SHOWALL -l MSSQL\$MCAFEEDLPREPORTS" and "-d SHOWALL -l "MSSQL\$MCAFEEDLPREPORTS"" as the second argument, but still receive the same error.

After that i changed service_description "MSSQL\$MCAFEEDLPREPORTS" to service_description MSSQLMCAFEEDLPREPORTS and checked for configuration errors again. This time i did not receive any errors or warnings. It looks like service_description is causing the error.

Eventually got it working. I my case i had to do the following:
-i removed the illegal character ($-sign) in the service_description line
-i change the check_nt line to: check_command check_nt!SERVICESTATE!-d SHOWALL -l MSSQL"$$"MCAFEEDLPREPORTS

Last edited by TalkingMarble; 10-29-2009 at 08:17 AM.
 
Old 10-29-2009, 07:35 AM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Thanks for posting your solution.

On checking mine I saw I never had a $ in the service description so it never even occurred to me that this might be your problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios config ? MikeFoo1 Linux - Networking 15 01-18-2013 06:26 AM
Config issue check_oracle_health with nagios micho1978 Linux - Software 2 07-29-2009 11:59 PM
configuring nagios config files Mangenius Linux - Software 2 01-04-2007 10:47 AM
Converting Netsaint config to Nagios! dunkyb Linux - Software 2 07-20-2006 08:31 AM
Problems with nagios config ignus Linux - Software 4 07-26-2005 08:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration