[hobbit] DESCR Info in Alerts

Henrik Stoerner henrik at hswn.dk
Wed Jan 24 23:09:57 CET 2007


On Wed, Jan 24, 2007 at 08:58:02AM -0500, Geoff Hallford wrote:

> I was wondering if there is anyway to change the default email alert
> contents to include the DESCR tag information for a host (without creating a
> custom alert script)? We have many support people who don't know what all of
> the hosts are for or if it goes down, what that means and I want to make it
> easier for them to know what is affected.

You'll either have to create a custom alert script, or tweak the
hobbitd/do_alert.c C code. If you choose the latter, then the
message_subject() and message_text() routines are the ones you're after;
you can get the DESCR tag with code like this:

    namelist_t *hinfo;
    char *descr;

    hinfo = hostinfo(alert->hostname);
    descr = bbh_item(hinfo, BBH_DESCRIPTION);

Note that this will return a NULL pointer if there is no DESCR tag for
this host.



Regards,
Henrik




More information about the Xymon mailing list