external notification commands

Josh Yost Josh.Yost at epsiia.com
Tue Jan 23 20:48:34 CET 2007


Brian Loe wrote:
> On 1/23/07, Marc Powell <marc at ena.com> wrote:
>> If the notification is being called but you don't see what you expect in
>> your notification script, echo the command that nagios is running to a
>> file to see if it's what you think it's supposed to be --
>>
>> define command {
>>     command_name                   my_special_notification
>>     command_line                   echo "$USER1$/my-notification-script
>> $SOMEMACRO$ $SOMEOTHERMACRO$" >> /tmp/nagios-runs-me
>>     }
>>
>> After nagios calls 'my_special_notification', the file
>> /tmp/nagios-runs-me will contain the full command line that nagios
>> _would_ have executed if it had really run the command.
>>
> 
> 
> Doing what you suggest I see that it IS running the notification,
> except that the quotation marks are lost (which my external app
> actually needs  - so maybe I can double them up?) and none of the
> variables have been filled in within the quotes that are there
> (perhaps because it was an echo, and the echo command wiill take
> anything with quotes as strings?).

Hi,

You should be able to backslash the quotes you need it to print:
$ echo "\"hi\""

I'm not sure where above you would want them, maybe something like
\"$SOMEMACRO$\" \"$SOMEOTHERMACRO$\" ?

- Josh

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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