Solved

How to define a command in nagios with special characters

Posted on 2012-12-27
2
5,741 Views
Last Modified: 2013-01-02
I have been trying to define a command in nagios with the command name including special characters like <<CheckFileSize>>. The problem is when I am running pre-flight check on configuration data it gives me error as below

Checking commands...
Error: The name of command '<<CheckFileSize>>" contains one or more illegal characters.
        Checked 32 commands.

command definition:
++++++++++++++++++
define command {
  command_name  <<CheckFileSize>>
  command_line  check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckFileSize -a ShowAll MinWarn=$ARG2$  MinCrit=$ARG1$ File=c:/pagefile.sys
}
0
Comment
Question by:abhinav4
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Assisted Solution

by:Kamaraj Subramanian
Kamaraj Subramanian earned 250 total points
ID: 38726270
you need to escape the special characters.

use back slash \ to escape the special characters
0
 
LVL 10

Accepted Solution

by:
ienaxxx earned 250 total points
ID: 38726289
Hi abhinav4,
 itkamaraj is right telling u to escape, but there are some special considerations to keep in mind.

To escape a $ sign, the procedure is different.
http://www.krenger.ch/blog/nagios-escape-dollar-character/

To escape in a command specification keep in mind you should escape twice since the first escape is for Nagios and the second is for the command.
http://www.mail-archive.com/nagios-users@lists.sourceforge.net/msg25694.html


With that knowledge you should be ready to start with nagios cfg files with special chars.

HTH
Bye!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question