Xymon Mailing List Archive search

Auto Acknowledge alert

4 messages in this thread

list Russell Blumenthal · Mon, 6 Oct 2014 19:50:40 +0000 ·
Is there a way to get a link that when clicked it will auto acknowledge an alert (after the login) with a preset message/time?

What I would like to do, ideally, is have a script that emails out the information but also includes a link so that anyone that gets the email can acknowledge the alert just by clicking it.

Thanks
list John Thurston · Mon, 06 Oct 2014 12:57:32 -0800 ·
quoted from Russell Blumenthal
On 10/6/2014 11:50 AM, Blumenthal, Russell wrote:
Is there a way to get a link that when clicked it will auto acknowledge
an alert (after the login) with a preset message/time?

What I would like to do, ideally, is have a script that emails out the
information but also includes a link so that anyone that gets the email
can acknowledge the alert just by clicking it.
Well, acknowledge.sh is accessible in the xymon-seccgi path so you 
should be able to construct an appropriate URL to it. I quick sampling 
on my own server shows the following information is sent as a POST
DELAY_1=2&PERIOD_1=min&MESSAGE_1=foo&NUMBER_1=509331&HOSTNAME_1=bar.state.ak.us&TESTNAME_1=conn&Send_1=Send
The questions are, where does the NUMBER value come from, and will a GET 
work (or must you POST)?

There is also xymon-mailack which might meet your needs.
DESCRIPTION
xymon-mailack normally runs as an input mail-filter for the xymon user, e.g. by being called from the xymon users' procmailrc(5) file. xymon-mailack recognizes e-mails that are replies to xymond_alert(8) mail alerts, and converts the reply mail into an acknowledge message that is sent to the Xymon system. This permits an administrator to acknowledge an alert via e-mail.

-- 
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska
list Ralph Mitchell · Mon, 6 Oct 2014 22:23:18 -0400 ·
The NUMBER value is the ack cookie value that is put in the subject of
alert emails.  If you configure alerts.cfg with SCRIPTs to process alerts,
the cookie value is handed in via the ACKCODE environment variable.

You'll need to make sure you pick up the most recent cookie value for any
given alert, as each one overrides the previous cookie.  If you're sending
out email alerts, make sure that the subject reads:

   Xymon [NUMBER] yadda yadda bling

as the xymon-mailack program looks for "Xymon [....] and extracts the
NUMBER cookie value to post the acknowledgement.

Ralph Mitchell


On Mon, Oct 6, 2014 at 4:57 PM, John Thurston <user-ce4d79d99bab@xymon.invalid>
quoted from John Thurston
wrote:
On 10/6/2014 11:50 AM, Blumenthal, Russell wrote:
Is there a way to get a link that when clicked it will auto acknowledge
an alert (after the login) with a preset message/time?

What I would like to do, ideally, is have a script that emails out the
information but also includes a link so that anyone that gets the email
can acknowledge the alert just by clicking it.
Well, acknowledge.sh is accessible in the xymon-seccgi path so you should
be able to construct an appropriate URL to it. I quick sampling on my own
server shows the following information is sent as a POST

 DELAY_1=2&PERIOD_1=min&MESSAGE_1=foo&NUMBER_1=509331&HOSTNAME_1=
bar.state.ak.us&TESTNAME_1=conn&Send_1=Send
quoted from John Thurston
The questions are, where does the NUMBER value come from, and will a GET
work (or must you POST)?

There is also xymon-mailack which might meet your needs.
DESCRIPTION
xymon-mailack normally runs as an input mail-filter for the xymon user,
e.g. by being called from the xymon users' procmailrc(5) file.
xymon-mailack recognizes e-mails that are replies to xymond_alert(8) mail
alerts, and converts the reply mail into an acknowledge message that is
sent to the Xymon system. This permits an administrator to acknowledge an
alert via e-mail.
--
   Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska

list Russell Blumenthal · Wed, 8 Oct 2014 14:35:25 +0000 ·
Thanks, I edited an html email script and included this line in it:

"http://$BBSERVERWWWNAME/xymon-seccgi/acknowledge.sh?DELAY_1=120&PERIOD_1=min&MESSAGE_1=Acknowledged&NUMBER_1=$ACKCODE&HOSTNAME_1=$BBHOSTNAME&TESTNAME_1=$BBSVCNAME&SEND_1=Send";;

However, when I click it in the email, it only brings me to the acknowledge page. Am I missing something to get it to acknowledge the specific host/test by using a link?
quoted from Ralph Mitchell


From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Ralph Mitchell
Sent: Monday, October 06, 2014 10:23 PM
To: John Thurston
Cc: xymon at xymon.com
Subject: Re: [Xymon] Auto Acknowledge alert

The NUMBER value is the ack cookie value that is put in the subject of alert emails.  If you configure alerts.cfg with SCRIPTs to process alerts, the cookie value is handed in via the ACKCODE environment variable.

You'll need to make sure you pick up the most recent cookie value for any given alert, as each one overrides the previous cookie.  If you're sending out email alerts, make sure that the subject reads:

   Xymon [NUMBER] yadda yadda bling

as the xymon-mailack program looks for "Xymon [....] and extracts the NUMBER cookie value to post the acknowledgement.

Ralph Mitchell


On Mon, Oct 6, 2014 at 4:57 PM, John Thurston <user-ce4d79d99bab@xymon.invalid<mailto:user-ce4d79d99bab@xymon.invalid>> wrote:
On 10/6/2014 11:50 AM, Blumenthal, Russell wrote:
Is there a way to get a link that when clicked it will auto acknowledge
an alert (after the login) with a preset message/time?

What I would like to do, ideally, is have a script that emails out the
information but also includes a link so that anyone that gets the email
can acknowledge the alert just by clicking it.

Well, acknowledge.sh is accessible in the xymon-seccgi path so you should be able to construct an appropriate URL to it. I quick sampling on my own server shows the following information is sent as a POST

DELAY_1=2&PERIOD_1=min&MESSAGE_1=foo&NUMBER_1=509331&HOSTNAME_1=bar.state.ak.us<http://bar.state.ak.us>&TESTNAME_1=conn&Send_1=Send
quoted from Ralph Mitchell

The questions are, where does the NUMBER value come from, and will a GET work (or must you POST)?

There is also xymon-mailack which might meet your needs.
DESCRIPTION
xymon-mailack normally runs as an input mail-filter for the xymon user, e.g. by being called from the xymon users' procmailrc(5) file. xymon-mailack recognizes e-mails that are replies to xymond_alert(8) mail alerts, and converts the reply mail into an acknowledge message that is sent to the Xymon system. This permits an administrator to acknowledge an alert via e-mail.


--
   Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX<tel:XXX-XXX-XXXX>
user-ce4d79d99bab@xymon.invalid<mailto:user-ce4d79d99bab@xymon.invalid>
Enterprise Technology Services
Department of Administration
State of Alaska