negate command

Voon, Ton Ton.Voon at egg.com
Wed May 14 13:31:58 CEST 2003


Quick examples:

$ /usr/nagios/libexec/negate "/usr/nagios/libexec/check_ping -H macker"
This will be evaluated by the shell so arg 1 for negate is the whole string.
Replacing double quotes with single quotes makes no difference as the shell
considers the contents in this case the same.

$ /usr/nagios/libexec/negate "/usr/bin/grep 'a b' /etc/hosts"
The single quotes will get passed into arg1, and then negate will run a new
shell with this command. The new shell will evaluate the single quotes and
preserve the space for grep to search.

$ /usr/nagios/libexec/negate '/usr/bin/grep "a b" /etc/hosts'
The shell preserves the double quotes and passes it to arg1. However, negate
will reject it because of the existence of double quotes in the command.

You just need to be aware of the double evaluation going on if you use
quotes within your command. Otherwise the outer quotes make no difference to
negate.

Ton

> -----Original Message-----
> From:	Karl DeBisschop [SMTP:karl at debisschop.net]
> Sent:	Wednesday, May 14, 2003 11:49 AM
> To:	Matthias Eichler
> Cc:	Lionel Verscheure; Nagios Users
> Subject:	Re: [Nagios-users] negate command
> 
> On Wed, 2003-05-14 at 06:14, Matthias Eichler wrote:
> > Just try quotes:
> > 
> > /usr/nagios/libexec/negate "/usr/nagios/libexec/check_ping -H macker/"
> 
> Or get the plugin frmo CVS.
> 
> BTW, not sure, but I think you may need to use single quotes, not
> double.


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.



-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list