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
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
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.
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.
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
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- 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
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
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 my.email at here.com 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
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
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
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- 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
participants (2)
-
henrik@hswn.dk
-
iqbala-hobbit@qwestip.net