[hobbit] Using SCRIPT

Henrik Stoerner henrik at hswn.dk
Mon Apr 18 23:26:15 CEST 2005


On Mon, Apr 18, 2005 at 12:19:46PM -0500, Paul D. Backer wrote:

> BB would include the URL of the test that caused the alert in the
>  BBALPHAMSG environment variable.  Could this be added to hobbit.
> 
> FYI - the BBCOLORLEVEL environment variable isn't listed in the
>  on-line documentation
>  (http://www.hswn.dk/hobbit/help/hobbit-alerts.html#scripts).

Thanks, the attached patch should fix both issues. Save it to a file,
then

   cd hobbit-4.0.2
   patch -p0 </tmp/hobbit-4.0.2-alertscript.patch
   make

Shutdown hobbit, run "make install" as root, and restart hobbit.


Regards,
Henrik
-------------- next part --------------
--- hobbitd/do_alert.c	2005/03/27 06:58:46	1.60
+++ hobbitd/do_alert.c	2005/04/18 21:20:37
@@ -1203,6 +1203,10 @@
 		addtobuffer(&buf, &buflen, info);
 		addtobuffer(&buf, &buflen, msg_data(alert->pagemessage));
 		addtobuffer(&buf, &buflen, "\n");
+		sprintf(info, "See %s%s/bb-hostsvc.sh?HOSTSVC=%s.%s\n", 
+			xgetenv("BBWEBHOST"), xgetenv("CGIBINURL"), 
+			commafy(alert->hostname->name), alert->testname->name);
+		addtobuffer(&buf, &buflen, info);
 		MEMUNDEFINE(info);
 		return buf;
 
--- docs/hobbit-alerts.html	2005/02/15 12:57:33	1.6
+++ docs/hobbit-alerts.html	2005/04/18 21:22:28
@@ -146,6 +146,7 @@
 BBALPHSMSG variable for the script.</p>
 <p>The full list of environment variables provided to scripts are as follows:</p>
 <table width="80%" align="center" summary="Paging script environment variables">
+	<tr><th align="left" valign="top">BBCOLORLEVEL</th><td>The current color of the status</td></tr>
 	<tr><th align="left" valign="top">BBALPHAMSG</th><td>The full text of the status log triggering the alert</td></tr>
 	<tr><th align="left" valign="top">ACKCODE</th><td>The "cookie" that can be used to acknowledge the alert</td></tr>
 	<tr><th align="left" valign="top">RCPT</th><td>The recipient, from the SCRIPT entry</td></tr>


More information about the Xymon mailing list