Monitoring Backups
list Joshua Johnson
Hello All, We have several client sites with servers that run backups which we would like to monitor in Hobbit. We are not running the BBWin client on most of these servers and would like to avoid going that route. Instead the servers send email alerts to a mailbox on our Exchange 2007 server (x64). Our current plan is to write a script that will look at the incoming emails and trigger events in Hobbit based on the content of the email. We will also trigger alerts if we don't get email for X amount of time. Below are the two potential methods I have found. 1) Install BBWin on the Exchange server and have the alerts sent by the script that processes the emails using BBWinCmd. Not sure if this is even possible or is it possible without using BBWinCmd? The documentation says that BBWin is a diag/test tool. Can we use the hostname parameter to specify which BB-Hosts entry this message should apply to (I think yes)? I know BBWin is not fully working on x64 so this option is probably not a good idea until then, however, in the long term it seems preferred over method 2 below. 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. I figure we are not the first to try and do something like this so any other experiences or ideas would be greatly appreciated. Thanks, Josh This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
list Ralph Mitchell
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
▸
<user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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
list Joshua Johnson
Ralph, See I knew there was a reason I sent that message. Your 2 cents is way better than what I had!! Why didn't I think of this? It is so much simpler. To make it easier I will have the Exchange server just forward to Sendmail so I don't have to change the current setup and then we still get the backup notification emails. Thank you! Joshua Johnson Consultant
▸
-----Original Message-----
From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid]
Sent: Tuesday, February 26, 2008 5:27 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring Backups
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
list Phil Wild
Can I ask what backup software you are using? Rather than processing the email, you may be able to get into the source of the email. If on backup completion you can run a script and you have access to the backup status and error message as variables, you would probably be better off writing a script here that calls bb to send a message up. Phil
▸
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid> wrote:Ralph, See I knew there was a reason I sent that message. Your 2 cents is way better than what I had!! Why didn't I think of this? It is so much simpler. To make it easier I will have the Exchange server just forward to Sendmail so I don't have to change the current setup and then we still get the backup notification emails. Thank you! Joshua Johnson Consultant -----Original Message----- From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid] Sent: Tuesday, February 26, 2008 5:27 PM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] Monitoring Backups On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson <user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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 This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid
list Joshua Johnson
Phil, We are using Retrospect and yes it does provide the functionality you are talking about however, we don't want to install the BBWin client on all of these systems. That is why we are going the email route, it doesn't require any changes to the clients. Josh
▸
From: Phil Wild [mailto:user-e365c1418192@xymon.invalid]
Sent: Tuesday, February 26, 2008 7:16 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring Backups
Can I ask what backup software you are using?
Rather than processing the email, you may be able to get into the source of the email. If on backup completion you can run a script and you have access to the backup status and error message as variables, you would probably be better off writing a script here that calls bb to send a message up.
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> wrote:
Ralph,
See I knew there was a reason I sent that message. Your 2 cents is way better than what I had!! Why didn't I think of this? It is so much simpler. To make it easier I will have the Exchange server just forward to Sendmail so I don't have to change the current setup and then we still get the backup notification emails. Thank you!
Joshua Johnson
Consultant
-----Original Message-----
From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid<mailto:user-00a5e44c48c0@xymon.invalid>]
Sent: Tuesday, February 26, 2008 5:27 PM
To: user-ae9b8668bcde@xymon.invalid<mailto:user-ae9b8668bcde@xymon.invalid>
Subject: Re: [hobbit] Monitoring Backups
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> 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 user-67a812decf3c@xymon.invalid<mailto:user-67a812decf3c@xymon.invalid>. 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<http://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
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>
▸
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
list Phil Wild
Sorry, I wasn't clear... I was talking about the server. Can the server run a script att he completion of every backup job? Cheers
▸
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid> wrote:Phil, We are using Retrospect and yes it does provide the functionality you are talking about however, we don't want to install the BBWin client on all of these systems. That is why we are going the email route, it doesn't require any changes to the clients. Josh *From:* Phil Wild [mailto:user-e365c1418192@xymon.invalid] *Sent:* Tuesday, February 26, 2008 7:16 PM *To:* user-ae9b8668bcde@xymon.invalid *Subject:* Re: [hobbit] Monitoring Backups Can I ask what backup software you are using? Rather than processing the email, you may be able to get into the source of the email. If on backup completion you can run a script and you have access to the backup status and error message as variables, you would probably be better off writing a script here that calls bb to send a message up. Phil On 27/02/2008, *Joshua Johnson* <user-8faf1205c498@xymon.invalid> wrote: Ralph, See I knew there was a reason I sent that message. Your 2 cents is way better than what I had!! Why didn't I think of this? It is so much simpler. To make it easier I will have the Exchange server just forward to Sendmail so I don't have to change the current setup and then we still get the backup notification emails. Thank you! Joshua Johnson Consultant -----Original Message----- From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid] Sent: Tuesday, February 26, 2008 5:27 PM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] Monitoring Backups On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson <user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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 This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. -- Tel: XXXX XXX XXX Fax: XXXX XXX XXX email: user-e365c1418192@xymon.invalid This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
-- Tel: XXXX XXX XXX Fax: XXXX XXX XXX email: user-e365c1418192@xymon.invalid
list Joshua Johnson
Phil, I think we have a misunderstanding? We have many remote sites, each with a server running Retrospect to perform backups. BBWin is not running on the servers at these remote sites. Retrospect simply sends emails when the backups complete. Retrospect does have the ability to call a script when a backup completes but, that would require installing BBWin on all the remote servers and creating/configuring the Retrospect script, etc. To avoid doing that we want to trigger hobbit alerts based on the emails we are already receiving from Retrospect on the remote servers.
▸
Josh
From: Phil Wild [mailto:user-e365c1418192@xymon.invalid]
Sent: Tuesday, February 26, 2008 10:25 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring Backups
Sorry, I wasn't clear... I was talking about the server.
Can the server run a script att he completion of every backup job?
Cheers
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> wrote:
Phil,
We are using Retrospect and yes it does provide the functionality you are talking about however, we don't want to install the BBWin client on all of these systems. That is why we are going the email route, it doesn't require any changes to the clients.
Josh
From: Phil Wild [mailto:user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>]
Sent: Tuesday, February 26, 2008 7:16 PM
To: user-ae9b8668bcde@xymon.invalid<mailto:user-ae9b8668bcde@xymon.invalid>
Subject: Re: [hobbit] Monitoring Backups
Can I ask what backup software you are using?
Rather than processing the email, you may be able to get into the source of the email. If on backup completion you can run a script and you have access to the backup status and error message as variables, you would probably be better off writing a script here that calls bb to send a message up.
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> wrote:
Ralph,
See I knew there was a reason I sent that message. Your 2 cents is way better than what I had!! Why didn't I think of this? It is so much simpler. To make it easier I will have the Exchange server just forward to Sendmail so I don't have to change the current setup and then we still get the backup notification emails. Thank you!
Joshua Johnson
Consultant
-----Original Message-----
From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid<mailto:user-00a5e44c48c0@xymon.invalid>]
Sent: Tuesday, February 26, 2008 5:27 PM
To: user-ae9b8668bcde@xymon.invalid<mailto:user-ae9b8668bcde@xymon.invalid>
Subject: Re: [hobbit] Monitoring Backups
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> 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 user-67a812decf3c@xymon.invalid<mailto:user-67a812decf3c@xymon.invalid>. 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<http://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
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
list Phil Wild
OK Gotcha! I use Netbackup and have one master server controlling all the backups across many sites. This way we have a single console that shows the complete schedule and one point to monitor....
▸
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid> wrote:Phil, I think we have a misunderstanding? We have many remote sites, each with a server running Retrospect to perform backups. BBWin is not running on the servers at these remote sites. Retrospect simply sends emails when the backups complete. Retrospect does have the ability to call a script when a backup completes but, that would require installing BBWin on all the remote servers and creating/configuring the Retrospect script, etc. To avoid doing that we want to trigger hobbit alerts based on the emails we are already receiving from Retrospect on the remote servers. Josh *From:* Phil Wild [mailto:user-e365c1418192@xymon.invalid] *Sent:* Tuesday, February 26, 2008 10:25 PM *To:* user-ae9b8668bcde@xymon.invalid *Subject:* Re: [hobbit] Monitoring Backups Sorry, I wasn't clear... I was talking about the server. Can the server run a script att he completion of every backup job? Cheers Phil On 27/02/2008, *Joshua Johnson* <user-8faf1205c498@xymon.invalid> wrote: Phil, We are using Retrospect and yes it does provide the functionality you are talking about however, we don't want to install the BBWin client on all of these systems. That is why we are going the email route, it doesn't require any changes to the clients. Josh *From:* Phil Wild [mailto:user-e365c1418192@xymon.invalid] *Sent:* Tuesday, February 26, 2008 7:16 PM *To:* user-ae9b8668bcde@xymon.invalid *Subject:* Re: [hobbit] Monitoring Backups Can I ask what backup software you are using? Rather than processing the email, you may be able to get into the source of the email. If on backup completion you can run a script and you have access to the backup status and error message as variables, you would probably be better off writing a script here that calls bb to send a message up. Phil On 27/02/2008, *Joshua Johnson* <user-8faf1205c498@xymon.invalid> wrote: Ralph, See I knew there was a reason I sent that message. Your 2 cents is way better than what I had!! Why didn't I think of this? It is so much simpler. To make it easier I will have the Exchange server just forward to Sendmail so I don't have to change the current setup and then we still get the backup notification emails. Thank you! Joshua Johnson Consultant -----Original Message----- From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid] Sent: Tuesday, February 26, 2008 5:27 PM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] Monitoring Backups On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson <user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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 This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. -- Tel: XXXX XXX XXX Fax: XXXX XXX XXX email: user-e365c1418192@xymon.invalid This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. -- Tel: XXXX XXX XXX Fax: XXXX XXX XXX email: user-e365c1418192@xymon.invalid This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
-- Tel: XXXX XXX XXX Fax: XXXX XXX XXX email: user-e365c1418192@xymon.invalid
list Joshua Johnson
Phil, That is a nice setup. We are a consulting company and the many sites are our clients so central backup is not really an option.
▸
Josh
From: Phil Wild [mailto:user-e365c1418192@xymon.invalid]
Sent: Wednesday, February 27, 2008 1:28 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring Backups
OK
Gotcha! I use Netbackup and have one master server controlling all the backups across many sites. This way we have a single console that shows the complete schedule and one point to monitor....
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> wrote:
Phil,
I think we have a misunderstanding? We have many remote sites, each with a server running Retrospect to perform backups. BBWin is not running on the servers at these remote sites. Retrospect simply sends emails when the backups complete. Retrospect does have the ability to call a script when a backup completes but, that would require installing BBWin on all the remote servers and creating/configuring the Retrospect script, etc. To avoid doing that we want to trigger hobbit alerts based on the emails we are already receiving from Retrospect on the remote servers.
Josh
From: Phil Wild [mailto:user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>]
Sent: Tuesday, February 26, 2008 10:25 PM
To: user-ae9b8668bcde@xymon.invalid<mailto:user-ae9b8668bcde@xymon.invalid>
Subject: Re: [hobbit] Monitoring Backups
Sorry, I wasn't clear... I was talking about the server.
Can the server run a script att he completion of every backup job?
Cheers
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> wrote:
Phil,
We are using Retrospect and yes it does provide the functionality you are talking about however, we don't want to install the BBWin client on all of these systems. That is why we are going the email route, it doesn't require any changes to the clients.
Josh
From: Phil Wild [mailto:user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>]
Sent: Tuesday, February 26, 2008 7:16 PM
To: user-ae9b8668bcde@xymon.invalid<mailto:user-ae9b8668bcde@xymon.invalid>
Subject: Re: [hobbit] Monitoring Backups
Can I ask what backup software you are using?
Rather than processing the email, you may be able to get into the source of the email. If on backup completion you can run a script and you have access to the backup status and error message as variables, you would probably be better off writing a script here that calls bb to send a message up.
Phil
On 27/02/2008, Joshua Johnson <user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> wrote:
Ralph,
See I knew there was a reason I sent that message. Your 2 cents is way better than what I had!! Why didn't I think of this? It is so much simpler. To make it easier I will have the Exchange server just forward to Sendmail so I don't have to change the current setup and then we still get the backup notification emails. Thank you!
Joshua Johnson
Consultant
-----Original Message-----
From: Ralph Mitchell [mailto:user-00a5e44c48c0@xymon.invalid<mailto:user-00a5e44c48c0@xymon.invalid>]
Sent: Tuesday, February 26, 2008 5:27 PM
To: user-ae9b8668bcde@xymon.invalid<mailto:user-ae9b8668bcde@xymon.invalid>
Subject: Re: [hobbit] Monitoring Backups
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<user-8faf1205c498@xymon.invalid<mailto:user-8faf1205c498@xymon.invalid>> 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 user-67a812decf3c@xymon.invalid<mailto:user-67a812decf3c@xymon.invalid>. 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<http://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
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
--
Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid<mailto:user-e365c1418192@xymon.invalid>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
list Steve Anderson
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:user-00a5e44c48c0@xymon.invalid]
Sent: 26 February 2008 22:27
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring Backups
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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
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. ****************************************************************************
list Joshua Johnson
Steve, Thanks that is another good option that we will consider. Would it be possible to call fetchmail directly from the hobbit script and just process new mail on each run? I haven't used fetchmail so I don't know what the options for scripting with it. Josh
▸
-----Original Message-----
From: Steve Anderson [mailto:user-a1c59649b432@xymon.invalid]
Sent: Wednesday, February 27, 2008 5:35 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Monitoring Backups
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:user-00a5e44c48c0@xymon.invalid]
Sent: 26 February 2008 22:27
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring Backups
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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
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.
****************************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
list Steve Anderson
Whenever I've worked with fetchmail, I've just had it deliver the mail
locally, through the local mail system.
So:
Mail comes into exchange.
Something (a cronjob, or a regularly running hobbit script) calls
fetchmail.
Fetchmail reads it's config file .fetchmailrc
set postmaster "hobbit"
set bouncemail
set no spambounce
set properties ""
poll myexchange.pop.server
user 'hobbit' there with password 'hobbits_password' is 'hobbit'
here
Fetchmail contacts the exchange POP server, and downloads the mail,
delivering it to the local MTA (sendmail) for local delivery
Sendmail's alias runs a script to handle the incoming mail.
Steve Anderson
▸
-----Original Message-----
From: Joshua Johnson [mailto:user-8faf1205c498@xymon.invalid]
Sent: 27 February 2008 14:27
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Monitoring Backups
Steve,
Thanks that is another good option that we will consider. Would it be
possible to call fetchmail directly from the hobbit script and just
process new mail on each run? I haven't used fetchmail so I don't know
what the options for scripting with it.
Josh
-----Original Message-----
From: Steve Anderson [mailto:user-a1c59649b432@xymon.invalid]
Sent: Wednesday, February 27, 2008 5:35 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Monitoring Backups
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:user-00a5e44c48c0@xymon.invalid]
Sent: 26 February 2008 22:27
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring Backups
On Tue, Feb 26, 2008 at 3:45 PM, Joshua Johnson
<user-8faf1205c498@xymon.invalid> 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 user-67a812decf3c@xymon.invalid. 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
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.
************************************************************************
****
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named. If you are not the named
addressee you should not disseminate, distribute or copy this e-mail.
This email has been scanned by Netintelligence
http://www.netintelligence.com/email
list Rob MacGregor
On Wed, Feb 27, 2008 at 2:26 PM, Joshua Johnson
▸
<user-8faf1205c498@xymon.invalid> wrote:Steve, Thanks that is another good option that we will consider. Would it be possible to call fetchmail directly from the hobbit script and just process new mail on each run? I haven't used fetchmail so I don't know what the options for scripting with it.
[I'll say now I'm a long term user of fetchmail, not to mention one of
the list admins for the fetchmail-users mailing list]
Yes, you could do that. You could easily configure fetchmail to pass
the emails through a script which would give you a log of your choice
to parse for your final Hobbit report. Something like the following
(not tested, but should work) for your fetchmail config:
poll pop.my.net uidl user 'name' password 'secure' keep mda
/usr/local/bin/myscript
Then call fetchmail as "fetchmail -f /path/to/config" from your hobbit
script and configure your hobbit script to parse the results of
"myscript".
(Note that the above will NOT delete the emails from the POP server)
--
Please keep list traffic on the list.
Rob MacGregor
Whoever fights monsters should see to it that in the process he
doesn't become a monster. Friedrich Nietzsche