Xymon Mailing List Archive search

custom script help

10 messages in this thread

list Avi Rosenblatt · Thu, 2 Aug 2007 16:17:41 -0400 ·
Hi,
I'm writing a custom script that parses a mailbox and sends the  contents to the hobbit server. The problem is some emails are large,  so I would like the status page to show a list of email subjects  which, when one is clicked, would display the contents of that  message. Is that possible? If so, how would I go about sending the  body of each message and generating a link in the status page.

Thanx.
Avi R.
list Ralph Mitchell · Thu, 2 Aug 2007 15:35:45 -0500 ·
quoted from Avi Rosenblatt
On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
Hi,
I'm writing a custom script that parses a mailbox and sends the
contents to the hobbit server. The problem is some emails are large,
so I would like the status page to show a list of email subjects
which, when one is clicked, would display the contents of that
message. Is that possible? If so, how would I go about sending the
body of each message and generating a link in the status page.
If your script assembles a message something like this:

   LINE="status $MACHINE.$TEST $COLOR `date`
       <a href=url_for_message_1>subject of message 1</a>
       <a href=url_for_message_2>subject of message 2</a>"

and then sends that to Hobbit using:

   $BB $BBDISP "$LINE"

you should get a detail page with clickable links.

$MACHINE should be the machine name with commas instead of dots.
$TEST should be the name of the column you want to report.

Ralph Mitchell
list Avi Rosenblatt · Thu, 2 Aug 2007 16:43:07 -0400 ·
thanx.
I would prefer the message bodies were sent to the hobbit server. Is  
there a way of doing that? Also, would the text appear in the hobbit  
template or just as a regular text page?

Thanx.
Avi R.
quoted from Ralph Mitchell

On 2-Aug-07, at 4:35 PM, Ralph Mitchell wrote:
On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
Hi,
I'm writing a custom script that parses a mailbox and sends the
contents to the hobbit server. The problem is some emails are large,
so I would like the status page to show a list of email subjects
which, when one is clicked, would display the contents of that
message. Is that possible? If so, how would I go about sending the
body of each message and generating a link in the status page.
If your script assembles a message something like this:

   LINE="status $MACHINE.$TEST $COLOR `date`
       <a href=url_for_message_1>subject of message 1</a>
       <a href=url_for_message_2>subject of message 2</a>"

and then sends that to Hobbit using:

   $BB $BBDISP "$LINE"

you should get a detail page with clickable links.

$MACHINE should be the machine name with commas instead of dots.
$TEST should be the name of the column you want to report.

Ralph Mitchell

list Ralph Mitchell · Thu, 2 Aug 2007 15:54:28 -0500 ·
quoted from Avi Rosenblatt
On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
thanx.
I would prefer the message bodies were sent to the hobbit server. Is
there a way of doing that? Also, would the text appear in the hobbit
template or just as a regular text page?

The message you send can contain whatever you like, though there are
some limitations, given that what you send is embedded inside a web
page.  You might be able to do some fancy stuff with stylesheets to
make things appear and disappear, but I wouldn't want to bet on it
that working.  Especially if the mail could contain html tags that
would interfere with the format.

Whatever message you send is what shows up in the detail page when you
click through the colored dot that corresponds to $MACHINE & $TEST.

Ralph Mitchell
list Dave Haertig · Thu, 2 Aug 2007 15:08:09 -0600 ·
HTML in status messages works for the most part, but remember that
Hobbit confines your messages INTO A TABLE CELL when it lays out the
webpages.  This may be unnoticeable to you, or it may be a terrible
limitation.  For example, if you are trying to use stylesheets and
javascript to show/hide div's, this won't work within table cells.
Admittedly, that's a fairly sophisticated thing to try in a hobbit
status message!

It would be nice if Hobbit did not use tables for layout, and went pure
stylesheets instead.
quoted from Ralph Mitchell

-----Original Message-----
From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid] 
Sent: Thursday, August 02, 2007 2:54 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] custom script help

On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
thanx.
I would prefer the message bodies were sent to the hobbit server. Is 
there a way of doing that? Also, would the text appear in the hobbit 
template or just as a regular text page?

The message you send can contain whatever you like, though there are
some limitations, given that what you send is embedded inside a web
page.  You might be able to do some fancy stuff with stylesheets to make
things appear and disappear, but I wouldn't want to bet on it that
working.  Especially if the mail could contain html tags that would
interfere with the format.

Whatever message you send is what shows up in the detail page when you
click through the colored dot that corresponds to $MACHINE & $TEST.

Ralph Mitchell
list Avi Rosenblatt · Thu, 2 Aug 2007 18:25:31 -0400 ·
the problem is each message body has to be sent separately outside of  
the status message since each message could easily be over 1MB. I  
prefer to do this through hobbit though.
Is there a way to upload a large chunk of text into a file on the  
server that can be linked to in the status message?

Thanx.
quoted from Ralph Mitchell

On 2-Aug-07, at 4:54 PM, Ralph Mitchell wrote:
On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
thanx.
I would prefer the message bodies were sent to the hobbit server. Is
there a way of doing that? Also, would the text appear in the hobbit
template or just as a regular text page?

The message you send can contain whatever you like, though there are
some limitations, given that what you send is embedded inside a web
page.  You might be able to do some fancy stuff with stylesheets to
make things appear and disappear, but I wouldn't want to bet on it
that working.  Especially if the mail could contain html tags that
would interfere with the format.

Whatever message you send is what shows up in the detail page when you
click through the colored dot that corresponds to $MACHINE & $TEST.

Ralph Mitchell

list Ralph Mitchell · Thu, 2 Aug 2007 22:12:24 -0500 ·
quoted from Avi Rosenblatt
On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
the problem is each message body has to be sent separately outside of
the status message since each message could easily be over 1MB. I
prefer to do this through hobbit though.
Is there a way to upload a large chunk of text into a file on the
server that can be linked to in the status message?
The Hobbit server must have some kind of web server running, for the
display.  Why not upload the email files into some place in the web
server docs tree using something like 'scp', then send a Hobbit status
message with the links to http://localhost/my/mail/file.XXX, for
however many messages there are?

Ralph Mitchell
list Dave Haertig · Thu, 2 Aug 2007 22:21:23 -0600 ·
You can use 'data' messages rather than 'status' messages, but I don't
know if/what max size limit they have 
quoted from Ralph Mitchell
-----Original Message-----
From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid] Sent: Thursday, August 02, 2007 9:12 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] custom script help

On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
the problem is each message body has to be sent separately outside of the status message since each message could easily be over 1MB. I prefer to do this through hobbit though.
Is there a way to upload a large chunk of text into a file on the server that can be linked to in the status message?
The Hobbit server must have some kind of web server running, for the
display.  Why not upload the email files into some place in the web
server docs tree using something like 'scp', then send a Hobbit status
message with the links to http://localhost/my/mail/file.XXX, for however
many messages there are?

Ralph Mitchell
list Avi Rosenblatt · Fri, 3 Aug 2007 11:30:31 -0400 ·
Thanx. That's an idea, but I would need to generate keys to avoid  
requiring login.
That sounds best so far as I won't have to limit the size of the  
message.
Would there be a way to get the linked file to appear within the  
hobbit template or would that be asking too much?

Thanx.
quoted from Ralph Mitchell

On 2-Aug-07, at 11:12 PM, Ralph Mitchell wrote:
On 8/2/07, Avi Rosenblatt <user-f437326b936c@xymon.invalid> wrote:
the problem is each message body has to be sent separately outside of
the status message since each message could easily be over 1MB. I
prefer to do this through hobbit though.
Is there a way to upload a large chunk of text into a file on the
server that can be linked to in the status message?
The Hobbit server must have some kind of web server running, for the
display.  Why not upload the email files into some place in the web
server docs tree using something like 'scp', then send a Hobbit status
message with the links to http://localhost/my/mail/file.XXX, for
however many messages there are?

Ralph Mitchell

list Thomas Kern · Fri, 3 Aug 2007 11:36:14 -0400 ·
It would be nice if you could get your data files to the hobbit server
as simply text files and use a hobbit CGI to display an arbitrary
datafile within a hobbit looking template (look&feel is important to
managers). So then your URL in the 'status' message could me something
like:

'http://your.hobbit.server/hobbit-cgi/bb-showfile.cgi?datafile.0001';

/Thomas Kern
/XXX-XXX-XXXX  
quoted from Avi Rosenblatt
-----Original Message-----
From: Avi Rosenblatt [mailto:user-f437326b936c@xymon.invalid] Sent: Friday, August 03, 2007 11:31 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] custom script help

Thanx. That's an idea, but I would need to generate keys to avoid  requiring login.
That sounds best so far as I won't have to limit the size of the  message.
Would there be a way to get the linked file to appear within the  hobbit template or would that be asking too much?

Thanx.