maint.pl with no email
list Asif Iqbal
Hi All
In bigbrother the following code of maint.pl were able to send a page.
"&bbsend("now","$bbpager","page notify-admin.maint enable\n\nThe f
ollowing at jobs that were scheduled to disable tests have been
CANCELLED\nDate: " . &POSIX_time(
$nowtime) . "\n$cancelledby$notification");"
But in Hobbit I tried with the same code and it did not send any page.
I have HOST=notify-admin SERVICE=maint
MAIL my.email at here
And when I did the ./bin/bbcmd hobbitd_alert --test notify-admin maint,
it matches the rule fine.
However 'man bb' shows 'page HOSTNAME.TESTNAME COLOR <additional text>'.
So for testing I ran
bb 127.0.0.1 "page HOSTNAME.TESTNAME COLOR <additional text>"
but I did not receive any page.
Is that mean I need to have an entry for notify-admin in bb-hosts file?
But that is not a valid hostname. So I am in a predicament now. Is there
a trick/tip to make the page work when using maint.pl?
Thanks
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"It is not the strongest of the species that survives, not the most intelligent, but
the one most responsive to change." - Charles Darwin
list Henrik Størner
▸
On Fri, Feb 25, 2005 at 07:49:46AM -0500, Asif Iqbal wrote:
In bigbrother the following code of maint.pl were able to send a page.
"&bbsend("now","$bbpager","page notify-admin.maint enable\n\nThe f
ollowing at jobs that were scheduled to disable tests have been
CANCELLED\nDate: " . &POSIX_time(
$nowtime) . "\n$cancelledby$notification");"
But in Hobbit I tried with the same code and it did not send any
page.That is because Hobbit doesn't support the BB "page" protocol. If you send hobbitd such a request, it is silently dropped. I've updated the bb man-page to reflect this. Alerts in Hobbit happen as a result of a "status" message. The magic "notify-admin" hostname does not exist in Hobbit.
▸
I have HOST=notify-admin SERVICE=maint MAIL my.email at here And when I did the ./bin/bbcmd hobbitd_alert --test notify-admin maint, it matches the rule fine.
If you had a host called "notify-admin" with a "maint" status column, then this rule would control alerts for that status. Henrik
list Asif Iqbal
▸
On Fri, Feb 25, 2005 at 02:23:47PM, Henrik Stoerner wrote:
On Fri, Feb 25, 2005 at 07:49:46AM -0500, Asif Iqbal wrote:In bigbrother the following code of maint.pl were able to send a page."&bbsend("now","$bbpager","page notify-admin.maint enable\n\nThe f ollowing at jobs that were scheduled to disable tests have beenCANCELLED\nDate: " . &POSIX_time( $nowtime) . "\n$cancelledby$notification");"But in Hobbit I tried with the same code and it did not send any page.That is because Hobbit doesn't support the BB "page" protocol. If you send hobbitd such a request, it is silently dropped. I've updated the bb man-page to reflect this. Alerts in Hobbit happen as a result of a "status" message. The magic "notify-admin" hostname does not exist in Hobbit.I have HOST=notify-admin SERVICE=maint MAIL my.email at hereAnd when I did the ./bin/bbcmd hobbitd_alert --test notify-admin maint, it matches the rule fine.If you had a host called "notify-admin" with a "maint" status column, then this rule would control alerts for that status.
1.2.3.4 notify-admin # noconn maint The above entry should take care of it? I do not have any valid host called notify-admin with valid IP or FQDN. Should I expect any alert because this is not a valid host? Thanks
Henrik
▸
-- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu "It is not the strongest of the species that survives, not the most intelligent, but the one most responsive to change." - Charles Darwin
list Henrik Størner
▸
On Fri, Feb 25, 2005 at 10:11:03AM -0500, Asif Iqbal wrote:
On Fri, Feb 25, 2005 at 02:23:47PM, Henrik Stoerner wrote:On Fri, Feb 25, 2005 at 07:49:46AM -0500, Asif Iqbal wrote:In bigbrother the following code of maint.pl were able to send a page. "&bbsend("now","$bbpager","page notify-admin.maint enable\n\nThe f ollowing at jobs that were scheduled to disable tests have been CANCELLED\nDate: " . &POSIX_time( $nowtime) . "\n$cancelledby$notification");" But in Hobbit I tried with the same code and it did not send any page.That is because Hobbit doesn't support the BB "page" protocol. If you send hobbitd such a request, it is silently dropped. I've updated the bb man-page to reflect this. Alerts in Hobbit happen as a result of a "status" message. The magic "notify-admin" hostname does not exist in Hobbit.
1.2.3.4 notify-admin # noconn maint The above entry should take care of it?
Well, it defines the "notify-admin" host. But Hobbit will *still* ignore the message that maint.pl sends, because it's a "page" message. Frankly, this part of maint.pl is just plain broken. What's the point in sending this notification? If it were to be meaningful, it should go to the person who scheduled the disable-operation, not some random "notify-admin" recipient. And why only send the message when it's canceled ? It would make more sense to send out messages when the host was actually disabled - e.g. to the people who would otherwise receive the alerts, so that when someone calls them about the server that isn't working they would know why they haven't received any alerts. If you do want to get messages when a disable is cancelled, I think you should just stick in a call to send an e-mail. Regards, Henrik
list Asif Iqbal
▸
On Fri, Feb 25, 2005 at 11:22:34PM, Henrik Stoerner wrote:
Frankly, this part of maint.pl is just plain broken. What's the point
Well I had to add/modify couple things to make it work as it was with Bigbrother.
First of all I added the notify-admin host bb-hosts file like this
1.2.3.4 notify-admin # noconn maint
Added maint in the --ignorecolums list in bbgen section in hobbitlaunch.cfg file.
Added the following lines in the hobbit-alerts.cfg file
HOST=notify-admin SERVICE=maint
SCRIPT /tmp/scripts/notify user-c752fc078782@xymon.invalid FORMAT=TEXT REPEAT=999d
This is how the /tmp/scripts/notify looks like
#!/bin/sh
#
LINES=`echo "${BBALPHAMSG}" | /usr/local/bin/formail -I "" | /bin/wc -l`
LINES=`expr $LINES - 3`
echo "${BBALPHAMSG}" | /bin/tail -${TOP} | mailx -s "BB [$ACKCODE] $BBHOSTSVC" $RCPT
exit 0
Modified the cgi-secure/maint.pl by rewriting the lines
"pager notify-admin.maint enable....." OR "pager notify-admin.maint disable..."
With
"status notify-admin.maint red enable...." OR "status notify-admin.maint red disable...."
I am positive Henrik has a cooler solution for this.
▸
Thanks
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"It is not the strongest of the species that survives, not the most intelligent, but
the one most responsive to change." - Charles Darwin
list Henrik Størner
▸
On Fri, Feb 25, 2005 at 07:32:35PM -0500, Asif Iqbal wrote:
On Fri, Feb 25, 2005 at 11:22:34PM, Henrik Stoerner wrote:Frankly, this part of maint.pl is just plain broken.Well I had to add/modify couple things to make it work as it was with Bigbrother.
[snip the hack]
I am positive Henrik has a cooler solution for this.
Perhaps ... I've been cooking up something today that might be useful. Instead of the "page notify-admin" recipient, I implemented a new command in the Hobbit protocol called "notify". When you send a "notify" command to the hobbit server, you also pass it a hostname, a testname, and a text message. Hobbit then sends this message through the alert module just as a normal alert-message about a status that has gone red - and the message is sent out using the normal methods configured for the recipients for that particular host+test combination. So what happens is that when you disable a test, everyone that would normally receive an alert about that test will get a message that it has been disabled. And the same when it is re-enabled, of course. I think that makes more sense than sending to the generic "notify-admin" recipient. Henrik
list Asif Iqbal
▸
On Sat, Feb 26, 2005 at 06:11:44PM, Henrik Stoerner wrote:
On Fri, Feb 25, 2005 at 07:32:35PM -0500, Asif Iqbal wrote:On Fri, Feb 25, 2005 at 11:22:34PM, Henrik Stoerner wrote:Frankly, this part of maint.pl is just plain broken.Well I had to add/modify couple things to make it work as it was with Bigbrother.[snip the hack]I am positive Henrik has a cooler solution for this.Perhaps ... I've been cooking up something today that might be useful. Instead of the "page notify-admin" recipient, I implemented a new command in the Hobbit protocol called "notify". When you send a "notify" command to the hobbit server, you also pass it a hostname, a testname, and a text message. Hobbit then sends this message through the alert module just as a normal alert-message about a status that has gone red - and the message is sent out using the normal methods configured for the recipients for that particular host+test combination. So what happens is that when you disable a test, everyone that would normally receive an alert about that test will get a message that it has been disabled. And the same when it is re-enabled, of course. I think that makes more sense than sending to the generic "notify-admin" recipient.
Right on money as always!
▸
Henrik
-- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu "It is not the strongest of the species that survives, not the most intelligent, but the one most responsive to change." - Charles Darwin
list Brent Mccrackin
Eeeeewwww.... Dropping support for the BB "page" protocol for messages will break a lot of things that I make use of for administrative events alerts that aren't associated with a particular host or status. Is there any way that this can be worked around?? At the very least, be able to configure blue status events to send emails to a defined address (rather than one of the pager addresses for red or yellow)? --- Brent B McCrackin UNIX Systems Specialist - Bell Sympatico user-04bba0146b8b@xymon.invalid PH: XXX-XXX-XXXX "Serenity through viciousness."
▸
-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: February 25, 2005 8:24 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] maint.pl with no email
On Fri, Feb 25, 2005 at 07:49:46AM -0500, Asif Iqbal wrote:
In bigbrother the following code of maint.pl were able to send a page.
"&bbsend("now","$bbpager","page notify-admin.maint enable\n\nThe f
ollowing at jobs that were scheduled to disable tests have been
CANCELLED\nDate: " . &POSIX_time(
$nowtime) . "\n$cancelledby$notification");"
But in Hobbit I tried with the same code and it did not send any
page.That is because Hobbit doesn't support the BB "page" protocol. If you send hobbitd such a request, it is silently dropped. I've updated the bb man-page to reflect this. Alerts in Hobbit happen as a result of a "status" message. The magic "notify-admin" hostname does not exist in Hobbit.
I have HOST=notify-admin SERVICE=maint MAIL my.email at here And when I did the ./bin/bbcmd hobbitd_alert --test notify-admin maint, it matches the rule fine.
If you had a host called "notify-admin" with a "maint" status column, then this rule would control alerts for that status. Henrik
list Asif Iqbal
▸
On Mon, Feb 28, 2005 at 02:51:49PM, user-04bba0146b8b@xymon.invalid wrote:
Eeeeewwww.... Dropping support for the BB "page" protocol for messages will break a lot of things that I make use of for administrative events alerts that aren't associated with a particular host or status.
If you just replace the word page with status it will just work.
▸
Is there any way that this can be worked around?? At the very least, be able to configure blue status events to send emails to a defined address (rather than one of the pager addresses for red or yellow)?
-- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu "It is not the strongest of the species that survives, not the most intelligent, but the one most responsive to change." - Charles Darwin
list Brent Mccrackin
And if the groups that need to be notified that a service is disabled for maintenance are different from the people that need to be notified of an outage? For example, when maintenance is started we don't want the on-call pager being alerted that a service has been disabled for maintenance - the purpose of a blue dot is so the person carrying the pager isn't woken up unnecessarily. We do want the admins group to be notified that the maintenance has started, though.
▸
---
Brent B McCrackin
UNIX Systems Specialist - Bell Sympatico
user-04bba0146b8b@xymon.invalid PH: XXX-XXX-XXXX
"Serenity through viciousness."
-----Original Message-----
▸
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: February 26, 2005 12:12 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] maint.pl with no email
On Fri, Feb 25, 2005 at 07:32:35PM -0500, Asif Iqbal wrote:On Fri, Feb 25, 2005 at 11:22:34PM, Henrik Stoerner wrote:Frankly, this part of maint.pl is just plain broken.Well I had to add/modify couple things to make it work as it was with Bigbrother.
[snip the hack]
I am positive Henrik has a cooler solution for this.
Perhaps ... I've been cooking up something today that might be useful. Instead of the "page notify-admin" recipient, I implemented a new command in the Hobbit protocol called "notify". When you send a "notify" command to the hobbit server, you also pass it a hostname, a testname, and a text message. Hobbit then sends this message through the alert module just as a normal alert-message about a status that has gone red - and the message is sent out using the normal methods configured for the recipients for that particular host+test combination. So what happens is that when you disable a test, everyone that would normally receive an alert about that test will get a message that it has been disabled. And the same when it is re-enabled, of course. I think that makes more sense than sending to the generic "notify-admin" recipient. Henrik
list Asif Iqbal
▸
On Mon, Feb 28, 2005 at 03:00:56PM, user-04bba0146b8b@xymon.invalid wrote:
And if the groups that need to be notified that a service is disabled for maintenance are different from the people that need to be notified of an outage?
I would try the 'NOTIFY'. It is in RC4.
▸
For example, when maintenance is started we don't want the on-call pager being alerted that a service has been disabled for maintenance - the purpose of a blue dot is so the person carrying the pager isn't woken up unnecessarily. We do want the admins group to be notified that the maintenance has started, though. --- Brent B McCrackin UNIX Systems Specialist - Bell Sympatico user-04bba0146b8b@xymon.invalid PH: XXX-XXX-XXXX "Serenity through viciousness." -----Original Message----- From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: February 26, 2005 12:12 PM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] maint.pl with no email On Fri, Feb 25, 2005 at 07:32:35PM -0500, Asif Iqbal wrote:On Fri, Feb 25, 2005 at 11:22:34PM, Henrik Stoerner wrote:Frankly, this part of maint.pl is just plain broken.Well I had to add/modify couple things to make it work as it was with Bigbrother.[snip the hack]I am positive Henrik has a cooler solution for this.Perhaps ... I've been cooking up something today that might be useful. Instead of the "page notify-admin" recipient, I implemented a new command in the Hobbit protocol called "notify". When you send a "notify" command to the hobbit server, you also pass it a hostname, a testname, and a text message. Hobbit then sends this message through the alert module just as a normal alert-message about a status that has gone red - and the message is sent out using the normal methods configured for the recipients for that particular host+test combination. So what happens is that when you disable a test, everyone that would normally receive an alert about that test will get a message that it has been disabled. And the same when it is re-enabled, of course. I think that makes more sense than sending to the generic "notify-admin" recipient. Henrik
-- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu "It is not the strongest of the species that survives, not the most intelligent, but the one most responsive to change." - Charles Darwin
list Henrik Størner
▸
On Mon, Feb 28, 2005 at 02:51:49PM -0500, user-04bba0146b8b@xymon.invalid wrote:
Eeeeewwww.... Dropping support for the BB "page" protocol for messages will break a lot of things that I make use of for administrative events alerts that aren't associated with a particular host or status.
Sorry, but the "page" command is dead.
▸
Is there any way that this can be worked around?? At the very least, be able to configure blue status events to send emails to a defined address (rather than one of the pager addresses for red or yellow)?
I'm sure the "notify" command added in RC4 is what you are looking for. See "man bb" for details on the syntax. Regards, Henrik
list Henrik Størner
▸
On Mon, Feb 28, 2005 at 03:00:56PM -0500, user-04bba0146b8b@xymon.invalid wrote:
And if the groups that need to be notified that a service is disabled for maintenance are different from the people that need to be notified of an outage?
HOST=foo MAIL user-40bc3faa71b3@xymon.invalid COLOR=red STOP MAIL user-9832305a7983@xymon.invalid NOTICE or slightly more elegant (but not yet released) HOST=foo MAIL user-40bc3faa71b3@xymon.invalid COLOR=red MAIL user-9832305a7983@xymon.invalid NOALERT NOTICE Henrik