[hobbit] Monitoring Backups

Steve Anderson Steve.Anderson at bipsolutions.com
Wed Feb 27 11:34:56 CET 2008


If you can't get the mail forwarding to work, or you don't want to have
to open any new holes in a firewall, there's also the fetchmail option,
where you have the hobbit server with a cronjob, polling the exchange
server to collect mail from a specific mailbox, and delivering it
locally. At which point it can be directed to a script, or whatever.



Steve Anderson

-----Original Message-----
From: Ralph Mitchell [mailto:ralphmitchell at gmail.com] 
Sent: 26 February 2008 22:27
To: hobbit at hswn.dk
Subject: Re: [hobbit] Monitoring Backups

On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<joshua at stenhouseconsulting.com> wrote:
>
>
> 2)      Have the Exchange server script send files (ftp or SMB) to the
> Hobbit server. These files will then be processed by a server side
script
> which could use bbhostgrep to check the files and send the alerts into
> Hobbit.

My $0.02 - is there a compelling reason not to just send email to your
Hobbit server??  I've  done it that way when it wasn't possible to
deliver reports via hobbit/bb protocol over port 1984.

The way it works is, my (old, decrepit, Redhat 7.2) Hobbit server is
running sendmail.  In /etc/aliases I have:

     msgman:   "| /usr/local/sbin/msgman"

which allows me to send email to msgman at hobbit.myserver.com.  Any
incoming email for that address is piped through the msgman script,
which could be written in bash, perl, C, python, &c.  What comes
through the pipe via stdin is a bunch of headers, including From, To,
Date & Subject, then a blank line, then the body of the message.
Here's one way to break out the message into useful bits:

     #!/bin/ksh

     # First line is "From sender date"
     read junk sender date

     while read token string
     do
        # Detect a blank line
       if [ "X$token$string" == "X" ]; then
         break;
       fi

       # extract the Subject line
       if [ "X$token" == "XSubject:" ]; then
         subject=$string
       fi
     done

     # pick up first line in body
     read text

     while read line
     do
       # pick up any other body lines
       text="$text\n$line"
     done

     # Do "stuff" to discover the system name, the test name, the
color and some message
     # ...

     LINE="status $SYSTEM.$TEST $COLOR `date`
     $MESSAGE"

     /home/hobbit/server/bin/bb 0.0.0.0 "$LINE"

I don't think you'd need to load the hobbit environment (I've got this
running in an old BB hierarchy) just to deliver the report.

It's not exactly rocket science, but I then I already had email
working and didn't want to have to maintain ftp/scp/smb across the
company network.  I imagine there's a way for Postfix (and other
MTA's) to deliver to a pipe, but maybe not - I simply haven't tried
because it ain't broke...  :)

Ralph Mitchell

To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk



______________________________________________        
This email has been scanned by Netintelligence        
http://www.netintelligence.com/email



BiP Solutions Limited is a company registered in Scotland with Company Number SC086146 and VAT number 38303966 and having its registered office at Park House, 300 Glasgow Road, Shawfield, Glasgow, G73 1SQ ****************************************************************************
This e-mail (and any attachment) is intended only for the attention of the addressee(s). Its unauthorised use, disclosure, storage or copying is not permitted. If you are not the intended recipient, please destroyall copies and inform the sender by return e-mail.
This e-mail (whether you are the sender or the recipient) may be monitored, recorded and retained by BiP Solutions Ltd.
E-mail monitoring/ blocking software may be used, and e-mail content may be read at any time. You have a responsibility to ensure laws are not broken when composing or forwarding e-mails and their contents.
****************************************************************************



More information about the Xymon mailing list