[Nagiosplug-devel] Bug in MACRO passing to event handlers ?

Subhendu Ghosh sghosh at sghosh.org
Thu Aug 22 10:30:04 CEST 2002


The macros are expanded by Nagios - not the plugins.  But I think the 
space issue still exist.

-sg

On Thu, 22 Aug 2002, Jan David wrote:

> Hi,
> 
> I've been working on a bunch of Oracle plugins and eventhandlers and came
> across a bug which I'd like to share with all of you. I've checked the FAQ
> and other resources and didn't find anything - so I believe it is relevant.
> 
> First off all, I'm still using Netsaint 0.0.7 for my production
> environment, but the problem very likely persists in Nagios aswell. Maybe
> someone would care to check this ?
> 
> Here it is:
> 
> If you have defined a service with a name that has spaces in it, then the
> $SERVICEDESC$ macro will not get passed through correctly to an event
> handler.
> 
> Example:
> --------------
> 
> Suppose we have the following line in hosts.cfg:
> 
> service[unix-machine]=ORA FREESPACE;0;24x7;1;60;30;oracle-admins;240;24x7;1;1;0;event-oracle-freespace;check-oracle-freespace
> 
> and the following line in commands.cfg
> 
> command[event-oracle-freespace]=$USER2$/event_oracle_freespace $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$ $HOSTNAME$ $SERVICEDESC$
> 
> When the service check is performed and a state change occurs, the event handler is executed. As you can see from the line above, it expects 5
> arguments. One of them
> is the service description $SERVICEDESC$ which is derived from the definition in the service line.
> 
> The macro $SERVICEDESC$ should pass the value 'ORA FREESPACE' to the eventhandler, but in reality only 'ORA' is passed on. This causes some problems
> because I
> want to automatically log a comment to the comments file using the ADD_SVC_COMMENT external command. This extranal command requires the 'correct'
> service description
> in order to work.
> 
> I solved the problem by not using whitespace in service descriptions.
> 
> Either this is a bug OR is should be mentioned in the documentation that one is not allowed to use whitespace in service descriptions.
> 
> Regards,
> 
> J. David
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone?  Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> Nagiosplug-devel mailing list
> Nagiosplug-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> 

-- 






More information about the Devel mailing list