Xymon Mailing List Archive search

mailack question

18 messages in this thread

list Kevin Grady · Fri, 1 Apr 2005 09:34:02 -0500 ·
So I finally switched over from using the bb mail ack script to using
hobbit-mailack and it works great. One question is the syntax for
specifying different durations for the ack. I checked the man page but
it only discusses the setup. What is the syntax for feeding hobbit a
delay different from the default?

Thanks
list Henrik Størner · Fri, 1 Apr 2005 16:49:19 +0200 ·
quoted from Kevin Grady
On Fri, Apr 01, 2005 at 09:34:02AM -0500, Kevin Grady wrote:
So I finally switched over from using the bb mail ack script to using
hobbit-mailack and it works great. One question is the syntax for
specifying different durations for the ack. I checked the man page but
it only discusses the setup. What is the syntax for feeding hobbit a
delay different from the default?
Yeah, that should be in the man-page.

It's the same as the bb-mailack script, i.e. add "delay=60m" to the
subject of the reply-message for a 60 minute delay.

You can also add a one-line acknowledgement text - "power supply
broken, new one arrives 3:25 PM" - by putting it in the first line of
the mail reply.


Henrik
list Allan Spencer · Thu, 26 Jun 2008 10:44:28 +1000 ·
HI all

A LONG time ago I asked about ack'ing an alert via email (or via sms-to-email) and to be able to do so without a subject. A patch was written at the time and it was included into the main codebase but unfortunately I did not get a chance to imeplement what I wanted to and never ended up testing it. Thats has just changed recently and now I am having issues acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I try cut the subject and paste it as the body nothing happens. I havent gone as far as testing it via the sms-to-email app yet as I cant get it working from a normal email.

I still have one other potential problem of me converting the [] in the alerts to () but thats more outbound sms and I can deal with it coming back inwards.

Any suggestions appreciated

Allan
list Allan Spencer · Wed, 09 Jul 2008 11:01:51 +1000 ·
Just thought I'd check back on this and surprised nobody had any thoughts on it but also notice Henrik hasn't been around either.

Still have had no luck with this although I have not been able to spend much time on it.

Still have the same problem of not being able to ack an alert via the email body instead of the subject.

Cheers
Allan
quoted from Allan Spencer

Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via sms-to-email) and to be able to do so without a subject. A patch was written at the time and it was included into the main codebase but unfortunately I did not get a chance to imeplement what I wanted to and never ended up testing it. Thats has just changed recently and now I am having issues acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I try cut the subject and paste it as the body nothing happens. I havent gone as far as testing it via the sms-to-email app yet as I cant get it working from a normal email.

I still have one other potential problem of me converting the [] in the alerts to () but thats more outbound sms and I can deal with it coming back inwards.

Any suggestions appreciated

Allan

list Josh Luthman · Wed, 9 Jul 2008 01:39:37 -0400 ·
In the mailing list archives look for subject: [hobbit] Ack Alerts via Email

and you'll find...

There's already a feature in Hobbit to accept ACKs via email:

    http://www.hswn.dk/hobbit/help/manpages/man8/hobbit-mailack.8.html

Or did you mean something else??

Ralph Mitchell

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX

Those who don't understand UNIX are condemned to reinvent it, poorly.
--- Henry Spencer
quoted from Allan Spencer

On Tue, Jul 8, 2008 at 9:01 PM, Allan Spencer <user-42a3456c44ef@xymon.invalid> wrote:
Just thought I'd check back on this and surprised nobody had any thoughts
on it but also notice Henrik hasn't been around either.

Still have had no luck with this although I have not been able to spend
much time on it.

Still have the same problem of not being able to ack an alert via the email
body instead of the subject.

Cheers
Allan


Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A patch was written
at the time and it was included into the main codebase but unfortunately I
did not get a chance to imeplement what I wanted to and never ended up
testing it. Thats has just changed recently and now I am having issues
acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I try
cut the subject and paste it as the body nothing happens. I havent gone as
far as testing it via the sms-to-email app yet as I cant get it working from
a normal email.

I still have one other potential problem of me converting the [] in the
alerts to () but thats more outbound sms and I can deal with it coming back
inwards.

Any suggestions appreciated

Allan

list Phil Wild · Wed, 9 Jul 2008 14:50:45 +0800 ·
Is there a method of ack'ing alerts via the command line?

I know you can enable/disable an alert using the bb command. It kind of
seems silly to receive an sms and then have to convert it to an email to
perform the ack. It would be much better to bypass the email gateway and
pump the ack directly into hobbitd. Has anyone done this?

My check of the man pages and quick search of the mailing list archive did
not seem to indicate a way...

Phil

2008/7/9 Josh Luthman <user-4c45a83f15cb@xymon.invalid>:
quoted from Josh Luthman
In the mailing list archives look for subject: [hobbit] Ack Alerts via
Email

and you'll find...

There's already a feature in Hobbit to accept ACKs via email:

    http://www.hswn.dk/hobbit/help/manpages/man8/hobbit-mailack.8.html

Or did you mean something else??

Ralph Mitchell

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX

Those who don't understand UNIX are condemned to reinvent it, poorly.
--- Henry Spencer

On Tue, Jul 8, 2008 at 9:01 PM, Allan Spencer <user-42a3456c44ef@xymon.invalid> wrote:
Just thought I'd check back on this and surprised nobody had any thoughts
on it but also notice Henrik hasn't been around either.

Still have had no luck with this although I have not been able to spend
much time on it.

Still have the same problem of not being able to ack an alert via the
email body instead of the subject.

Cheers
Allan


Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A patch was written
at the time and it was included into the main codebase but unfortunately I
did not get a chance to imeplement what I wanted to and never ended up
testing it. Thats has just changed recently and now I am having issues
acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I try
cut the subject and paste it as the body nothing happens. I havent gone as
far as testing it via the sms-to-email app yet as I cant get it working from
a normal email.

I still have one other potential problem of me converting the [] in the
alerts to () but thats more outbound sms and I can deal with it coming back
inwards.

Any suggestions appreciated

Allan

-- 

Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid
list Martin Ward · Wed, 9 Jul 2008 10:10:20 +0100 ·
I can offer a suggestion but this is only an idea I have just had, it's
not been tried, tested or anything. Also bear in mind that I had no idea
that you could acknowledge an alert via email... This suggestion might
bugger that up in some unforeseen manner.

Could you install something like procmail? I see it working like this:
1. An email gets sent to you.
2. You reply to it with the acknowledgement in the text body as you have
stated.
3. This reply gets picked up by procmail before it reaches Hobbit (maybe
change the Reply-To in the original email to route it to a different
address).
4. Procmail decides that it should process this email (there are various
tests that can be performed) and calls a script, passing the body of the
email (and the subject?) to it.
5. The script munges the email so that the Subject line is made from the
text in the body of the email.
6. Script forwards to email on to its original destination.

I can immediately see flaws in this. You're replying on another piece of
s/w. You've got to make sure that the matching format works. If you want
to use the say return address then you need to ensure that email flows
from procmail to the Hobbit receiver. I'm sure there are others.

Still, it's one solution.

|\/|artin
quoted from Allan Spencer
-- 

-----Original Message-----
From: Allan Spencer [mailto:user-42a3456c44ef@xymon.invalid] Sent: 09 July 2008 02:02
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] mailack question


Just thought I'd check back on this and surprised nobody had any thoughts on it but also notice Henrik hasn't been around either.

Still have had no luck with this although I have not been able to spend much time on it.

Still have the same problem of not being able to ack an alert via the email body instead of the subject.

Cheers
Allan

Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A patch was > written at the time and it was included into the main codebase but > unfortunately I did not get a chance to imeplement what I wanted to > and never ended up testing it. Thats has just changed recently and now > I am having issues acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I
try cut the subject and paste it as the body nothing happens. I havent > gone as far as testing it via the sms-to-email app yet as I cant get > it working from a normal email.

I still have one other potential problem of me converting the [] in
the alerts to () but thats more outbound sms and I can deal with it > coming back inwards.

Any suggestions appreciated

Allan
*************************************************************************************

The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way. 
The contents of this message and its attachments are confidential and may also be subject to legal privilege.  If you are not the named addressee and/or have received this message in error, please advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any attachments without retaining any copies. 
Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses. 
No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.  
Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900.
list Phil Wild · Wed, 9 Jul 2008 17:22:39 +0800 ·
I was thinking of looking through the mail-ack c code tonight. I am not a C
programmer at all, but it may be not all that hard to convert mail-ack to
just commandline-ack

Then you could write your own little wrapper to extract what you want from
the sms stream and pump it into hobbit.

I just spent an hour trying to fudge the cgi script bb-ack.sh to do the
above but could not get it to work properly - not a very nice soln though as
stdout from bb-ack is a heap of html as opposed to a nice clean exit status
etc.

Thoughts???

Phil

2008/7/9 Ward, Martin <user-2d33a6eb6a05@xymon.invalid>:
quoted from Martin Ward
I can offer a suggestion but this is only an idea I have just had, it's
not been tried, tested or anything. Also bear in mind that I had no idea
that you could acknowledge an alert via email... This suggestion might
bugger that up in some unforeseen manner.

Could you install something like procmail? I see it working like this:
1. An email gets sent to you.
2. You reply to it with the acknowledgement in the text body as you have
stated.
3. This reply gets picked up by procmail before it reaches Hobbit (maybe
change the Reply-To in the original email to route it to a different
address).
4. Procmail decides that it should process this email (there are various
tests that can be performed) and calls a script, passing the body of the
email (and the subject?) to it.
5. The script munges the email so that the Subject line is made from the
text in the body of the email.
6. Script forwards to email on to its original destination.

I can immediately see flaws in this. You're replying on another piece of
s/w. You've got to make sure that the matching format works. If you want
to use the say return address then you need to ensure that email flows
from procmail to the Hobbit receiver. I'm sure there are others.

Still, it's one solution.

|\/|artin
--

-----Original Message-----
From: Allan Spencer [mailto:user-42a3456c44ef@xymon.invalid]
Sent: 09 July 2008 02:02
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] mailack question


Just thought I'd check back on this and surprised nobody had any
thoughts on it but also notice Henrik hasn't been around either.

Still have had no luck with this although I have not been
able to spend
much time on it.

Still have the same problem of not being able to ack an alert via the
email body instead of the subject.

Cheers
Allan

Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A
patch was
written at the time and it was included into the main codebase but
unfortunately I did not get a chance to imeplement what I wanted to
and never ended up testing it. Thats has just changed
recently and now
I am having issues acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I
try cut the subject and paste it as the body nothing
happens. I havent
gone as far as testing it via the sms-to-email app yet as I
cant get
it working from a normal email.

I still have one other potential problem of me converting the [] in
the alerts to () but thats more outbound sms and I can deal with it
coming back inwards.

Any suggestions appreciated

Allan

*************************************************************************************
The message is intended for the named addressee only and may not be
disclosed to or used by anyone else, nor may it be copied in any way.

The contents of this message and its attachments are confidential and may
also be subject to legal privilege.  If you are not the named addressee
and/or have received this message in error, please advise us by e-mailing
user-61c7f445d564@xymon.invalid and delete the message and any attachments without
retaining any copies.

Internet communications are not secure and COLT does not accept
responsibility for this message, its contents nor responsibility for any
viruses.

No contracts can be created or varied on behalf of COLT Telecommunications,
its subsidiaries or affiliates ("COLT") and any other party by email
Communications unless expressly agreed in writing with such other party.

Please note that incoming emails will be automatically scanned to eliminate
potential viruses and unsolicited promotional emails. For more information
refer to www.colt.net or contact us on +44(0)20 7390 3900.

-- 
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid
list Martin Ward · Wed, 9 Jul 2008 10:28:00 +0100 ·
Ah, it becomes clearer now!

With the suggestions from Phil Wild and Josh Luthman (and reading the
man page for hobbit-mailack) it seems that you are expected to use
procmail to use this program.

Phil, what you suggested seems to be just what Hobbit-mailack does,
receives the email and runs a program against its data.

Instead of using the procmail(1m) recipe suggested in the Hobbit-mailack
man page, you would need one like this:
====
DEFAULT=$HOME/Mailbox
LOGFILE=$HOME/procmail.log
:0
| $HOME/server/bin/hobbit/reformat_mailack
====
Your "reformat_mailack" script would need to rewrite the body text into
the subject line, then simply echo the data to the hobbit-mailack
command. Writing this linking script shouldn't be that hard (perl would
be better than shell, but either could do it).
quoted from Phil Wild

-- 
-----Original Message-----
From: Ward, Martin [mailto:user-2d33a6eb6a05@xymon.invalid] Sent: 09 July 2008 10:10
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] mailack question


I can offer a suggestion but this is only an idea I have just had, it's not been tried, tested or anything. Also bear in mind that I had no idea that you could acknowledge an alert via email... This suggestion might bugger that up in some unforeseen manner.

Could you install something like procmail? I see it working like this: 1. An email gets sent to you. 2. You reply to it with the acknowledgement in the text body as you have stated. 3. This reply gets picked up by procmail before it reaches Hobbit (maybe change the Reply-To in the original email to route it to a different address). 4. Procmail decides that it should process this email (there are various tests that can be performed) and calls a script, passing the body of the email (and the subject?) to it. 5. The script munges the email so that the Subject line is made from the text in the body of the email. 6. Script forwards to email on to its original destination.

I can immediately see flaws in this. You're replying on another piece of s/w. You've got to make sure that the matching format works. If you want to use the say return address then you need to ensure that email flows from procmail to the Hobbit receiver. I'm sure there are others.

Still, it's one solution.

|\/|artin
-- 

-----Original Message-----
From: Allan Spencer [mailto:user-42a3456c44ef@xymon.invalid]
Sent: 09 July 2008 02:02
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] mailack question
Just thought I'd check back on this and surprised nobody had any
thoughts on it but also notice Henrik hasn't been around either.
Still have had no luck with this although I have not been
able to spend > much time on it.
Still have the same problem of not being able to ack an alert via the
email body instead of the subject.
Cheers
Allan
Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A
patch was
written at the time and it was included into the main codebase but
unfortunately I did not get a chance to imeplement what I wanted to > > and never ended up testing it. Thats has just changed > recently and now
I am having issues acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I > > try cut the subject and paste it as the body nothing
happens. I havent
gone as far as testing it via the sms-to-email app yet as I
cant get
it working from a normal email.

I still have one other potential problem of me converting the [] in > > the alerts to () but thats more outbound sms and I can deal with it > > coming back inwards.

Any suggestions appreciated

Allan
**************************************************************
***********************
The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way. 
The contents of this message and its attachments are confidential and may also be subject to legal privilege.  If you are not the named addressee and/or have received this message in error, please advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any attachments without retaining any copies. 
Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses. 
No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.  
Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to 
www.colt.net or contact us on +44(0)20 7390 3900.

*************************************************************************************
The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way. 
The contents of this message and its attachments are confidential and may also be subject to legal privilege.  If you are not the named addressee and/or have received this message in error, please advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any attachments without retaining any copies. 
Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses. 
No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.  
Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900.
list Phil Wild · Wed, 9 Jul 2008 20:07:04 +0800 ·
You do not need to use procmail. I simply have a .forward configured to pipe
to mailack in the hobbit home directory

Cheers

Phil

2008/7/9 Ward, Martin <user-2d33a6eb6a05@xymon.invalid>:
quoted from Martin Ward
Ah, it becomes clearer now!

With the suggestions from Phil Wild and Josh Luthman (and reading the
man page for hobbit-mailack) it seems that you are expected to use
procmail to use this program.

Phil, what you suggested seems to be just what Hobbit-mailack does,
receives the email and runs a program against its data.

Instead of using the procmail(1m) recipe suggested in the Hobbit-mailack
man page, you would need one like this:
====
DEFAULT=$HOME/Mailbox
LOGFILE=$HOME/procmail.log
:0
| $HOME/server/bin/hobbit/reformat_mailack
====
Your "reformat_mailack" script would need to rewrite the body text into
the subject line, then simply echo the data to the hobbit-mailack
command. Writing this linking script shouldn't be that hard (perl would
be better than shell, but either could do it).

--
-----Original Message-----
From: Ward, Martin [mailto:user-2d33a6eb6a05@xymon.invalid]
Sent: 09 July 2008 10:10
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] mailack question


I can offer a suggestion but this is only an idea I have just
had, it's not been tried, tested or anything. Also bear in
mind that I had no idea that you could acknowledge an alert
via email... This suggestion might bugger that up in some
unforeseen manner.

Could you install something like procmail? I see it working
like this: 1. An email gets sent to you. 2. You reply to it
with the acknowledgement in the text body as you have stated.
3. This reply gets picked up by procmail before it reaches
Hobbit (maybe change the Reply-To in the original email to
route it to a different address). 4. Procmail decides that it
should process this email (there are various tests that can
be performed) and calls a script, passing the body of the
email (and the subject?) to it. 5. The script munges the
email so that the Subject line is made from the text in the
body of the email. 6. Script forwards to email on to its
original destination.

I can immediately see flaws in this. You're replying on
another piece of s/w. You've got to make sure that the
matching format works. If you want to use the say return
address then you need to ensure that email flows from
procmail to the Hobbit receiver. I'm sure there are others.

Still, it's one solution.

|\/|artin
--

-----Original Message-----
From: Allan Spencer [mailto:user-42a3456c44ef@xymon.invalid]
Sent: 09 July 2008 02:02
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] mailack question


Just thought I'd check back on this and surprised nobody had any
thoughts on it but also notice Henrik hasn't been around either.

Still have had no luck with this although I have not been
able to spend
much time on it.

Still have the same problem of not being able to ack an
alert via the
email body instead of the subject.

Cheers
Allan

Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A
patch was
written at the time and it was included into the main codebase but
unfortunately I did not get a chance to imeplement what I
wanted to
and never ended up testing it. Thats has just changed
recently and now
I am having issues acking an alert via text in the body.

If i reply to an email and maintain the subject it works
fine, if I
try cut the subject and paste it as the body nothing
happens. I havent
gone as far as testing it via the sms-to-email app yet as I
cant get
it working from a normal email.

I still have one other potential problem of me converting
the [] in
the alerts to () but thats more outbound sms and I can
deal with it
coming back inwards.

Any suggestions appreciated

Allan

**************************************************************
***********************
The message is intended for the named addressee only and may
not be disclosed to or used by anyone else, nor may it be
copied in any way.

The contents of this message and its attachments are
confidential and may also be subject to legal privilege.  If
you are not the named addressee and/or have received this
message in error, please advise us by e-mailing
user-61c7f445d564@xymon.invalid and delete the message and any attachments
without retaining any copies.

Internet communications are not secure and COLT does not
accept responsibility for this message, its contents nor
responsibility for any viruses.

No contracts can be created or varied on behalf of COLT
Telecommunications, its subsidiaries or affiliates ("COLT")
and any other party by email Communications unless expressly
agreed in writing with such other party.

Please note that incoming emails will be automatically
scanned to eliminate potential viruses and unsolicited
promotional emails. For more information refer to
www.colt.net or contact us on +44(0)20 7390 3900.

*************************************************************************************
The message is intended for the named addressee only and may not be
disclosed to or used by anyone else, nor may it be copied in any way.

The contents of this message and its attachments are confidential and may
also be subject to legal privilege.  If you are not the named addressee
and/or have received this message in error, please advise us by e-mailing
user-61c7f445d564@xymon.invalid and delete the message and any attachments without
retaining any copies.

Internet communications are not secure and COLT does not accept
responsibility for this message, its contents nor responsibility for any
viruses.

No contracts can be created or varied on behalf of COLT Telecommunications,
its subsidiaries or affiliates ("COLT") and any other party by email
Communications unless expressly agreed in writing with such other party.

Please note that incoming emails will be automatically scanned to eliminate
potential viruses and unsolicited promotional emails. For more information
refer to www.colt.net or contact us on +44(0)20 7390 3900.

-- 
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid
list Martin Ward · Wed, 9 Jul 2008 13:46:47 +0100 ·
If I understand Allan's original query he wants to set the ACK options
in the email body, not in the Subject line.
 
You could use a .forward to forward the email to a script that takes the
message body and puts it in the subject line, then throws it all into
the mailack program.
The only issue with this nice, simple way of doing it is that it will do
this for EVERY email sent to the hobbit user. If you can guarantee that
Hobbit will only ever get mail acks then I agree, your suggestion of
using a .forward will work fine. Procmail simply allows you to route
different emails in different directions, some the application x, other
to application y, everything else to the default in-box.
 
|\/|artin
quoted from Phil Wild

-- 

	-----Original Message-----
	From: Phil Wild [mailto:user-e365c1418192@xymon.invalid] 
	Sent: 09 July 2008 13:07
	To: user-ae9b8668bcde@xymon.invalid
	Subject: Re: [hobbit] mailack question
	
	
	You do not need to use procmail. I simply have a .forward
configured to pipe to mailack in the hobbit home directory
	
	Cheers
	
	Phil
	
	
	2008/7/9 Ward, Martin <user-2d33a6eb6a05@xymon.invalid>:
	

		Ah, it becomes clearer now!
		
		With the suggestions from Phil Wild and Josh Luthman
(and reading the
		man page for hobbit-mailack) it seems that you are
expected to use
		procmail to use this program.
		
		Phil, what you suggested seems to be just what
Hobbit-mailack does,
		receives the email and runs a program against its data.
		
		Instead of using the procmail(1m) recipe suggested in
the Hobbit-mailack
		man page, you would need one like this:
		====
		DEFAULT=$HOME/Mailbox
		LOGFILE=$HOME/procmail.log
		:0
		| $HOME/server/bin/hobbit/reformat_mailack
		====
		Your "reformat_mailack" script would need to rewrite the
body text into
		the subject line, then simply echo the data to the
hobbit-mailack
		command. Writing this linking script shouldn't be that
hard (perl would
		be better than shell, but either could do it).
		
		--
		
-----Original Message-----
From: Ward, Martin [mailto:user-2d33a6eb6a05@xymon.invalid]
Sent: 09 July 2008 10:10
To: user-ae9b8668bcde@xymon.invalid
		
Subject: RE: [hobbit] mailack question


I can offer a suggestion but this is only an idea I
have just
had, it's not been tried, tested or anything. Also
bear in
mind that I had no idea that you could acknowledge an
alert
via email... This suggestion might bugger that up in
some
unforeseen manner.

Could you install something like procmail? I see it
working
like this: 1. An email gets sent to you. 2. You reply
to it
with the acknowledgement in the text body as you have
stated.
3. This reply gets picked up by procmail before it
reaches
Hobbit (maybe change the Reply-To in the original
email to
route it to a different address). 4. Procmail decides
that it
should process this email (there are various tests
that can
be performed) and calls a script, passing the body of
the
email (and the subject?) to it. 5. The script munges
the
email so that the Subject line is made from the text
in the
body of the email. 6. Script forwards to email on to
its
original destination.

I can immediately see flaws in this. You're replying
on
another piece of s/w. You've got to make sure that the
matching format works. If you want to use the say
return
address then you need to ensure that email flows from
procmail to the Hobbit receiver. I'm sure there are
others.

Still, it's one solution.

|\/|artin
--

-----Original Message-----
From: Allan Spencer [mailto:user-42a3456c44ef@xymon.invalid]
Sent: 09 July 2008 02:02
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] mailack question


Just thought I'd check back on this and surprised
nobody had any
thoughts on it but also notice Henrik hasn't been
around either.

Still have had no luck with this although I have not
been
able to spend
much time on it.

Still have the same problem of not being able to ack
an
alert via the
email body instead of the subject.

Cheers
Allan

Allan Spencer wrote:
HI all

A LONG time ago I asked about ack'ing an alert via
email (or via
sms-to-email) and to be able to do so without a
subject. A
patch was
written at the time and it was included into the
main codebase but
unfortunately I did not get a chance to imeplement
what I
wanted to
and never ended up testing it. Thats has just
changed
recently and now
I am having issues acking an alert via text in the
body.

If i reply to an email and maintain the subject it
works
fine, if I
try cut the subject and paste it as the body
nothing
happens. I havent
gone as far as testing it via the sms-to-email app
yet as I
cant get
it working from a normal email.

I still have one other potential problem of me
converting
the [] in
the alerts to () but thats more outbound sms and I
can
deal with it
coming back inwards.

Any suggestions appreciated

Allan

To unsubscribe from the hobbit list, send an
e-mail to
user-095ef1c764a2@xymon.invalid
To unsubscribe from the hobbit list, send an e-mail
to
user-095ef1c764a2@xymon.invalid
quoted from Phil Wild

**************************************************************
***********************
The message is intended for the named addressee only
and may
not be disclosed to or used by anyone else, nor may it
be
copied in any way.

The contents of this message and its attachments are
confidential and may also be subject to legal
privilege.  If
you are not the named addressee and/or have received
this
message in error, please advise us by e-mailing
user-61c7f445d564@xymon.invalid and delete the message and any
attachments
without retaining any copies.

Internet communications are not secure and COLT does
not
accept responsibility for this message, its contents
nor
responsibility for any viruses.

No contracts can be created or varied on behalf of
COLT
Telecommunications, its subsidiaries or affiliates
("COLT")
and any other party by email Communications unless
expressly
agreed in writing with such other party.

Please note that incoming emails will be automatically
scanned to eliminate potential viruses and unsolicited
promotional emails. For more information refer to
		www.colt.net or contact us on +44(0)20 7390 3900.
		
		
************************************************************************
*************
		The message is intended for the named addressee only and
may not be disclosed to or used by anyone else, nor may it be copied in
any way.
		
		The contents of this message and its attachments are
confidential and may also be subject to legal privilege.  If you are not
the named addressee and/or have received this message in error, please
advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any
attachments without retaining any copies.
		
		Internet communications are not secure and COLT does not
accept responsibility for this message, its contents nor responsibility
for any viruses.
		
		No contracts can be created or varied on behalf of COLT
Telecommunications, its subsidiaries or affiliates ("COLT") and any
other party by email Communications unless expressly agreed in writing
with such other party.
		
		Please note that incoming emails will be automatically
scanned to eliminate potential viruses and unsolicited promotional
emails. For more information refer to www.colt.net or contact us on
+44(0)20 7390 3900.
		
		
	-- 
	Tel: XXXX XXX XXX
	Fax: XXXX XXX XXX
	email: user-e365c1418192@xymon.invalid 


*************************************************************************************
The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way. 

The contents of this message and its attachments are confidential and may also be subject to legal privilege.  If you are not the named addressee and/or have received this message in error, please advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any attachments without retaining any copies. 

Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses. 

No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.  

Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900.
list Ralph Mitchell · Wed, 9 Jul 2008 12:04:23 -0500 ·
quoted from Allan Spencer
On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <user-42a3456c44ef@xymon.invalid> wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A patch was written
at the time and it was included into the main codebase but unfortunately I
did not get a chance to imeplement what I wanted to and never ended up
testing it. Thats has just changed recently and now I am having issues
acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I try cut
the subject and paste it as the body nothing happens. I havent gone as far
as testing it via the sms-to-email app yet as I cant get it working from a
normal email.

The hobbit-mailack.c program loops through the incoming email, looking for
interesting stuff.  Here's where it finds the subject line:

     else if (strncasecmp(STRBUF(inbuf), "subject:", 8) == 0)
         subjectline = strdup(skipwhitespace(STRBUF(inbuf)+8));

Once the headers are done with, it goes on to look for some things in the
email body, such as "delay=" and "ack=":

     else if ((strncasecmp(STRBUF(inbuf), "ack=", 4) == 0) ||
                (strncasecmp(STRBUF(inbuf), "ack ", 4) == 0)) {
                                /* Some systems cannot generate a subject.
Allow them to ack
                                 * via text in the message body. */
                                subjectline = (char *)malloc(1024);
                                snprintf(subjectline, 1023, "Subject: Hobbit
[%s]", STRBUF(inbuf)+4);
                        }

So, does the email body contain a line that starts with "ack=NNNNNN" or "ack
NNNNN"??  If not, it won't match the above code fragment.  It looks like it
should be *just* the number, as that gets filled in between the square
brackets in the faked subject line.

I noticed something else interesting in the code.  The last thing it does is
call sendmessage, handing it a buffer loaded like this:

     p += sprintf(p, "hobbitdack %s %d %s", cookie, duration, firsttxtline);
        if (fromline) {
           p += sprintf(p, "\nAcked by: %s", fromline);
        }

I figured it wouldn't hurt to try doing this:

     server/bin/bb localhost "hobbitdack NNNNNN 60 this thing is broken
     Acked by: user-d8507e18a65a@xymon.invalid"

where NNNNNN came from a real, current warning message.  Note the placement
of the double-quotes - there needs to be a newline between the message and
"Acked by".  And now, just below the "Status unchanged in...." message at
the bottom of the page I find this:

          Current acknowledgment: this thing is broken
               Acked by: user-d8507e18a65a@xymon.invalid
               Next update at: 12:54 2008-07-09

and there's a nice yellow check mark on the all-non-green page.  So it looks
like an ACK *can* be sent via the command line...

Ralph
list Mike Wood · Wed, 9 Jul 2008 15:42:55 -0500 ·
Hi All,

 
Can E-mail recipients for alerts be configured on a per-filesystem basis
(not just SERVICE=DISK)?

 
Thanks!

 
Mike Wood

UNIX System Administrator

Kinetic Concepts, Inc.

XXXX Farinon Drive

San Antonio, TX, 78249

 
E-mail:  user-ca9fdeef37c9@xymon.invalid

Office:  (XXX) XXX-XXXX

Mobile:  (XXX) XXX-XXXX

*****************************************************************************
"CONFIDENTIALITY NOTICE:  This transmission (including any
accompanying attachments) is confidential, is intended only for the
individual or entity named above, and is likely to contain privileged, proprietary and confidential information that is exempt from disclosure requests under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, use of or reliance upon any of the information contained in this transmission
is strictly prohibited.  Any inadvertent or unauthorized disclosure shall not compromise or waive the confidentiality of this transmission or any applicable attorney-client privilege. 
If you have received this transmission in error, please immediately notify us at user-c978de0668a4@xymon.invalid."


Kinetic Concepts, Inc.

******************************************************************************
list Mike Wood · Wed, 9 Jul 2008 15:48:43 -0500 ·
Never mind.  I found it in the archives...:-)
signature

 
Mike Wood

UNIX System Administrator

Kinetic Concepts, Inc.

XXXX Farinon Drive

San Antonio, TX, 78249

 
E-mail:  user-ca9fdeef37c9@xymon.invalid

Office:  (XXX) XXX-XXXX

Mobile:  (XXX) XXX-XXXX

 

quoted from Mike Wood
From: Wood, Mike [mailto:user-ca9fdeef37c9@xymon.invalid] Sent: Wednesday, July 09, 2008 3:43 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Recipients on a Per-Filesystem basis?

 
Hi All,

 
Can E-mail recipients for alerts be configured on a per-filesystem basis
(not just SERVICE=DISK)?

 
Thanks!

 
Mike Wood

UNIX System Administrator

Kinetic Concepts, Inc.

XXXX Farinon Drive

San Antonio, TX, 78249

 
E-mail:  user-ca9fdeef37c9@xymon.invalid

Office:  (XXX) XXX-XXXX

Mobile:  (XXX) XXX-XXXX

************************************************************************
*****
"CONFIDENTIALITY NOTICE:  This transmission (including any
accompanying attachments) is confidential, is intended only for the
individual or entity named above, and is likely to contain privileged, proprietary and confidential information that is exempt from disclosure requests under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, use of or reliance upon any of the information contained in this
transmission
is strictly prohibited.  Any inadvertent or unauthorized disclosure
shall not compromise or waive the confidentiality of this transmission or any applicable attorney-client privilege.  If you have received this transmission in error, please immediately notify us at user-c978de0668a4@xymon.invalid."
  Kinetic Concepts, Inc.
 ************************************************************************
******
*****************************************************************************
"CONFIDENTIALITY NOTICE:  This transmission (including any
accompanying attachments) is confidential, is intended only for the
individual or entity named above, and is likely to contain privileged, proprietary and confidential information that is exempt from disclosure requests under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, use of or reliance upon any of the information contained in this transmission
is strictly prohibited.  Any inadvertent or unauthorized disclosure shall not compromise or waive the confidentiality of this transmission or any applicable attorney-client privilege. 
If you have received this transmission in error, please immediately notify us at user-c978de0668a4@xymon.invalid."


Kinetic Concepts, Inc.

******************************************************************************
list Tim McCloskey · Wed, 09 Jul 2008 14:01:51 -0700 ·
Yes.  Simply define a group in hobbitclients and use the group name in hobbit alerts.

Example follows.

hobbit clients:
...
HOST=servera,serverc,serverfoo
         DISK    %^/foo.*        95 98 GROUP=FOO_ADMINS
         DISK    %^/moo.*        95 98 GROUP=MOO_ADMINS
...

hobbit alerts
...
HOST=servera,serverc,serverfoo GROUP=FOO_ADMINS COLOR=red
quoted from Mike Wood
...


Wood, Mike wrote:
Hi All,

 
Can E-mail recipients for alerts be configured on a per-filesystem basis (not just SERVICE=DISK)?

 
Thanks!

 
Mike Wood

UNIX System Administrator

Kinetic Concepts, Inc.

XXXX Farinon Drive

San Antonio, TX, 78249

 
E-mail:  user-ca9fdeef37c9@xymon.invalid

Office:  (XXX) XXX-XXXX

Mobile:  (XXX) XXX-XXXX

*****************************************************************************
"CONFIDENTIALITY NOTICE:  This transmission (including any
accompanying attachments) is confidential, is intended only for the
individual or entity named above, and is likely to contain privileged, proprietary and confidential information that is exempt from disclosure requests under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, use of or reliance upon any of the information contained in this transmission
is strictly prohibited.  Any inadvertent or unauthorized disclosure shall not compromise or waive the confidentiality of this transmission or any applicable attorney-client privilege. 
If you have received this transmission in error, please immediately notify us at user-c978de0668a4@xymon.invalid."


Kinetic Concepts, Inc.

******************************************************************************
list Allan Spencer · Thu, 10 Jul 2008 10:21:29 +1000 ·
quoted from Ralph Mitchell

Ralph Mitchell wrote:
On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <user-42a3456c44ef@xymon.invalid <mailto:user-42a3456c44ef@xymon.invalid>> wrote:

    HI all

    A LONG time ago I asked about ack'ing an alert via email (or via
    sms-to-email) and to be able to do so without a subject. A patch
    was written at the time and it was included into the main codebase
    but unfortunately I did not get a chance to imeplement what I
    wanted to and never ended up testing it. Thats has just changed
    recently and now I am having issues acking an alert via text in
    the body.

    If i reply to an email and maintain the subject it works fine, if
    I try cut the subject and paste it as the body nothing happens. I
    havent gone as far as testing it via the sms-to-email app yet as I
    cant get it working from a normal email.


The hobbit-mailack.c program loops through the incoming email, looking for interesting stuff.  Here's where it finds the subject line:

     else if (strncasecmp(STRBUF(inbuf), "subject:", 8) == 0)
         subjectline = strdup(skipwhitespace(STRBUF(inbuf)+8));
 Once the headers are done with, it goes on to look for some things in the email body, such as "delay=" and "ack=":

     else if ((strncasecmp(STRBUF(inbuf), "ack=", 4) == 0) ||
                (strncasecmp(STRBUF(inbuf), "ack ", 4) == 0)) {
                                /* Some systems cannot generate a subject. Allow them to ack
                                 * via text in the message body. */
                                subjectline = (char *)malloc(1024);
                                snprintf(subjectline, 1023, "Subject: Hobbit [%s]", STRBUF(inbuf)+4);
                        }

So, does the email body contain a line that starts with "ack=NNNNNN" or "ack NNNNN"??  If not, it won't match the above code fragment.  It looks like it should be *just* the number, as that gets filled in between the square brackets in the faked subject line.

I noticed something else interesting in the code.  The last thing it does is call sendmessage, handing it a buffer loaded like this:

     p += sprintf(p, "hobbitdack %s %d %s", cookie, duration, firsttxtline);
        if (fromline) {
           p += sprintf(p, "\nAcked by: %s", fromline);
        }

I figured it wouldn't hurt to try doing this:

     server/bin/bb localhost "hobbitdack NNNNNN 60 this thing is broken

     Acked by: user-d8507e18a65a@xymon.invalid <mailto:user-d8507e18a65a@xymon.invalid>"
quoted from Ralph Mitchell

where NNNNNN came from a real, current warning message.  Note the placement of the double-quotes - there needs to be a newline between the message and "Acked by".  And now, just below the "Status unchanged in...." message at the bottom of the page I find this:

          Current acknowledgment: this thing is broken

               Acked by: user-d8507e18a65a@xymon.invalid <mailto:user-d8507e18a65a@xymon.invalid>
quoted from Ralph Mitchell
               Next update at: 12:54 2008-07-09

and there's a nice yellow check mark on the all-non-green page.  So it looks like an ACK *can* be sent via the command line...

Ralph
Cheers Ralph you identified my missing link. I was under the impression that the body needed to be in the same format as the subject but as you have identified thats not the case. I have just test a plain email with ack=xxxx in the body and it worked a charm so hopefully a little later on I can try it end to end via SMS.

I knew Henrik coded it in there when I asked a while ago but unfortunately I never got the chance or the capability to test it back then.

Thanks
Allan
list Phil Wild · Thu, 10 Jul 2008 09:13:31 +0800 ·
Ralph,

Well done....

This is not documented in the man page...

Cheers

Phil

2008/7/10 Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>:
quoted from Allan Spencer
On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <user-42a3456c44ef@xymon.invalid> wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A patch was written
at the time and it was included into the main codebase but unfortunately I
did not get a chance to imeplement what I wanted to and never ended up
testing it. Thats has just changed recently and now I am having issues
acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I try
cut the subject and paste it as the body nothing happens. I havent gone as
far as testing it via the sms-to-email app yet as I cant get it working from
a normal email.

The hobbit-mailack.c program loops through the incoming email, looking for
interesting stuff.  Here's where it finds the subject line:

     else if (strncasecmp(STRBUF(inbuf), "subject:", 8) == 0)
         subjectline = strdup(skipwhitespace(STRBUF(inbuf)+8));

Once the headers are done with, it goes on to look for some things in the
email body, such as "delay=" and "ack=":

     else if ((strncasecmp(STRBUF(inbuf), "ack=", 4) == 0) ||
                (strncasecmp(STRBUF(inbuf), "ack ", 4) == 0)) {
                                /* Some systems cannot generate a subject.
Allow them to ack
                                 * via text in the message body. */
                                subjectline = (char *)malloc(1024);
                                snprintf(subjectline, 1023, "Subject:
Hobbit [%s]", STRBUF(inbuf)+4);
                        }

So, does the email body contain a line that starts with "ack=NNNNNN" or
"ack NNNNN"??  If not, it won't match the above code fragment.  It looks
like it should be *just* the number, as that gets filled in between the
square brackets in the faked subject line.

I noticed something else interesting in the code.  The last thing it does
is call sendmessage, handing it a buffer loaded like this:

     p += sprintf(p, "hobbitdack %s %d %s", cookie, duration,
firsttxtline);
        if (fromline) {
           p += sprintf(p, "\nAcked by: %s", fromline);
        }

I figured it wouldn't hurt to try doing this:

     server/bin/bb localhost "hobbitdack NNNNNN 60 this thing is broken
     Acked by: user-d8507e18a65a@xymon.invalid"

where NNNNNN came from a real, current warning message.  Note the placement
of the double-quotes - there needs to be a newline between the message and
"Acked by".  And now, just below the "Status unchanged in...." message at
the bottom of the page I find this:

          Current acknowledgment: this thing is broken
               Acked by: user-d8507e18a65a@xymon.invalid
               Next update at: 12:54 2008-07-09

and there's a nice yellow check mark on the all-non-green page.  So it
looks like an ACK *can* be sent via the command line...

Ralph

-- 
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid
list Ralph Mitchell · Wed, 9 Jul 2008 20:38:18 -0500 ·
Possibly for a good reason - I expect to get slapped by Henrik... :)

Ralph
quoted from Phil Wild


On Wed, Jul 9, 2008 at 8:13 PM, Phil Wild <user-e365c1418192@xymon.invalid> wrote:
Ralph,

Well done....

This is not documented in the man page...

Cheers

Phil

2008/7/10 Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>:

 On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <user-42a3456c44ef@xymon.invalid>
wrote:
HI all

A LONG time ago I asked about ack'ing an alert via email (or via
sms-to-email) and to be able to do so without a subject. A patch was written
at the time and it was included into the main codebase but unfortunately I
did not get a chance to imeplement what I wanted to and never ended up
testing it. Thats has just changed recently and now I am having issues
acking an alert via text in the body.

If i reply to an email and maintain the subject it works fine, if I try
cut the subject and paste it as the body nothing happens. I havent gone as
far as testing it via the sms-to-email app yet as I cant get it working from
a normal email.

The hobbit-mailack.c program loops through the incoming email, looking for
interesting stuff.  Here's where it finds the subject line:

     else if (strncasecmp(STRBUF(inbuf), "subject:", 8) == 0)
         subjectline = strdup(skipwhitespace(STRBUF(inbuf)+8));

Once the headers are done with, it goes on to look for some things in the
email body, such as "delay=" and "ack=":

     else if ((strncasecmp(STRBUF(inbuf), "ack=", 4) == 0) ||
                (strncasecmp(STRBUF(inbuf), "ack ", 4) == 0)) {
                                /* Some systems cannot generate a subject.
Allow them to ack
                                 * via text in the message body. */
                                subjectline = (char *)malloc(1024);
                                snprintf(subjectline, 1023, "Subject:
Hobbit [%s]", STRBUF(inbuf)+4);
                        }

So, does the email body contain a line that starts with "ack=NNNNNN" or
"ack NNNNN"??  If not, it won't match the above code fragment.  It looks
like it should be *just* the number, as that gets filled in between the
square brackets in the faked subject line.

I noticed something else interesting in the code.  The last thing it does
is call sendmessage, handing it a buffer loaded like this:

     p += sprintf(p, "hobbitdack %s %d %s", cookie, duration,
firsttxtline);
        if (fromline) {
           p += sprintf(p, "\nAcked by: %s", fromline);
        }

I figured it wouldn't hurt to try doing this:

     server/bin/bb localhost "hobbitdack NNNNNN 60 this thing is broken
     Acked by: user-d8507e18a65a@xymon.invalid"

where NNNNNN came from a real, current warning message.  Note the
placement of the double-quotes - there needs to be a newline between the
message and "Acked by".  And now, just below the "Status unchanged in...."
message at the bottom of the page I find this:

          Current acknowledgment: this thing is broken
               Acked by: user-d8507e18a65a@xymon.invalid
               Next update at: 12:54 2008-07-09

and there's a nice yellow check mark on the all-non-green page.  So it
looks like an ACK *can* be sent via the command line...

Ralph

--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid