Xymon Mailing List Archive search

Hobbit-mailack

list Geoff Hallford
Thu, 22 Jul 2010 13:53:32 -0400
Message-Id: <user-a939e986f5dc@xymon.invalid>

Thank you very much. I don't want to really mess with the code itself. I
fixed it by filtering it through sed in my procmailrc file. For anyone else
that is interested, here is the scenario:

My alert subject: "ALERT: [$ACKCODE] $BBHOSTNAME - $SERVICE"
Hobbit expects: "Hobbit [$ACKCODE] ......"

The contents of my ~/.procmailrc file to make hobbit-mailack accept the
acknowledgement (until the code is changed):

DEFAULT=$HOME/Mailbox
LOGFILE=$HOME/procmail.log
:0
| sed -e s/"ALERT: "/"Hobbit "/ | $HOME/server/bin/hobbit-mailack
--env=$HOME/server/etc/hobbitserver.cfg


On Thu, Jul 22, 2010 at 11:37 AM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Thu, Jul 22, 2010 at 11:16 AM, Geoff Hallford
<user-dc9e7f30b1e2@xymon.invalid> wrote:
Hi All,

Does anyone know of a way to allow my custom email alerts to be used with
hobbit-mailack? Currently, the only way to get Xymon 4.3.0-0 beta 2 to
acknowledge an alert via email reply is for the subject line to start
with
"Hobbit [$ACKCODE]". My alerts start off with either "ALERT:" or
"RECOVERED:" and not matter where I put the $ACKCODE, it only works if
you
do it as "Hobbit [$ACKCODE]".
You just have to modify few lines starting here, excerpted from
hobbitd/hobbit-mailack.c

 98         /* Get the alert cookie */
 99         subjexp = pcre_compile(".*(Hobbit|BB)[ -]*
\\[*(-*[0-9]+)[\\]!]*", PCRE_CASELESS, &errmsg, &errofs, NULL);
100         if (subjexp == NULL) {
101                 dbgprintf("pcre compile failed - 1\n");
102                 return 2;
103         }

So it is really pcre match. Then make clean; make and then save your
old hobbit-mailack and
replace it your new hobbit-mailack
I think there should be something in the hobbitserver.cfg to allow people
to
change this, as we are supposed to be able to customize our alerting and
this breaks mailack.

Any thoughts?

Thanks.

P.S. I can't develop in C.

Geoff.
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?