[icinga-checkins] icinga.org: icinga-core/master: classic ui: add commands expander to config display (Jochen Bern)

git at icinga.org git at icinga.org
Thu Sep 2 12:47:34 CEST 2010

Module: icinga-core
Branch: master
Commit: 481ec97fc30e8217e26786f50cf7fc338eb3cbdd
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=481ec97fc30e8217e26786f50cf7fc338eb3cbdd

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Fri Aug 27 18:36:09 2010 +0200

classic ui: add commands expander to config display (Jochen Bern)

$ARGn$ substitution will be shown between command_line and
check_command associated for hosts, services, etc and help
getting to know/use commands the core will execute.


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. I.e., if your config reads

define command{
    command_name    check-host-alive
    command_line    $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$
                -c $ARG2$ -n $ARG3$
define host{
    host_name    TestBox
    check_command    check-host-alive!3000.0,80%!5000.0,100%

and you click the link "check-host-alive!3000.0,80%!5000.0,100%" in
TestBox's line in the list of host configurations, rather than jumping
into the middle of an unannotated list of commands, you get a page saying:

To expand:        check-host-alive!3000.0,80%!5000.0,100%
check-host-alive    $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$
            -c $ARG2$ -n $ARG3$
        ->    $USER1$/check_icmp -H $HOSTADDRESS$ -w
            3000.0,80% -c 5000.0,100% -n (undefined/empty)

complete with <FONT COLOR=>-based visual aids.

-- 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

-- Removed a blob of superseded code
-- Changed the "(undefined/empty)" non(!)-error from #F00 to #00F
-- Explicit message when command_name is undefined
-- Text input field to enter/modify the command on the fly, hence ...
-- ... now listed in top right <SELECT> for direct access, too
-- For all other modes, added an <INPUT> to the <FORM> to manually
   narrow down the listings


reworked into Icinga's code.

refs #746


 Changelog    |    4 +
 cgi/config.c |  371 ++++++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 303 insertions(+), 72 deletions(-)

Diff:   https://git.icinga.org/?p=icinga-core.git;a=commitdiff;h=481ec97fc30e8217e26786f50cf7fc338eb3cbdd

More information about the icinga-checkins mailing list