From rebecca_henderson@link.freedom.com Wed Jun 24 08:17:41 2026 From: rebecca_henderson@link.freedom.com To: xymon@xymon.com Subject: oracle question Date: Tue, 20 May 2008 11:32:56 -0700 Message-ID: <79CCC36428A60546B48109EFBBB7201C017B3B2D@corp1.FREEDOM.COM> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7825945730377291968==" --===============7825945730377291968== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I have a server that has multiple SIDs, They all use 1 listener, I have a - in the bb-roracle.ids file because they all use the same one. I get this: The SID RMAN1 is ok but the RMAN and OEM1 show as down How can I stop the Two red statuses. Any help would be appreciated! Thank you in advance, Becki Oracle Listener Check (rman1) ________________________________ Listener LISTENER_RMAN1 UP Listener LISTENER DOWN Listener LISTENER DOWN --===============7825945730377291968==-- From baugust@stanford.edu Wed Jun 24 08:17:41 2026 From: baugust@stanford.edu To: xymon@xymon.com Subject: [hobbit] oracle question Date: Tue, 20 May 2008 12:39:30 -0700 Message-ID: <20080520123930.uyxzgpc2qs4080sg@webmail.stanford.edu> In-Reply-To: <79CCC36428A60546B48109EFBBB7201C017B3B2D@corp1.FREEDOM.COM> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1051129630393206780==" --===============1051129630393206780== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Can you specify the listener for each SID? I know it's the same, and I know it's the default, but it's worth a shot. Or maybe you can just disable the listener check for those other SIDs, maybe? -- --Ben Benjamin P. August System Administrator - VPUE Stanford University Quoting Rebecca Henderson : > I have a server that has multiple SIDs, > > They all use 1 listener, I have a - in the bb-roracle.ids file because > they all use the same one. > > I get this: The SID RMAN1 is ok but the RMAN and OEM1 show as down How > can I stop the > > Two red statuses. Any help would be appreciated! > > Thank you in advance, > > Becki > > Oracle Listener Check (rman1) > > > > ________________________________ > > > > > Listener LISTENER_RMAN1 UP > Listener LISTENER DOWN > > Listener LISTENER DOWN > > > > > > --===============1051129630393206780==-- From rlapuz@fcpp.fujitsu.com Wed Jun 24 08:17:41 2026 From: rlapuz@fcpp.fujitsu.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Fri, 23 May 2008 10:57:16 +0800 Message-ID: <016d01c8bc80$b55a2a00$398f10ac@oad.fcpp.fujitsu.com> In-Reply-To: <79CCC36428A60546B48109EFBBB7201C017B3B2D@corp1.FREEDOM.COM> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3452610396567305984==" --===============3452610396567305984== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all! Just a follow up newbie question. How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: &yellow Warnings in /var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 -----------------------------------------------------------------------------= --- Listener LISTENER_RMAN1 UP Listener LISTENER DOWN Listener LISTEN= ER DOWN=20 =20 --===============3452610396567305984==-- From josh@imaginenetworksllc.com Wed Jun 24 08:17:41 2026 From: josh@imaginenetworksllc.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Thu, 22 May 2008 23:01:29 -0400 Message-ID: <961092e10805222001x437ced39x8a601416cfeba588@mail.gmail.com> In-Reply-To: <016d01c8bc80$b55a2a00$398f10ac@oad.fcpp.fujitsu.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6314504169684699785==" --===============6314504169684699785== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Pretty sure you'll have to create a custom script and put in the HTML code in the data section of your email. To my knowledge you can't simply stick in text in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz wrote: > Hi all! > > Just a follow up newbie question. > > How can I make hobbit to send me alerts with icon like that alert below? > I am receiving alerts like this: > > &yellow Warnings in href=3D"/hobbit-cgi/bb-hostsvc.sh?CLIENT=3DHOST&SECTION=3Dmsgs:/var/adm= /messages">/var/adm/messages > *Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6* > > > ------------------------------ > > > > > [image: green] Listener LISTENER_RMAN1 UP > > [image: red] Listener LISTENER DOWN > > > > [image: red] Listener LISTENER DOWN > > > > > > --=20 Josh Luthman Office: 937-552-2340 Direct: 937-552-2343 1100 Wayne St Suite 1337 Troy, OH 45373 Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer --===============6314504169684699785==-- From rlapuz@fcpp.fujitsu.com Wed Jun 24 08:17:41 2026 From: rlapuz@fcpp.fujitsu.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Fri, 23 May 2008 11:14:40 +0800 Message-ID: <018701c8bc83$23b26290$398f10ac@oad.fcpp.fujitsu.com> In-Reply-To: <961092e10805222001x437ced39x8a601416cfeba588@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2457333014436607702==" --===============2457333014436607702== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thanks for the quick reply! Make a custom script; can someone share me the their script and teach me how = to configure it? Thanks in advance! Regards. Ryan ----- Original Message -----=20 From: Josh Luthman=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question Pretty sure you'll have to create a custom script and put in the HTML code = in the data section of your email. To my knowledge you can't simply stick in= text in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz wrote: Hi all! Just a follow up newbie question. How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: &yellow Warnings in /var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 ---------------------------------------------------------------------------- Listener LISTENER_RMAN1 UP Listener LISTENER DOWN Listener LISTEN= ER DOWN --=20 Josh Luthman Office: 937-552-2340 Direct: 937-552-2343 1100 Wayne St Suite 1337 Troy, OH 45373 Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer=20 --===============2457333014436607702==-- From josh@imaginenetworksllc.com Wed Jun 24 08:17:41 2026 From: josh@imaginenetworksllc.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Thu, 22 May 2008 23:19:18 -0400 Message-ID: <961092e10805222019n4c45c369y3c6907f7ee878f18@mail.gmail.com> In-Reply-To: <018701c8bc83$23b26290$398f10ac@oad.fcpp.fujitsu.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8193989008041988493==" --===============8193989008041988493== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Here is some (well..only one =3D) custom alert scripts: http://www.trantor.org/theshire/doku.php/alerts On Thu, May 22, 2008 at 11:14 PM, Ryan Jay B. Lapuz wrote: > Thanks for the quick reply! > > Make a custom script; can someone share me the their script and teach me > how to configure it? > > Thanks in advance! > > Regards. > Ryan > > ----- Original Message ----- > *From:* Josh Luthman > *To:* hobbit at hswn.dk > *Sent:* Friday, May 23, 2008 11:01 AM > *Subject:* Re: [hobbit] alert question > > Pretty sure you'll have to create a custom script and put in the HTML code > in the data section of your email. To my knowledge you can't simply stick > in text in the alert Hobbit sends. > > On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz < > rlapuz at fcpp.fujitsu.com> wrote: > >> Hi all! >> >> Just a follow up newbie question. >> >> How can I make hobbit to send me alerts with icon like that alert below? >> I am receiving alerts like this: >> >> &yellow Warnings in > href=3D"/hobbit-cgi/bb-hostsvc.sh?CLIENT=3DHOST&SECTION=3Dmsgs:/var/ad= m/messages">/var/adm/messages >> *Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6* >> >> >> ------------------------------ >> >> >> >> >> [image: green] Listener LISTENER_RMAN1 UP >> >> [image: red] Listener LISTENER DOWN >> >> >> >> [image: red] Listener LISTENER DOWN >> >> >> >> >> >> > > > -- > Josh Luthman > Office: 937-552-2340 > Direct: 937-552-2343 > 1100 Wayne St > Suite 1337 > Troy, OH 45373 > > Those who don't understand UNIX are condemned to reinvent it, poorly. > --- Henry Spencer > > --=20 Josh Luthman Office: 937-552-2340 Direct: 937-552-2343 1100 Wayne St Suite 1337 Troy, OH 45373 Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer --===============8193989008041988493==-- From Andy@zespri.com Wed Jun 24 08:17:41 2026 From: Andy@zespri.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Fri, 23 May 2008 15:32:37 +1200 Message-ID: In-Reply-To: <018701c8bc83$23b26290$398f10ac@oad.fcpp.fujitsu.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1172704518901881818==" --===============1172704518901881818== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Ryan, =20 Here's what I use, in three parts: =20 FIRST: The mail script /opt/hobbit/bin/htmlmail #!/opt/csw/bin/bash # # Script get the following environment variables pre-defined so # that they can send a meaningful alert: # # BBCOLORLEVEL - The current color of the status # BBALPHAMSG - The full text of the status log triggering the alert # ACKCODE - The "cookie" that can be used to acknowledge the alert # RCPT - The recipient, from the SCRIPT entry # BBHOSTNAME - The name of the host that the alert is about # MACHIP - The IP-address of the host that has a problem # BBSVCNAME - The name of the service that the alert is about # BBSVCNUM - The numeric code for the service. From SVCCODES definition. # BBHOSTSVC - HOSTNAME.SERVICE that the alert is about. # BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced with commas # BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCODE. # RECOVERED - Is "1" if the service has recovered. # EVENTSTART - Timestamp when the current status (color) began # DOWNSECS - Number of seconds the service has been down. # DOWNSECSMSG - When recovered, holds the text "Event duration : N" where # N is the DOWNSECS value. # CFID - Line-number in the hobbit-alerts.cfg file that caused the script to be invoked. # Can be useful when troubleshooting alert configuration rules =20 # # Minumum hobbit-alerts.cfg entry - # SCRIPT /opt/hobbit/bin/htmlmail support FORMAT=3DPLAIN # =20 if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi =20 # Convert plain line breaks to HTML breaks =20 # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" =20 # Convert Hobbit colour tags to embedded image tags =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" =20 # Fix link at base of message as they are removed in PLAIN format =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" =20 # Run Perl script to generate email =20 /opt/hobbit/bin/htmlmail.pl > /dev/null 2>&1 SECOND: The perl script to format and send the message /opt/hobbit/bin/htmlmail.pl #!/opt/csw/bin/perl -w =20 use strict; use MIME::Lite; =20 my $rcpt =3D $ENV{'RCPT'}; my $bbhostsvc =3D $ENV{'BBHOSTSVC'}; my $bbcolorlevel =3D $ENV{'BBCOLORLEVEL'}; my $bbalphamsg =3D $ENV{'BBALPHAMSG'}; =20 my $subject =3D $bbhostsvc . " " . $bbcolorlevel; my $htmldata =3D join("", "\n", "\n", "
\n",
	        $bbalphamsg,
	        "\n",
	        "
\n", "
\n", "" ); =20 my $msg =3D MIME::Lite->new ( Subject =3D> $subject, To =3D> $rcpt, Type =3D> 'multipart/related' ); =20 $msg->attach ( Type =3D> 'text/html', Data =3D> $htmldata, ); =20 if($htmldata =3D~ m/blue.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'blue.gif', Path =3D> '/opt/hobbit/server/www/gifs/blue.gif')} if($htmldata =3D~ m/clear.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'clear.gif', Path =3D> '/opt/hobbit/server/www/gifs/clear.gif')} if($htmldata =3D~ m/green.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'green.gif', Path =3D> '/opt/hobbit/server/www/gifs/green.gif')} if($htmldata =3D~ m/purple.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'purple.gif', Path =3D> '/opt/hobbit/server/www/gifs/purple.gif')} if($htmldata =3D~ m/red.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'red.gif', Path =3D> '/opt/hobbit/server/www/gifs/red.gif')} if($htmldata =3D~ m/yellow.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'yellow.gif', Path =3D> '/opt/hobbit/server/www/gifs/yellow.gif')} =20 $msg->send(); THIRD: Configure your hobbit-alerts.cfg lines like this: SCRIPT /opt/hobbit/bin/htmlmail Someone at nowhere.com FORMAT=3DTEXT You will obviously need to adjust all of the paths to suit your installation! And don''t forget to check you have the MIME::Lite perl module and whatever other dependencies it requires. =20 HTH, Andy. =20 ________________________________ From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Friday, 23 May 2008 3:15 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Thanks for the quick reply! =20 Make a custom script; can someone share me the their script and teach me how to configure it? =20 Thanks in advance! =20 Regards. Ryan ----- Original Message -----=20 From: Josh Luthman =20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question Pretty sure you'll have to create a custom script and put in the HTML code in the data section of your email. To my knowledge you can't simply stick in text in the alert Hobbit sends. =09 =09 On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz < rlapuz at fcpp.fujitsu.com> wrote: =09 =09 Hi all! =20 Just a follow up newbie question. =20 How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: =20 &yellow Warnings in /var/adm/messages =09 Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 =09 =09 =09 ________________________________ =20 Listener LISTENER_RMAN1 UP Listener LISTENER DOWN =20 Listener LISTENER DOWN =20 =20 #############################################################################= ######## This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI'). While every effort has been made to verify the information contained herein, ZESPRI does not make any representations=20 as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. #############################################################################= ######## --===============1172704518901881818==-- From philwild@gmail.com Wed Jun 24 08:17:41 2026 From: philwild@gmail.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Fri, 23 May 2008 11:34:07 +0800 Message-ID: <258e9b160805222034x6a86819fl151bc213ee467e3c@mail.gmail.com> In-Reply-To: <961092e10805222019n4c45c369y3c6907f7ee878f18@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0645698707585268167==" --===============0645698707585268167== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Have a read of the hobbit-alerts man page to get you staretd on how alert scripts work. Your script will need to read in the message from the environment variable and do a replace of all the found &colour strings with a URL to each of the coloured gifs from the hobbit web server. You may need to ensure the message is sent as a valid html message etc so it works in your email client. You will also need to reproduce the subject line etc using the env variables that hobbit defines. Cheers Phil 2008/5/23 Josh Luthman : > Here is some (well..only one =3D) custom alert scripts: > > http://www.trantor.org/theshire/doku.php/alerts > > > On Thu, May 22, 2008 at 11:14 PM, Ryan Jay B. Lapuz < > rlapuz at fcpp.fujitsu.com> wrote: > >> Thanks for the quick reply! >> >> Make a custom script; can someone share me the their script and teach me >> how to configure it? >> >> Thanks in advance! >> >> Regards. >> Ryan >> >> ----- Original Message ----- >> *From:* Josh Luthman >> *To:* hobbit at hswn.dk >> *Sent:* Friday, May 23, 2008 11:01 AM >> *Subject:* Re: [hobbit] alert question >> >> Pretty sure you'll have to create a custom script and put in the HTML code >> in the data section of your email. To my knowledge you can't simply stick >> in text in the alert Hobbit sends. >> >> On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz < >> rlapuz at fcpp.fujitsu.com> wrote: >> >>> Hi all! >>> >>> Just a follow up newbie question. >>> >>> How can I make hobbit to send me alerts with icon like that alert below? >>> I am receiving alerts like this: >>> >>> &yellow Warnings in >> href=3D"/hobbit-cgi/bb-hostsvc.sh?CLIENT=3DHOST&SECTION=3Dmsgs:/var/a= dm/messages">/var/adm/messages >>> *Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6* >>> >>> >>> ------------------------------ >>> >>> >>> >>> >>> [image: green] Listener LISTENER_RMAN1 UP >>> >>> [image: red] Listener LISTENER DOWN >>> >>> >>> >>> [image: red] Listener LISTENER DOWN >>> >>> >>> >>> >>> >>> >> >> >> -- >> Josh Luthman >> Office: 937-552-2340 >> Direct: 937-552-2343 >> 1100 Wayne St >> Suite 1337 >> Troy, OH 45373 >> >> Those who don't understand UNIX are condemned to reinvent it, poorly. >> --- Henry Spencer >> >> > > > -- > Josh Luthman > Office: 937-552-2340 > Direct: 937-552-2343 > 1100 Wayne St > Suite 1337 > Troy, OH 45373 > > Those who don't understand UNIX are condemned to reinvent it, poorly. > --- Henry Spencer > --=20 Tel: 0400 466 952 Fax: 0433 123 226 email: philwild AT gmail.com --===============0645698707585268167==-- From rlapuz@fcpp.fujitsu.com Wed Jun 24 08:17:41 2026 From: rlapuz@fcpp.fujitsu.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Fri, 23 May 2008 12:22:24 +0800 Message-ID: <01cf01c8bc8c$9a4a8f00$398f10ac@oad.fcpp.fujitsu.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0715118215975351328==" --===============0715118215975351328== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Phil, Thanks for your help. Hi Andy, Thank you for the script, I'll try to set it up first to my hobbit b= ackup server. Regards to all, Ryan ----- Original Message -----=20 From: Andy France=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:32 AM Subject: RE: [hobbit] alert question Hi Ryan, Here's what I use, in three parts: FIRST: The mail script /opt/hobbit/bin/htmlmail #!/opt/csw/bin/bash # # Script get the following environment variables pre-defined so # that they can send a meaningful alert: # # BBCOLORLEVEL - The current color of the status # BBALPHAMSG - The full text of the status log triggering the alert # ACKCODE - The "cookie" that can be used to acknowledge the ale= rt # RCPT - The recipient, from the SCRIPT entry # BBHOSTNAME - The name of the host that the alert is about # MACHIP - The IP-address of the host that has a problem # BBSVCNAME - The name of the service that the alert is about # BBSVCNUM - The numeric code for the service. From SVCCODES defi= nition. # BBHOSTSVC - HOSTNAME.SERVICE that the alert is about. # BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced wi= th commas # BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCO= DE. # RECOVERED - Is "1" if the service has recovered. # EVENTSTART - Timestamp when the current status (color) began # DOWNSECS - Number of seconds the service has been down. # DOWNSECSMSG - When recovered, holds the text "Event duration : N" = where # N is the DOWNSECS value. # CFID - Line-number in the hobbit-alerts.cfg file that cause= d the script to be invoked. # Can be useful when troubleshooting alert configurati= on rules # # Minumum hobbit-alerts.cfg entry - # SCRIPT /opt/hobbit/bin/htmlmail support FORMAT=3DPLAIN # if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi # Convert plain line breaks to HTML breaks # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" # Convert Hobbit colour tags to embedded image tags export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" # Fix link at base of message as they are removed in PLAIN format export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" # Run Perl script to generate email /opt/hobbit/bin/htmlmail.pl > /dev/null 2>&1 SECOND: The perl script to format and send the message /opt/hobbit/bin/htm= lmail.pl #!/opt/csw/bin/perl -w use strict; use MIME::Lite; my $rcpt =3D $ENV{'RCPT'}; my $bbhostsvc =3D $ENV{'BBHOSTSVC'}; my $bbcolorlevel =3D $ENV{'BBCOLORLEVEL'}; my $bbalphamsg =3D $ENV{'BBALPHAMSG'}; my $subject =3D $bbhostsvc . " " . $bbcolorlevel; my $htmldata =3D join("", "\n", "\n", "
\n",
            $bbalphamsg,
            "\n",
            "
\n", "
\n", "" ); my $msg =3D MIME::Lite->new ( Subject =3D> $subject, To =3D> $rcpt, Type =3D> 'multipart/related' ); $msg->attach ( Type =3D> 'text/html', Data =3D> $htmldata, ); if($htmldata =3D~ m/blue.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'blue.gif', Path =3D= > '/opt/hobbit/server/www/gifs/blue.gif')} if($htmldata =3D~ m/clear.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'clear.gif', Path = =3D> '/opt/hobbit/server/www/gifs/clear.gif')} if($htmldata =3D~ m/green.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'green.gif', Path = =3D> '/opt/hobbit/server/www/gifs/green.gif')} if($htmldata =3D~ m/purple.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'purple.gif', Path = =3D> '/opt/hobbit/server/www/gifs/purple.gif')} if($htmldata =3D~ m/red.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'red.gif', Path =3D>= '/opt/hobbit/server/www/gifs/red.gif')} if($htmldata =3D~ m/yellow.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'yellow.gif', Path = =3D> '/opt/hobbit/server/www/gifs/yellow.gif')} $msg->send(); THIRD: Configure your hobbit-alerts.cfg lines like this: SCRIPT /opt/hobbit/bin/htmlmail Someone at nowhere.com FORMAT=3DTEXT You will obviously need to adjust all of the paths to suit your installatio= n! And don''t forget to check you have the MIME::Lite perl module and whatev= er other dependencies it requires. HTH, Andy. ------------------------------------------------------------------------------ From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Friday, 23 May 2008 3:15 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Thanks for the quick reply! Make a custom script; can someone share me the their script and teach me ho= w to configure it? Thanks in advance! Regards. Ryan ----- Original Message -----=20 From: Josh Luthman=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question Pretty sure you'll have to create a custom script and put in the HTML cod= e in the data section of your email. To my knowledge you can't simply stick = in text in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz wrote: Hi all! Just a follow up newbie question. How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: &yellow Warnings in /var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 -------------------------------------------------------------------------- Listener LISTENER_RMAN1 UP Listener LISTENER DOWN Listener LISTEN= ER DOWN ###########################################################################= ########## This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI'). While every effort has been made to verify the information contained herein, ZESPRI does not make any representations=20 as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. ###########################################################################= ########## --===============0715118215975351328==-- From rlapuz@fcpp.fujitsu.com Wed Jun 24 08:17:42 2026 From: rlapuz@fcpp.fujitsu.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Sat, 24 May 2008 17:18:07 +0800 Message-ID: <01da01c8bd7f$140cd260$398f10ac@oad.fcpp.fujitsu.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1389947426155072112==" --===============1389947426155072112== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Andy,=20 There is a problem with my implementation, please refer to the logs below: error: ./htmlmail: line 30: [: =3D: unary operator expected htmlmail: (start of line 30) if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi # Convert plain line breaks to HTML breaks # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" # Convert Hobbit colour tags to embedded image tags export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" # Fix link at base of message as they are removed in PLAIN format export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" # Run Perl script to generate email /home/hobbit/server/bin/htmlmail.pl > /dev/null 2>&1 /var/log/hobbit/page.log: Paging script /home/hobbit/server/bin/htmlmail terminated with status 2 What seems to be the problem? Thanks in advance! Regards, Ryan ----- Original Message -----=20 From: Andy France=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:32 AM Subject: RE: [hobbit] alert question Hi Ryan, Here's what I use, in three parts: FIRST: The mail script /opt/hobbit/bin/htmlmail #!/opt/csw/bin/bash # # Script get the following environment variables pre-defined so # that they can send a meaningful alert: # # BBCOLORLEVEL - The current color of the status # BBALPHAMSG - The full text of the status log triggering the alert # ACKCODE - The "cookie" that can be used to acknowledge the ale= rt # RCPT - The recipient, from the SCRIPT entry # BBHOSTNAME - The name of the host that the alert is about # MACHIP - The IP-address of the host that has a problem # BBSVCNAME - The name of the service that the alert is about # BBSVCNUM - The numeric code for the service. From SVCCODES defi= nition. # BBHOSTSVC - HOSTNAME.SERVICE that the alert is about. # BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced wi= th commas # BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCO= DE. # RECOVERED - Is "1" if the service has recovered. # EVENTSTART - Timestamp when the current status (color) began # DOWNSECS - Number of seconds the service has been down. # DOWNSECSMSG - When recovered, holds the text "Event duration : N" = where # N is the DOWNSECS value. # CFID - Line-number in the hobbit-alerts.cfg file that cause= d the script to be invoked. # Can be useful when troubleshooting alert configurati= on rules # # Minumum hobbit-alerts.cfg entry - # SCRIPT /opt/hobbit/bin/htmlmail support FORMAT=3DPLAIN # if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi # Convert plain line breaks to HTML breaks # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" # Convert Hobbit colour tags to embedded image tags export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" # Fix link at base of message as they are removed in PLAIN format export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|
&|g'`" # Run Perl script to generate email /opt/hobbit/bin/htmlmail.pl > /dev/null 2>&1 SECOND: The perl script to format and send the message /opt/hobbit/bin/htm= lmail.pl #!/opt/csw/bin/perl -w use strict; use MIME::Lite; my $rcpt =3D $ENV{'RCPT'}; my $bbhostsvc =3D $ENV{'BBHOSTSVC'}; my $bbcolorlevel =3D $ENV{'BBCOLORLEVEL'}; my $bbalphamsg =3D $ENV{'BBALPHAMSG'}; my $subject =3D $bbhostsvc . " " . $bbcolorlevel; my $htmldata =3D join("", "\n", "\n", "
\n",
            $bbalphamsg,
            "\n",
            "
\n", "
\n", "" ); my $msg =3D MIME::Lite->new ( Subject =3D> $subject, To =3D> $rcpt, Type =3D> 'multipart/related' ); $msg->attach ( Type =3D> 'text/html', Data =3D> $htmldata, ); if($htmldata =3D~ m/blue.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'blue.gif', Path =3D= > '/opt/hobbit/server/www/gifs/blue.gif')} if($htmldata =3D~ m/clear.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'clear.gif', Path = =3D> '/opt/hobbit/server/www/gifs/clear.gif')} if($htmldata =3D~ m/green.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'green.gif', Path = =3D> '/opt/hobbit/server/www/gifs/green.gif')} if($htmldata =3D~ m/purple.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'purple.gif', Path = =3D> '/opt/hobbit/server/www/gifs/purple.gif')} if($htmldata =3D~ m/red.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'red.gif', Path =3D>= '/opt/hobbit/server/www/gifs/red.gif')} if($htmldata =3D~ m/yellow.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'yellow.gif', Path = =3D> '/opt/hobbit/server/www/gifs/yellow.gif')} $msg->send(); THIRD: Configure your hobbit-alerts.cfg lines like this: SCRIPT /opt/hobbit/bin/htmlmail Someone at nowhere.com FORMAT=3DTEXT You will obviously need to adjust all of the paths to suit your installatio= n! And don''t forget to check you have the MIME::Lite perl module and whatev= er other dependencies it requires. HTH, Andy. ------------------------------------------------------------------------------ From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Friday, 23 May 2008 3:15 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Thanks for the quick reply! Make a custom script; can someone share me the their script and teach me ho= w to configure it? Thanks in advance! Regards. Ryan ----- Original Message -----=20 From: Josh Luthman=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question Pretty sure you'll have to create a custom script and put in the HTML cod= e in the data section of your email. To my knowledge you can't simply stick = in text in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz wrote: Hi all! Just a follow up newbie question. How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: &yellow Warnings in /var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 -------------------------------------------------------------------------- Listener LISTENER_RMAN1 UP Listener LISTENER DOWN Listener LISTEN= ER DOWN ###########################################################################= ########## This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI'). While every effort has been made to verify the information contained herein, ZESPRI does not make any representations=20 as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. ###########################################################################= ########## --===============1389947426155072112==-- From Galen.Johnson@sas.com Wed Jun 24 08:17:42 2026 From: Galen.Johnson@sas.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Sat, 24 May 2008 10:24:48 -0400 Message-ID: In-Reply-To: <01da01c8bd7f$140cd260$398f10ac@oad.fcpp.fujitsu.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4605101553991544165==" --===============4605101553991544165== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable What shell have you set this to run as? Andy is using bash...(#!/opt/csw/bi/= bash) =3DG=3D From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com] Sent: Saturday, May 24, 2008 5:18 AM To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Hi Andy, There is a problem with my implementation, please refer to the logs below: error: ./htmlmail: line 30: [: =3D: unary operator expected htmlmail: (start of line 30) if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi # Convert plain line breaks to HTML breaks # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" # Convert Hobbit colour tags to embedded image tags export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" # Fix link at base of message as they are removed in PLAIN format export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" # Run Perl script to generate email /home/hobbit/server/bin/htmlmail.pl > /dev/null 2>&1 /var/log/hobbit/page.log: Paging script /home/hobbit/server/bin/htmlmail terminated with status 2 What seems to be the problem? Thanks in advance! Regards, Ryan ----- Original Message ----- From: Andy France To: hobbit at hswn.dk Sent: Friday, May 23, 2008 11:32 AM Subject: RE: [hobbit] alert question Hi Ryan, Here's what I use, in three parts: FIRST: The mail script /opt/hobbit/bin/htmlmail #!/opt/csw/bin/bash # # Script get the following environment variables pre-defined so # that they can send a meaningful alert: # # BBCOLORLEVEL - The current color of the status # BBALPHAMSG - The full text of the status log triggering the alert # ACKCODE - The "cookie" that can be used to acknowledge the alert # RCPT - The recipient, from the SCRIPT entry # BBHOSTNAME - The name of the host that the alert is about # MACHIP - The IP-address of the host that has a problem # BBSVCNAME - The name of the service that the alert is about # BBSVCNUM - The numeric code for the service. From SVCCODES definiti= on. # BBHOSTSVC - HOSTNAME.SERVICE that the alert is about. # BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced with c= ommas # BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCODE. # RECOVERED - Is "1" if the service has recovered. # EVENTSTART - Timestamp when the current status (color) began # DOWNSECS - Number of seconds the service has been down. # DOWNSECSMSG - When recovered, holds the text "Event duration : N" where # N is the DOWNSECS value. # CFID - Line-number in the hobbit-alerts.cfg file that caused th= e script to be invoked. # Can be useful when troubleshooting alert configuration r= ules # # Minumum hobbit-alerts.cfg entry - # SCRIPT /opt/hobbit/bin/htmlmail support FORMAT=3DPLAIN # if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi # Convert plain line breaks to HTML breaks # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" # Convert Hobbit colour tags to embedded image tags export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" # Fix link at base of message as they are removed in PLAIN format export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|
&|g'`" # Run Perl script to generate email /opt/hobbit/bin/htmlmail.pl > /dev/null 2>&1 SECOND: The perl script to format and send the message /opt/hobbit/bin/htmlm= ail.pl #!/opt/csw/bin/perl -w use strict; use MIME::Lite; my $rcpt =3D $ENV{'RCPT'}; my $bbhostsvc =3D $ENV{'BBHOSTSVC'}; my $bbcolorlevel =3D $ENV{'BBCOLORLEVEL'}; my $bbalphamsg =3D $ENV{'BBALPHAMSG'}; my $subject =3D $bbhostsvc . " " . $bbcolorlevel; my $htmldata =3D join("", "\n", "\n", "
\n",
        $bbalphamsg,
        "\n",
        "
\n", "
\n", "" ); my $msg =3D MIME::Lite->new ( Subject =3D> $subject, To =3D> $rcpt, Type =3D> 'multipart/related' ); $msg->attach ( Type =3D> 'text/html', Data =3D> $htmldata, ); if($htmldata =3D~ m/blue.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'blue.gif', Path =3D> '/= opt/hobbit/server/www/gifs/blue.gif')} if($htmldata =3D~ m/clear.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'clear.gif', Path =3D> '= /opt/hobbit/server/www/gifs/clear.gif')} if($htmldata =3D~ m/green.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'green.gif', Path =3D> '= /opt/hobbit/server/www/gifs/green.gif')} if($htmldata =3D~ m/purple.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'purple.gif', Path =3D> = '/opt/hobbit/server/www/gifs/purple.gif')} if($htmldata =3D~ m/red.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'red.gif', Path =3D> '/o= pt/hobbit/server/www/gifs/red.gif')} if($htmldata =3D~ m/yellow.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'yellow.gif', Path =3D> = '/opt/hobbit/server/www/gifs/yellow.gif')} $msg->send(); THIRD: Configure your hobbit-alerts.cfg lines like this: SCRIPT /opt/hobbit/bin/htmlmail Someone at nowhere.com FORMAT=3DTEXT You will obviously need to adjust all of the paths to suit your installation!= And don''t forget to check you have the MIME::Lite perl module and whatever= other dependencies it requires. HTH, Andy. ________________________________ From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com] Sent: Friday, 23 May 2008 3:15 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Thanks for the quick reply! Make a custom script; can someone share me the their script and teach me how = to configure it? Thanks in advance! Regards. Ryan ----- Original Message ----- From: Josh Luthman To: hobbit at hswn.dk Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question Pretty sure you'll have to create a custom script and put in the HTML code in= the data section of your email. To my knowledge you can't simply stick in t= ext in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz > wrote: Hi all! Just a follow up newbie question. How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: &yellow Warnings in
/var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 ________________________________ [cid:image001.gif at 01C8BD88.64EC2A60] Listener LISTENER_RMAN1 UP [cid:image002.gif at 01C8BD88.64EC2A60] Listener LISTENER DOWN [cid:image002.gif at 01C8BD88.64EC2A60] Listener LISTENER DOWN #############################################################################= ######## This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI'). While every effort has been made to verify the information contained herein, ZESPRI does not make any representations as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. #############################################################################= ######## --===============4605101553991544165==-- From rlapuz@fcpp.fujitsu.com Wed Jun 24 08:17:42 2026 From: rlapuz@fcpp.fujitsu.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Mon, 26 May 2008 08:05:02 +0800 Message-ID: <00aa01c8bec4$24fbac40$398f10ac@oad.fcpp.fujitsu.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1477605157005600889==" --===============1477605157005600889== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Galen, I also use bash, (#!/bin/bash). My hobbit is version 2.4.0 w/ all-in-one patc= h and is installed in Fedora Core 6 Thanks in advance! ----- Original Message -----=20 From: Galen Johnson=20 To: hobbit at hswn.dk=20 Sent: Saturday, May 24, 2008 10:24 PM Subject: RE: [hobbit] alert question What shell have you set this to run as? Andy is using bash.(#!/opt/csw/bi/= bash) =20 =3DG=3D =20 From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Saturday, May 24, 2008 5:18 AM To: hobbit at hswn.dk Subject: Re: [hobbit] alert question =20 Hi Andy,=20 =20 There is a problem with my implementation, please refer to the logs below: =20 error: ./htmlmail: line 30: [: =3D: unary operator expected htmlmail: (start of line 30) if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi =20 # Convert plain line breaks to HTML breaks =20 # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" =20 # Convert Hobbit colour tags to embedded image tags =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" =20 # Fix link at base of message as they are removed in PLAIN format =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&= |g'`" =20 # Run Perl script to generate email =20 /home/hobbit/server/bin/htmlmail.pl > /dev/null 2>&1 =20 /var/log/hobbit/page.log: Paging script /home/hobbit/server/bin/htmlmail terminated with status 2 =20 What seems to be the problem? =20 Thanks in advance! =20 Regards, Ryan ----- Original Message -----=20 From: Andy France=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:32 AM Subject: RE: [hobbit] alert question =20 Hi Ryan, =20 Here's what I use, in three parts: =20 FIRST: The mail script /opt/hobbit/bin/htmlmail #!/opt/csw/bin/bash # # Script get the following environment variables pre-defined so # that they can send a meaningful alert: # # BBCOLORLEVEL - The current color of the status # BBALPHAMSG - The full text of the status log triggering the ale= rt # ACKCODE - The "cookie" that can be used to acknowledge the a= lert # RCPT - The recipient, from the SCRIPT entry # BBHOSTNAME - The name of the host that the alert is about # MACHIP - The IP-address of the host that has a problem # BBSVCNAME - The name of the service that the alert is about # BBSVCNUM - The numeric code for the service. From SVCCODES de= finition. # BBHOSTSVC - HOSTNAME.SERVICE that the alert is about. # BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced = with commas # BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACK= CODE. # RECOVERED - Is "1" if the service has recovered. # EVENTSTART - Timestamp when the current status (color) began # DOWNSECS - Number of seconds the service has been down. # DOWNSECSMSG - When recovered, holds the text "Event duration : N= " where # N is the DOWNSECS value. # CFID - Line-number in the hobbit-alerts.cfg file that cau= sed the script to be invoked. # Can be useful when troubleshooting alert configura= tion rules =20 # # Minumum hobbit-alerts.cfg entry - # SCRIPT /opt/hobbit/bin/htmlmail support FORMAT=3DPLAIN # =20 if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi =20 # Convert plain line breaks to HTML breaks =20 # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" =20 # Convert Hobbit colour tags to embedded image tags =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" =20 # Fix link at base of message as they are removed in PLAIN format =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" =20 # Run Perl script to generate email =20 /opt/hobbit/bin/htmlmail.pl > /dev/null 2>&1 SECOND: The perl script to format and send the message /opt/hobbit/bin/h= tmlmail.pl #!/opt/csw/bin/perl -w =20 use strict; use MIME::Lite; =20 my $rcpt =3D $ENV{'RCPT'}; my $bbhostsvc =3D $ENV{'BBHOSTSVC'}; my $bbcolorlevel =3D $ENV{'BBCOLORLEVEL'}; my $bbalphamsg =3D $ENV{'BBALPHAMSG'}; =20 my $subject =3D $bbhostsvc . " " . $bbcolorlevel; my $htmldata =3D join("", "\n", "\n", "
\n",
              $bbalphamsg,
              "\n",
              "
\n", "
\n", "" ); =20 my $msg =3D MIME::Lite->new ( Subject =3D> $subject, To =3D> $rcpt, Type =3D> 'multipart/related' ); =20 $msg->attach ( Type =3D> 'text/html', Data =3D> $htmldata, ); =20 if($htmldata =3D~ m/blue.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'blue.gif', Path = =3D> '/opt/hobbit/server/www/gifs/blue.gif')} if($htmldata =3D~ m/clear.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'clear.gif', Path = =3D> '/opt/hobbit/server/www/gifs/clear.gif')} if($htmldata =3D~ m/green.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'green.gif', Path = =3D> '/opt/hobbit/server/www/gifs/green.gif')} if($htmldata =3D~ m/purple.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'purple.gif', Path= =3D> '/opt/hobbit/server/www/gifs/purple.gif')} if($htmldata =3D~ m/red.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'red.gif', Path = =3D> '/opt/hobbit/server/www/gifs/red.gif')} if($htmldata =3D~ m/yellow.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'yellow.gif', Path= =3D> '/opt/hobbit/server/www/gifs/yellow.gif')} =20 $msg->send(); THIRD: Configure your hobbit-alerts.cfg lines like this: SCRIPT /opt/hobbit/bin/htmlmail Someone at nowhere.com FORMAT=3DTEXT You will obviously need to adjust all of the paths to suit your installat= ion! And don''t forget to check you have the MIME::Lite perl module and what= ever other dependencies it requires. =20 HTH, Andy. =20 =20 ---------------------------------------------------------------------------- From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Friday, 23 May 2008 3:15 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Thanks for the quick reply! =20 Make a custom script; can someone share me the their script and teach me = how to configure it? =20 Thanks in advance! =20 Regards. Ryan ----- Original Message -----=20 From: Josh Luthman=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question =20 Pretty sure you'll have to create a custom script and put in the HTML c= ode in the data section of your email. To my knowledge you can't simply stic= k in text in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz wrote: Hi all! =20 Just a follow up newbie question. =20 How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: =20 &yellow Warnings in /var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 =20 -------------------------------------------------------------------------- =20 Listener LISTENER_RMAN1 UP Listener LISTENER DOWN Listener LISTEN= ER DOWN=20 =20 #########################################################################= ############ This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI'). While every effort has been made to verify the information contained herein, ZESPRI does not make any representations=20 as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. #########################################################################= ############ --===============1477605157005600889==-- From Andy@zespri.com Wed Jun 24 08:17:44 2026 From: Andy@zespri.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Thu, 29 May 2008 22:47:55 +1200 Message-ID: In-Reply-To: <00aa01c8bec4$24fbac40$398f10ac@oad.fcpp.fujitsu.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6536302881126384602==" --===============6536302881126384602== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi again Ryan, =20 Are you testing via the standard hobbit alerting or from a shell? If the latter, it may be because the RECOVERED environment is not set. =20 You could try changing the entry on line 30 to read ${RECOVERED:=3D1} so that it has a value of 1 if it is not set (although you will probably then run into further problems with BBCOLORLEVEL and BBALPHAMSG as well!). =20 Otherwise, you will probably have to set the first line to "#!/bin/bash -x" to get more detailed output of what the script is up to in the logs. =20 Andy. ________________________________ From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Monday, 26 May 2008 12:05 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Hi Galen, =20 I also use bash, (#!/bin/bash). My hobbit is version 2.4.0 w/ all-in-one patch and is installed in Fedora Core 6 Thanks in advance! =20 ----- Original Message -----=20 From: Galen Johnson =20 To: hobbit at hswn.dk=20 Sent: Saturday, May 24, 2008 10:24 PM Subject: RE: [hobbit] alert question What shell have you set this to run as? Andy is using bash...(#!/opt/csw/bi/bash) =20 =3DG=3D =20 From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Saturday, May 24, 2008 5:18 AM To: hobbit at hswn.dk Subject: Re: [hobbit] alert question =20 Hi Andy,=20 =20 There is a problem with my implementation, please refer to the logs below: =20 error: ./htmlmail: line 30: [: =3D: unary operator expected =09 htmlmail: (start of line 30) if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi =20 # Convert plain line breaks to HTML breaks =20 # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" =20 # Convert Hobbit colour tags to embedded image tags =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" =20 # Fix link at base of message as they are removed in PLAIN format =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" =20 # Run Perl script to generate email =20 /home/hobbit/server/bin/htmlmail.pl > /dev/null 2>&1 =20 /var/log/hobbit/page.log: Paging script /home/hobbit/server/bin/htmlmail terminated with status 2 =20 What seems to be the problem? =20 Thanks in advance! =20 Regards, Ryan ----- Original Message -----=20 From: Andy France =20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:32 AM Subject: RE: [hobbit] alert question =20 Hi Ryan, =20 Here's what I use, in three parts: =20 FIRST: The mail script /opt/hobbit/bin/htmlmail #!/opt/csw/bin/bash # # Script get the following environment variables pre-defined so # that they can send a meaningful alert: # # BBCOLORLEVEL - The current color of the status # BBALPHAMSG - The full text of the status log triggering the alert # ACKCODE - The "cookie" that can be used to acknowledge the alert # RCPT - The recipient, from the SCRIPT entry # BBHOSTNAME - The name of the host that the alert is about # MACHIP - The IP-address of the host that has a problem # BBSVCNAME - The name of the service that the alert is about # BBSVCNUM - The numeric code for the service. From SVCCODES definition. # BBHOSTSVC - HOSTNAME.SERVICE that the alert is about. # BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced with commas # BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCODE. # RECOVERED - Is "1" if the service has recovered. # EVENTSTART - Timestamp when the current status (color) began # DOWNSECS - Number of seconds the service has been down. # DOWNSECSMSG - When recovered, holds the text "Event duration : N" where # N is the DOWNSECS value. # CFID - Line-number in the hobbit-alerts.cfg file that caused the script to be invoked. # Can be useful when troubleshooting alert configuration rules =20 # # Minumum hobbit-alerts.cfg entry - # SCRIPT /opt/hobbit/bin/htmlmail support FORMAT=3DPLAIN # =20 if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi =20 # Convert plain line breaks to HTML breaks =20 # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" =20 # Convert Hobbit colour tags to embedded image tags =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" =20 # Fix link at base of message as they are removed in PLAIN format =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" =20 # Run Perl script to generate email =20 /opt/hobbit/bin/htmlmail.pl > /dev/null 2>&1 SECOND: The perl script to format and send the message /opt/hobbit/bin/htmlmail.pl #!/opt/csw/bin/perl -w =20 use strict; use MIME::Lite; =20 my $rcpt =3D $ENV{'RCPT'}; my $bbhostsvc =3D $ENV{'BBHOSTSVC'}; my $bbcolorlevel =3D $ENV{'BBCOLORLEVEL'}; my $bbalphamsg =3D $ENV{'BBALPHAMSG'}; =20 my $subject =3D $bbhostsvc . " " . $bbcolorlevel; my $htmldata =3D join("", "\n", "\n", "
\n",
			        $bbalphamsg,
			        "\n",
			        "
\n", "
\n", "" ); =20 my $msg =3D MIME::Lite->new ( Subject =3D> $subject, To =3D> $rcpt, Type =3D> 'multipart/related' ); =20 $msg->attach ( Type =3D> 'text/html', Data =3D> $htmldata, ); =20 if($htmldata =3D~ m/blue.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'blue.gif', Path =3D> '/opt/hobbit/server/www/gifs/blue.gif')} if($htmldata =3D~ m/clear.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'clear.gif', Path =3D> '/opt/hobbit/server/www/gifs/clear.gif')} if($htmldata =3D~ m/green.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'green.gif', Path =3D> '/opt/hobbit/server/www/gifs/green.gif')} if($htmldata =3D~ m/purple.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'purple.gif', Path =3D> '/opt/hobbit/server/www/gifs/purple.gif')} if($htmldata =3D~ m/red.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'red.gif', Path =3D> '/opt/hobbit/server/www/gifs/red.gif')} if($htmldata =3D~ m/yellow.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'yellow.gif', Path =3D> '/opt/hobbit/server/www/gifs/yellow.gif')} =20 $msg->send(); THIRD: Configure your hobbit-alerts.cfg lines like this: SCRIPT /opt/hobbit/bin/htmlmail=20 Someone at nowhere.com FORMAT=3DTEXT You will obviously need to adjust all of the paths to suit your installation! And don''t forget to check you have the MIME::Lite perl module and whatever other dependencies it requires. =20 HTH, Andy. =20 =20 ________________________________ From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com] Sent: Friday, 23 May 2008 3:15 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Thanks for the quick reply! =20 Make a custom script; can someone share me the their script and teach me how to configure it? =20 Thanks in advance! =20 Regards. Ryan ----- Original Message -----=20 From: Josh Luthman =20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question =20 Pretty sure you'll have to create a custom script and put in the HTML code in the data section of your email. To my knowledge you can't simply stick in text in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz wrote: Hi all! =20 Just a follow up newbie question. =20 How can I make hobbit to send me alerts with icon like that alert below? I am receiving alerts like this: =20 &yellow Warnings in /var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 =20 ________________________________ =20 =20 Listener LISTENER_RMAN1 UP Listener LISTENER DOWN =20 Listener LISTENER DOWN =20 #############################################################################= ######## This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI'). While every effort has been made to verify the information contained herein, ZESPRI does not make any representations=20 as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. #############################################################################= ######## --===============6536302881126384602==-- From rlapuz@fcpp.fujitsu.com Wed Jun 24 08:17:44 2026 From: rlapuz@fcpp.fujitsu.com To: xymon@xymon.com Subject: [hobbit] alert question Date: Fri, 30 May 2008 14:31:44 +0800 Message-ID: <03d701c8c21e$d6626840$398f10ac@oad.fcpp.fujitsu.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1219005696430371832==" --===============1219005696430371832== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Andy, Thanks for your help. Now, I am receiving alerts like this: subj: HOST.msgs yellow yellow System logs at Fri May 30 10:46:18 HKT 2008 Warnings in /var/adm/sulog SU 05/30 10:11 + pts/11 user-root No entries in /var/adm/messages Full log /var/adm/messages Full log /var/adm/sulog SU 05/30 10:11 + pts/11 user-root See http://hobbit/hobbit-cgi/bb-hostsvc.sh?HOST=3Dhost&SERVICE=3Dmsgs and; subj: HOST.msgs RECOVERED green System logs at Fri May 30 10:51:20 HKT 2008 No entries in /var/adm/messages No entries in /var/adm/sulog Full log /var/adm/messages Full log /var/adm/sulog See http://hobbit/hobbit-cgi/bb-hostsvc.sh?HOST=3DHOST&SERVICE=3Dmsgs Is this the normal email alert from your script? Thanks again and regards, Ryan ----- Original Message -----=20 From: Andy France=20 To: hobbit at hswn.dk=20 Sent: Thursday, May 29, 2008 6:47 PM Subject: RE: [hobbit] alert question Hi again Ryan, Are you testing via the standard hobbit alerting or from a shell? If the l= atter, it may be because the RECOVERED environment is not set. You could try changing the entry on line 30 to read ${RECOVERED:=3D1} so th= at it has a value of 1 if it is not set (although you will probably then run = into further problems with BBCOLORLEVEL and BBALPHAMSG as well!). Otherwise, you will probably have to set the first line to "#!/bin/bash -x"= to get more detailed output of what the script is up to in the logs. Andy. ------------------------------------------------------------------------------ From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Monday, 26 May 2008 12:05 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Hi Galen, I also use bash, (#!/bin/bash). My hobbit is version 2.4.0 w/ all-in-one pa= tch and is installed in Fedora Core 6 Thanks in advance! ----- Original Message -----=20 From: Galen Johnson=20 To: hobbit at hswn.dk=20 Sent: Saturday, May 24, 2008 10:24 PM Subject: RE: [hobbit] alert question What shell have you set this to run as? Andy is using bash.(#!/opt/csw/b= i/bash) =20 =3DG=3D =20 From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Saturday, May 24, 2008 5:18 AM To: hobbit at hswn.dk Subject: Re: [hobbit] alert question =20 Hi Andy,=20 =20 There is a problem with my implementation, please refer to the logs below: =20 error: ./htmlmail: line 30: [: =3D: unary operator expected htmlmail: (start of line 30) if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi =20 # Convert plain line breaks to HTML breaks =20 # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" =20 # Convert Hobbit colour tags to embedded image tags =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" =20 # Fix link at base of message as they are removed in PLAIN format =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" =20 # Run Perl script to generate email =20 /home/hobbit/server/bin/htmlmail.pl > /dev/null 2>&1 =20 /var/log/hobbit/page.log: Paging script /home/hobbit/server/bin/htmlmail terminated with status 2 =20 What seems to be the problem? =20 Thanks in advance! =20 Regards, Ryan ----- Original Message -----=20 From: Andy France=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:32 AM Subject: RE: [hobbit] alert question =20 Hi Ryan, =20 Here's what I use, in three parts: =20 FIRST: The mail script /opt/hobbit/bin/htmlmail #!/opt/csw/bin/bash # # Script get the following environment variables pre-defined so # that they can send a meaningful alert: # # BBCOLORLEVEL - The current color of the status # BBALPHAMSG - The full text of the status log triggering the a= lert # ACKCODE - The "cookie" that can be used to acknowledge the= alert # RCPT - The recipient, from the SCRIPT entry # BBHOSTNAME - The name of the host that the alert is about # MACHIP - The IP-address of the host that has a problem # BBSVCNAME - The name of the service that the alert is about # BBSVCNUM - The numeric code for the service. From SVCCODES = definition. # BBHOSTSVC - HOSTNAME.SERVICE that the alert is about. # BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replace= d with commas # BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and A= CKCODE. # RECOVERED - Is "1" if the service has recovered. # EVENTSTART - Timestamp when the current status (color) began # DOWNSECS - Number of seconds the service has been down. # DOWNSECSMSG - When recovered, holds the text "Event duration := N" where # N is the DOWNSECS value. # CFID - Line-number in the hobbit-alerts.cfg file that c= aused the script to be invoked. # Can be useful when troubleshooting alert configu= ration rules =20 # # Minumum hobbit-alerts.cfg entry - # SCRIPT /opt/hobbit/bin/htmlmail support FORMAT=3DPLAIN # =20 if [ ${RECOVERED} =3D 1 ] then export BBCOLORLEVEL=3D"RECOVERED" export BBCOLOR=3D"green" else export BBCOLOR=3D$BBCOLORLEVEL fi =20 # Convert plain line breaks to HTML breaks =20 # export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed '/>$/!s/$/
/'`" =20 # Convert Hobbit colour tags to embedded image tags =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&blue//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&clear//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&green//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&purple//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&red//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&unknown//g'`" export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's/&yellow//g'`" =20 # Fix link at base of message as they are removed in PLAIN format =20 export BBALPHAMSG=3D"`echo \"$BBALPHAMSG\" | sed 's|http:.*|&|g'`" =20 # Run Perl script to generate email =20 /opt/hobbit/bin/htmlmail.pl > /dev/null 2>&1 SECOND: The perl script to format and send the message /opt/hobbit/bin= /htmlmail.pl #!/opt/csw/bin/perl -w =20 use strict; use MIME::Lite; =20 my $rcpt =3D $ENV{'RCPT'}; my $bbhostsvc =3D $ENV{'BBHOSTSVC'}; my $bbcolorlevel =3D $ENV{'BBCOLORLEVEL'}; my $bbalphamsg =3D $ENV{'BBALPHAMSG'}; =20 my $subject =3D $bbhostsvc . " " . $bbcolorlevel; my $htmldata =3D join("", "\n", "\n", "
\n",
                $bbalphamsg,
                "\n",
                "
\n", "
\n", "" ); =20 my $msg =3D MIME::Lite->new ( Subject =3D> $subject, To =3D> $rcpt, Type =3D> 'multipart/related' ); =20 $msg->attach ( Type =3D> 'text/html', Data =3D> $htmldata, ); =20 if($htmldata =3D~ m/blue.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'blue.gif', Path= =3D> '/opt/hobbit/server/www/gifs/blue.gif')} if($htmldata =3D~ m/clear.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'clear.gif', Pat= h =3D> '/opt/hobbit/server/www/gifs/clear.gif')} if($htmldata =3D~ m/green.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'green.gif', Pat= h =3D> '/opt/hobbit/server/www/gifs/green.gif')} if($htmldata =3D~ m/purple.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'purple.gif', Pa= th =3D> '/opt/hobbit/server/www/gifs/purple.gif')} if($htmldata =3D~ m/red.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'red.gif', Path = =3D> '/opt/hobbit/server/www/gifs/red.gif')} if($htmldata =3D~ m/yellow.gif/) {$msg->attach(Type =3D> 'image/gif', Id =3D> 'yellow.gif', Pa= th =3D> '/opt/hobbit/server/www/gifs/yellow.gif')} =20 $msg->send(); THIRD: Configure your hobbit-alerts.cfg lines like this: SCRIPT /opt/hobbit/bin/htmlmail Someone at nowhere.com FORMAT=3DTEXT You will obviously need to adjust all of the paths to suit your install= ation! And don''t forget to check you have the MIME::Lite perl module and wh= atever other dependencies it requires. =20 HTH, Andy. =20 =20 -------------------------------------------------------------------------- From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com]=20 Sent: Friday, 23 May 2008 3:15 p.m. To: hobbit at hswn.dk Subject: Re: [hobbit] alert question Thanks for the quick reply! =20 Make a custom script; can someone share me the their script and teach m= e how to configure it? =20 Thanks in advance! =20 Regards. Ryan ----- Original Message -----=20 From: Josh Luthman=20 To: hobbit at hswn.dk=20 Sent: Friday, May 23, 2008 11:01 AM Subject: Re: [hobbit] alert question =20 Pretty sure you'll have to create a custom script and put in the HTML= code in the data section of your email. To my knowledge you can't simply st= ick in text in the alert Hobbit sends. On Thu, May 22, 2008 at 10:57 PM, Ryan Jay B. Lapuz wrote: Hi all! =20 Just a follow up newbie question. =20 How can I make hobbit to send me alerts with icon like that alert bel= ow? I am receiving alerts like this: =20 &yellow Warnings in /var/adm/messages Hobbit 4.2.0 w/ all-in-one patch instaled in Fedora Core 6 =20 ------------------------------------------------------------------------ =20 Listener LISTENER_RMAN1 UP Listener LISTENER DOWN Listener LISTEN= ER DOWN ###########################################################################= ########## This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI'). While every effort has been made to verify the information contained herein, ZESPRI does not make any representations=20 as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. ###########################################################################= ########## --===============1219005696430371832==--