Xymon Mailing List Archive search

Hobbit sending HTML emails?

7 messages in this thread

list Charles Jones Charljon · Fri, 28 Oct 2005 12:46:58 -0700 ·
 
I've setup a Hobbit 4.1.2 instance and have been getting emails from it
that have HTML tags in them, but aren't recognized by either MS Outlook
or Mozilla Thunderbird as an HTML-email. So, either hobbit isn't
properly setting the header on the mails it sends, or something about
the alert output is causing the problem. 

The alert below is an example of how the emails I'm getting look, with
bare HTML tags in the message. The alert text itself is from the
"bb-roracle.ksh" script which checks the health of an Oracle database.
I have sanitized the alert text to remove any private information but
otherwise is the same text that I received.


-----Original Message-----
From: user-5c8ec6c92842@xymon.invalid [mailto:user-5c8ec6c92842@xymon.invalid] 
Sent: Friday, October 28, 2005 1:11 PM
To: user-e86b4aeade4e@xymon.invalid
Subject: Hobbit [70835] oradb5.mydomain.com:oradb CRITICAL (RED)

red Fri Oct 28 12:03:27 MST 2005
</pre>


<br><br><FONT SIZE=+2><b>Process Check</b></FONT> (MYDB)<hr>
<br>   &green Database MYDB UP processes:  ckpt dbw0 lgwr pmon reco smon
<br>

<br><br><FONT SIZE=+2><b>Database Checks</b></FONT> (MYDB)<hr>
   &green Database check: MYDB is up

<br><br><FONT SIZE=+2><b>User Count Check</b></FONT> (MYDB)<hr>
    Oracle Users in MYDB:        6


<br><br><FONT SIZE=+2><b>User Check</b></FONT> (MREDW)<hr>
<pre>
username             osuser               machine              term

		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
DB1			     oracle		  oradb5.mydomain
unknown
DB1			     oracle		  oradb5.mydomain
unknown
BB			     bb 		  oradb5
DB1			     oracle		  oradb5.mydomain
unknown
DB1			     oracle		  oradb5.mydomain
unknown
11 rows selected.
</pre>

<br><br><FONT SIZE=+2><b>Tablespace Check</b></FONT> (MYDB)<hr>
<br>   &green Tablespace MYDB:TEST totals 3000.0Mb and is <B>26%</B>
used.
<br>   &green Tablespace MYDB:UNDO totals 1000.0Mb and is <B>52%</B>
used.
<br>   &green Tablespace MYDB:TABLE1 totals 5000.0Mb and is <B>44%</B>
used.
<br>   &green Tablespace MYDB:TEMP totals 13000.0Mb and is <B>0%</B>
used.
<br>   &green Tablespace MYDB:SYSTEM totals 1000.0Mb and is <B>14%</B>
used.
<br>   &green Tablespace MYDB:TABLE2 totals 2000.0Mb and is <B>9%</B>
used.
<br>   &green Tablespace MYDB:TABLE3 totals 11218.0Mb and is <B>81%</B>
used.
<br>   &green Tablespace MYDB:TABLE4 totals 4000.0Mb and is <B>29%</B>
used.
<br>   &green Tablespace MYDB:TABLE5 totals 1000.0Mb and is <B>39%</B>
used.
<br>   &green Tablespace MYDB:TABLE6 totals 10000.0Mb and is <B>0%</B>
used.
<br>   &green Tablespace MYDB:TABLE7 totals 12825.0Mb and is <B>89%</B>
used.
<br>   &green Tablespace MYDB:TABLE8 totals 5230.0Mb and is <B>72%</B>
used.
<br><I>   &green Total Tablespace including Temp:   <B>69273</B>Mb</I>

<br><br><FONT SIZE=+2><b>Extent Check</b></FONT> (MYDB)<hr>
<br>   &green No objects are exceeding 60%. Extent test ok.
<br>   &clear Shadow check: Disabled
<br>   &clear Pin Hit Ratio check: Disabled
<br>   &clear Sql Area Hit Ratio check: Disabled
<br>   &clear Block Buffer Hit Ratio check: Disabled

<br><br><FONT SIZE=+2><b>Shared Memory Check</b></FONT> (MYDB)<hr>
<br>   &green Database MYDB: No Request Failures.
<br><br>      Free Space is 1311K, AVG Free Space is 328K, Used Space is
0K, AVG Used Space is 0K.
<br>   &clear RollBack check: Disabled
<br>   &clear Invalid Object check: Disabled

<br><br><FONT SIZE=+2><b>Deadlock Check</b></FONT> (MYDB)<hr>
<br>   &red <B><U><FONT COLOR=RED>SID 0</FONT></U></B> Blocker 1
Requester 2.
<br>   &red <B><U><FONT COLOR=RED>SID 3</FONT></U></B> Blocker 4
Requester 5.


<br><br><FONT SIZE=+2><b>Process Check</b></FONT> (MYDB2)<hr>
<br>   &green Database MYDB2 UP processes:  ckpt dbw0 lgwr pmon reco
smon
<br>

<br><br><FONT SIZE=+2><b>Database Checks</b></FONT> (MYDB2)<hr>
   &green Database check: MYDB2 is up

<br><br><FONT SIZE=+2><b>User Count Check</b></FONT> (MYDB2)<hr>
    Oracle Users in MYDB2:        0


<br><br><FONT SIZE=+2><b>User Check</b></FONT> (MYDB2)<hr>
<pre>
username             osuser               machine              term

		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
		     oracle		  	oradb5	       UNKNOWN
BB		     bb 		  	oradb5
7 rows selected.
</pre>
<br>   &clear Tablespace check: Disabled

<br><br><FONT SIZE=+2><b>Extent Check</b></FONT> (MYDB2)<hr>
<br>   &green No objects are exceeding 60%. Extent test ok.
<br>   &clear Shadow check: Disabled
<br>   &clear Pin Hit Ratio check: Disabled
<br>   &clear Sql Area Hit Ratio check: Disabled
<br>   &clear Block Buffer Hit Ratio check: Disabled

<br><br><FONT SIZE=+2><b>Shared Memory Check</b></FONT> (MYDB2)<hr>
<br>   &green Database MYDB2: No Request Failures.
<br><br>      Free Space is 1054K, AVG Free Space is 88K, Used Space is
0K, AVG Used Space is 0K.
<br>   &clear RollBack check: Disabled
<br>   &clear Invalid Object check: Disabled

<br><br><FONT SIZE=+2><b>Deadlock Check</b></FONT> (MYDB2)<hr>
<br>   &green Database MYDB2: No deadlocks detected.


<br><br><FONT SIZE=+2><b>Process Check</b></FONT> (MYDB3)<hr>
<br>   &green Database MYDB3 UP processes:  ckpt dbw0 lgwr pmon reco
smon
<br>

<br><br><FONT SIZE=+2><b>Database Checks</b></FONT> (MYDB3)<hr>
   &green Database check: MYDB3 is up

<br><br><FONT SIZE=+2><b>User Count Check</b></FONT> (MYDB3)<hr>
    Oracle Users in MYDB3:        0


<br><br><FONT SIZE=+2><b>User Check</b></FONT> (MYDB3)<hr>
<pre>
username             osuser               machine              term

		     oracle		  oradb5	       UNKNOWN
		     oracle		  oradb5	       UNKNOWN
		     oracle		  oradb5	       UNKNOWN
		     oracle		  oradb5	       UNKNOWN
		     oracle		  oradb5	       UNKNOWN
		     oracle		  oradb5	       UNKNOWN
SYS		     bb 		  oradb5
7 rows selected.
</pre>
<br>   &clear Tablespace check: Disabled

<br><br><FONT SIZE=+2><b>Extent Check</b></FONT> (MYDB3)<hr>
<br>   &green No objects are exceeding 60%. Extent test ok.
<br>   &clear Shadow check: Disabled
<br>   &clear Pin Hit Ratio check: Disabled
<br>   &clear Sql Area Hit Ratio check: Disabled
<br>   &clear Block Buffer Hit Ratio check: Disabled

<br><br><FONT SIZE=+2><b>Shared Memory Check</b></FONT> (MYDB3)<hr>
<br>   &green Database MYDB3: No Request Failures.
<br><br>      Free Space is 1311K, AVG Free Space is 328K, Used Space is
0K, AVG Used Space is 0K.
<br>   &clear RollBack check: Disabled
<br>   &clear Invalid Object check: Disabled

<br><br><FONT SIZE=+2><b>Deadlock Check</b></FONT> (MYDB3)<hr>
<br>   &green Database MYDB3: No deadlocks detected.

<br><br><center><hr>bb-roracle.ksh <b>Version:</b> 2.06</center>
See
http://hobbit.mydomain.com/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=oradb5,mydom
ain,com.oradb
list Henrik Størner · Fri, 28 Oct 2005 21:53:15 +0200 ·
quoted from Charles Jones Charljon
On Fri, Oct 28, 2005 at 12:46:58PM -0700, Charles Jones (charljon) wrote:
 
I've setup a Hobbit 4.1.2 instance and have been getting emails from it
that have HTML tags in them, but aren't recognized by either MS Outlook
or Mozilla Thunderbird as an HTML-email. So, either hobbit isn't
properly setting the header on the mails it sends, or something about
the alert output is causing the problem. 
Unless you changed something special in your setup, Hobbit handles
all alerts as plain text, and just feeds them into your local "mail"
utility.
quoted from Charles Jones Charljon
The alert below is an example of how the emails I'm getting look, with
bare HTML tags in the message.
I'm 99% sure this is an external add-on test that generates a status
in HTML format.


Regards,
Henrik
list Adam Scheblein · Fri, 28 Oct 2005 15:56:31 -0500 ·
There is a way to make your mail program send html e-mails, however, if
you check your version to make sure it has the -a, then under the mail
variable, set it to be (and it shouldn't matter if you use mail or
mailx):

mailx -a "Content-type: text/html;"

Adam
quoted from Henrik Størner

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Friday, October 28, 2005 2:53 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Hobbit sending HTML emails?

On Fri, Oct 28, 2005 at 12:46:58PM -0700, Charles Jones (charljon)
wrote:
 
I've setup a Hobbit 4.1.2 instance and have been getting emails from
it
that have HTML tags in them, but aren't recognized by either MS
Outlook
or Mozilla Thunderbird as an HTML-email. So, either hobbit isn't
properly setting the header on the mails it sends, or something about
the alert output is causing the problem. 
Unless you changed something special in your setup, Hobbit handles
all alerts as plain text, and just feeds them into your local "mail"
utility.
The alert below is an example of how the emails I'm getting look, with
bare HTML tags in the message.
I'm 99% sure this is an external add-on test that generates a status
in HTML format.


Regards,
Henrik
list Robert Taylor · Sat, 29 Oct 2005 19:27:30 -0400 ·
Another option is to write  custom alert script and set that as the action for the alert.  I have written just such a script so that my MRTG and UPS alerts come in as HTML and include the appropriate graphs.  I would be happy to email it to you if you would like, just be forwarned that I am not a developer so run at your own risk ;-).
 
Robert

	-----Original Message----- 
	From: Scheblein, Adam [mailto:user-de8d51f0c651@xymon.invalid] 
	Sent: Fri 10/28/2005 4:56 PM 
	To: user-ae9b8668bcde@xymon.invalid 
	Cc: 
quoted from Adam Scheblein
	Subject: RE: [hobbit] Hobbit sending HTML emails?
	
	
	There is a way to make your mail program send html e-mails, however, if
	you check your version to make sure it has the -a, then under the mail
	variable, set it to be (and it shouldn't matter if you use mail or
	mailx):
	
	mailx -a "Content-type: text/html;"
	
	Adam
	
	-----Original Message-----
	From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
	Sent: Friday, October 28, 2005 2:53 PM
	To: user-ae9b8668bcde@xymon.invalid
	Subject: Re: [hobbit] Hobbit sending HTML emails?
	
	On Fri, Oct 28, 2005 at 12:46:58PM -0700, Charles Jones (charljon)
	wrote:
I've setup a Hobbit 4.1.2 instance and have been getting emails from
	it
that have HTML tags in them, but aren't recognized by either MS
	Outlook
or Mozilla Thunderbird as an HTML-email. So, either hobbit isn't
properly setting the header on the mails it sends, or something about
the alert output is causing the problem.
	
	Unless you changed something special in your setup, Hobbit handles
	all alerts as plain text, and just feeds them into your local "mail"
	utility.
	
The alert below is an example of how the emails I'm getting look, with
bare HTML tags in the message.
	
	I'm 99% sure this is an external add-on test that generates a status
	in HTML format.
	
	
	Regards,
	Henrik
list Charles Jones · Fri, 04 Nov 2005 07:19:17 -0700 ·
Just for fun I grabbed the latest snapshot and tried to compile it on my Solaris10 server at home. I ran into a couple of problems which I was able to fix.  Long gory details below, quick summary at the bottom.

I configured with all default options, except no to LDAP.  Here's the results:

[hobbit at ultra5 snapshot]$ make
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I`pwd`/include -I/usr/local/include" OSDEF="-DSunOS" RPATHOPT="" PCREINCDIR="-I/usr/local/include" SSLFLAGS="-DBBGEN_SSL" SSLINCDIR="-I/usr/local/ssl/include " SSLLIBS="-L/usr/lib -lssl -lcrypto" NETLIBS="-lresolv -lsocket -lnsl" BBTOPDIR="/home/hobbit" BBLOGDIR="/var/log/hobbit" BBHOSTNAME="ultra5" BBHOSTIP="192.168.0.103" BBHOSTOS="sunos" make -C lib all
make[1]: Entering directory `/home/hobbit/snapshot/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/hobbit/snapshot/lib'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I`pwd`/include -I/usr/local/include" RPATHOPT="" SSLFLAGS="-DBBGEN_SSL" SSLINCDIR="-I/usr/local/ssl/include " SSLLIBS="-L/usr/lib -lssl -lcrypto" NETLIBS="-lresolv -lsocket -lnsl" BBHOME="/home/hobbit/server" make -C common all
make[1]: Entering directory `/home/hobbit/snapshot/common'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I/home/hobbit/snapshot/include -I/usr/local/include -o bbhostgrep bbhostgrep.o ../lib/libbbgen.a
Undefined                       first referenced
 symbol                             in file
recv                                ../lib/libbbgen.a(sendmsg.o)
getservbyname                       ../lib/libbbgen.a(sendmsg.o)
gethostbyname                       ../lib/libbbgen.a(sendmsg.o)
socket                              ../lib/libbbgen.a(sendmsg.o)
getsockopt                          ../lib/libbbgen.a(sendmsg.o)
connect                             ../lib/libbbgen.a(sendmsg.o)
inet_aton                           ../lib/libbbgen.a(sendmsg.o)
inet_ntoa                           ../lib/libbbgen.a(sendmsg.o)
shutdown                            ../lib/libbbgen.a(sendmsg.o)
ld: fatal: Symbol referencing errors. No output written to bbhostgrep
collect2: ld returned 1 exit status
make[1]: *** [bbhostgrep] Error 1
make[1]: Leaving directory `/home/hobbit/snapshot/common'
make: *** [common-build] Error 2

These errors are typical of missing networking libraries (resolv,socket,nsl), so I checked the Makefile and added $(NETLIBS) to snapshot/common/Makefile

bbhostgrep: $(HOSTGREPOBJS) ../lib/libbbgen.a
        $(CC) $(CFLAGS) -o $@ $(HOSTGREPOBJS) ../lib/libbbgen.a *$(NETLIBS)*

I then did a "make clean" and ran make again. This time I get this error:

make[1]: Leaving directory `/home/hobbit/snapshot/common'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I`pwd`/include -I/usr/local/include" BBHOME="/home/hobbit/client" BBHOSTIP="192.168.0.103" LOCALCLIENT="" make -C client all
make[1]: Entering directory `/home/hobbit/snapshot/client'
cat hobbitclient.cfg.DIST | sed -e's!@BBHOSTIP@!192.168.0.103!g'  >hobbitclient.cfg
make[1]: *** [hobbitclient.cfg] Error 2
make[1]: Leaving directory `/home/hobbit/snapshot/client'
make: *** [client] Error 2

I checked to see if /home/hobbit/snapshot/client/hobbitclient.cfg was created, and it was, but zero bytes.
So, I checked the hobbitclient.cfg.DIST to make sure it had data in it and it did, I then I decided to check the sed command being used:
 "sed -e's!@BBHOSTIP@!192.168.0.103!g'". 
The syntax of that looks correct but when I tried it on the command line, it didn't work! So then I grepped for sed in all of the Makefiles, and found many usages of sed, but all the others had one difference, *a space after the -e option*. I changed the sed commands in snapshot/client/Makefile to have a space after the "-e" option, did a make clean; make; and now it compiled smoothly.

--- Summary ---
So, to summarize, for Solaris compatibility in the latest snapshot, please add the netlibs to the snapshot/common/Makefile, and correct the spacing of the sed command options in snapshot/client/Makefile.

-Charles
list Charles Jones · Fri, 04 Nov 2005 16:13:13 -0700 ·
Just for fun I grabbed the latest snapshot and tried to compile it on my Solaris10 server at home. I ran into a couple of problems which I was able to fix.  Long gory details below, quick summary at the bottom.

I configured with all default options, except no to LDAP.  Here's the results:

[hobbit at ultra5 snapshot]$ make
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I`pwd`/include -I/usr/local/include" OSDEF="-DSunOS" RPATHOPT="" PCREINCDIR="-I/usr/local/include" SSLFLAGS="-DBBGEN_SSL" SSLINCDIR="-I/usr/local/ssl/include " SSLLIBS="-L/usr/lib -lssl -lcrypto" NETLIBS="-lresolv -lsocket -lnsl" BBTOPDIR="/home/hobbit" BBLOGDIR="/var/log/hobbit" BBHOSTNAME="ultra5" BBHOSTIP="192.168.0.103" BBHOSTOS="sunos" make -C lib all
make[1]: Entering directory `/home/hobbit/snapshot/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/hobbit/snapshot/lib'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I`pwd`/include -I/usr/local/include" RPATHOPT="" SSLFLAGS="-DBBGEN_SSL" SSLINCDIR="-I/usr/local/ssl/include " SSLLIBS="-L/usr/lib -lssl -lcrypto" NETLIBS="-lresolv -lsocket -lnsl" BBHOME="/home/hobbit/server" make -C common all
make[1]: Entering directory `/home/hobbit/snapshot/common'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I/home/hobbit/snapshot/include -I/usr/local/include -o bbhostgrep bbhostgrep.o ../lib/libbbgen.a
Undefined                       first referenced
 symbol                             in file
recv                                ../lib/libbbgen.a(sendmsg.o)
getservbyname                       ../lib/libbbgen.a(sendmsg.o)
gethostbyname                       ../lib/libbbgen.a(sendmsg.o)
socket                              ../lib/libbbgen.a(sendmsg.o)
getsockopt                          ../lib/libbbgen.a(sendmsg.o)
connect                             ../lib/libbbgen.a(sendmsg.o)
inet_aton                           ../lib/libbbgen.a(sendmsg.o)
inet_ntoa                           ../lib/libbbgen.a(sendmsg.o)
shutdown                            ../lib/libbbgen.a(sendmsg.o)
ld: fatal: Symbol referencing errors. No output written to bbhostgrep
collect2: ld returned 1 exit status
make[1]: *** [bbhostgrep] Error 1
make[1]: Leaving directory `/home/hobbit/snapshot/common'
make: *** [common-build] Error 2

These errors are typical of missing networking libraries (resolv,socket,nsl), so I checked the Makefile and added $(NETLIBS) to snapshot/common/Makefile

bbhostgrep: $(HOSTGREPOBJS) ../lib/libbbgen.a
        $(CC) $(CFLAGS) -o $@ $(HOSTGREPOBJS) ../lib/libbbgen.a *$(NETLIBS)*

I then did a "make clean" and ran make again. This time I get this error:

make[1]: Leaving directory `/home/hobbit/snapshot/common'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. -I`pwd`/include -I/usr/local/include" BBHOME="/home/hobbit/client" BBHOSTIP="192.168.0.103" LOCALCLIENT="" make -C client all
make[1]: Entering directory `/home/hobbit/snapshot/client'
cat hobbitclient.cfg.DIST | sed -e's!@BBHOSTIP@!192.168.0.103!g'  >hobbitclient.cfg
make[1]: *** [hobbitclient.cfg] Error 2
make[1]: Leaving directory `/home/hobbit/snapshot/client'
make: *** [client] Error 2

I checked to see if /home/hobbit/snapshot/client/hobbitclient.cfg was created, and it was, but zero bytes.
So, I checked the hobbitclient.cfg.DIST to make sure it had data in it and it did, I then I decided to check the sed command being used:
 "sed -e's!@BBHOSTIP@!192.168.0.103!g'". 
The syntax of that looks correct but when I tried it on the command line, it didn't work! So then I grepped for sed in all of the Makefiles, and found many usages of sed, but all the others had one difference, *a space after the -e option*. I changed the sed commands in snapshot/client/Makefile to have a space after the "-e" option, did a make clean; make; and now it compiled smoothly.

--- Summary ---
So, to summarize, for Solaris compatibility in the latest snapshot, please add the netlibs to the snapshot/common/Makefile, and correct the spacing of the sed command options in snapshot/client/Makefile.

-Charles
list Henrik Størner · Sun, 6 Nov 2005 21:52:03 +0100 ·
quoted from Charles Jones
On Fri, Nov 04, 2005 at 04:13:13PM -0700, Charles Jones wrote:
--- Summary ---
So, to summarize, for Solaris compatibility in the latest snapshot, 
please add the netlibs to the snapshot/common/Makefile, and correct the 
spacing of the sed command options in snapshot/client/Makefile.
Excellent! That's the kind of bug reports I like :-)

Both changes applied, thank you.


Regards,
Henrik