Bug and (loosely related) patch: Nagios 3.2.1 config.cgi, commands with $ARGs$

Jochen Bern Jochen.Bern at LINworks.de
Wed Aug 25 13:58:39 CEST 2010


On 08/24/2010 11:30 PM, Jochen Bern wrote:
> Having that said, and after seeing too many people unable to do $ARGn$
> substitution correctly in their head or with pen and paper, I wrote a
> patch for config.c which makes the links display the appropriate
> "expansion" right away.

Update:
-- Improved Command Expansion
   -- Non-$ARGn$ macros and $$'s are now color coded, too
   -- Better coverage of error cases
-- Reused expand= parameter to add functionality to other display_*()s'
   output (mostly "list only object with that name", but services and
   service dependencies match *host* names, for decently-sized lists)
-- Changed a bunch of hyperlinks so as to use that functionality

(From a debugging perspective, the best approach would IMHO be to have
expand-to-execute and expand-to-inspect done by the *exact same* macro
handling functions. However, the preexisting macro expanders don't have
a debug mode, and config.cgi would need to do a *lot* of majick to get a
reasonable list of $HOST*$ and $SERVICE*$ macros' values for a full
expansion, so that's rather unlikely to happen ...)

Kind regards,
								J. Bern
-- 
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nagios-3.2.1-CommandExpand-patch.txt
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20100825/dda1d67a/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CommandExpansion2.png
Type: image/png
Size: 30028 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20100825/dda1d67a/attachment.png>
-------------- next part --------------
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list