Customize "service detail" page

Jim Avery jim at jimavery.me.uk
Wed Apr 15 18:24:02 CEST 2009


2009/4/15  <borkmann at cbs.mpg.de>:
> hi all,
>
> is there a possibility to customize the service detail page of nagios?
>
> i think about adding one column to the table that calls my perl script
> and prints the specific output to the cell.
> the call-parameters for my perl script need to be host and service from
> the current table line.
>
> would this be possible?
>
> best regards
> daniel

I've heard of people achieving something similar by running the
service plugin through a wrapper which prepends the relevant string to
the normal plugin output.  I can't say I've ever tried it myself
though.

As an example, instead of the normal check command:

  define command{
          command_name    check_ftp
          command_line    $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
          }

You could have a wrapper script which prints the output of your perl
script (with no newline) then runs the command proper.  Depending on
how you write the wrapper script (I'll leave that to your
imagination), the command definition might then look something like:

  define command{
          command_name    check_ftp
          command_line    /usr/local/bin/my_wrapper.pl -c
$USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
          }

Your perl output wouldn't appear in a seperate column as such, but at
least it would appear on the normal service detail page where you can
see it.

It's a bit dirty, but if you only need it for a small number of checks
might be a quick way to get it done.

Cheers,

Jim

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-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