On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <allan at zandahar.net> 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: me at this.domain.com"
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: me at this.domain.com
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
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.
6103 Farinon Drive
San Antonio, TX, 78249
E-mail: mike.wood at kci1.com
Office: (210) 255-6382
Mobile: (210) 825-5134
"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 postmaster at kci1.com."
Kinetic Concepts, Inc.
Never mind. I found it in the archives...:-)
Mike Wood
UNIX System Administrator
Kinetic Concepts, Inc.
6103 Farinon Drive
San Antonio, TX, 78249
E-mail: mike.wood at kci1.com
Office: (210) 255-6382
Mobile: (210) 825-5134
From: Wood, Mike [mailto:Mike.Wood at kci1.com] Sent: Wednesday, July 09, 2008 3:43 PM To: hobbit at hswn.dk 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.
6103 Farinon Drive
San Antonio, TX, 78249
E-mail: mike.wood at kci1.com
Office: (210) 255-6382
Mobile: (210) 825-5134
"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 postmaster at kci1.com."
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 postmaster at kci1.com."
Kinetic Concepts, Inc.
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 ...
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.
6103 Farinon Drive
San Antonio, TX, 78249
E-mail: mike.wood at kci1.com
Office: (210) 255-6382
Mobile: (210) 825-5134
"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 postmaster at kci1.com."
Kinetic Concepts, Inc.
Ralph Mitchell wrote:
On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <allan at zandahar.net <mailto:allan at zandahar.net>> 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 asubject. 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: me at this.domain.com <mailto:me at this.domain.com>"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: me at this.domain.com <mailto:me at this.domain.com> Next update at: 12:54 2008-07-09and 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
Ralph,
Well done....
This is not documented in the man page...
Cheers
Phil
2008/7/10 Ralph Mitchell <ralphmitchell at gmail.com>:
On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <allan at zandahar.net> 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: me at this.domain.com"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: me at this.domain.com Next update at: 12:54 2008-07-09and 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: 0400 466 952 Fax: 0433 123 226 email: philwild AT gmail.com
Possibly for a good reason - I expect to get slapped by Henrik... :)
Ralph
On Wed, Jul 9, 2008 at 8:13 PM, Phil Wild <philwild at gmail.com> wrote:
Ralph,
Well done....
This is not documented in the man page...
Cheers
Phil
2008/7/10 Ralph Mitchell <ralphmitchell at gmail.com>:
On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <allan at zandahar.net>
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: me at this.domain.com"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: me at this.domain.com Next update at: 12:54 2008-07-09and 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: 0400 466 952 Fax: 0433 123 226 email: philwild AT gmail.com
participants (5)
-
allan@zandahar.net
-
Mike.Wood@kci1.com
-
morphine@zwizard.com
-
philwild@gmail.com
-
ralphmitchell@gmail.com