We've managed to get email notifications working from our VDR installation (1.1.0.707). It certainly is not the most elegant solution; but I am hoping by sharing it with the community that it can be made much better.
There is an MTA running in the VDR; but I had no idea what the ramifications of configuring it would be. So we went a much simpler route.
I installed the telnet (telnet-0.17-39.el5.x86_64.rpm); and wrote a script to compare the prior list of logged errors found to the current list of errors found. A cron job runs every 15 minutes and an email is sent (via telnet) when new error messages are found.
I have attached our shell script and the rpm to this posting for your review. Please be gentle 8^)
Great! Thanks Sharantyr.
I like how you have structured it. I'll give it a try when time allows.
The reason I configure exim that way is due to antispam methods that check the sender domain. Using the relay option is not necessarily required but we use a central relay for our email alerts and reporting.
hmmm i did something wrong? I tried both scripts from yours. on the console it seems to work (no error after ./vdrreport2.sh) but i got no output and no mail was sending. Only if i use the script with telnet the mail sends. Any suggestions?
Hi,
Here is updated version of my scripts.
--
check_logs_svg_journaliere_et_envoi_mail.sh
--
The check backup system is running everyday on the morning (check crontab) 1 time per day (DONT RUN IT MORE THAN 1 / DAY) :
Edit this file and enter your email. Nothing more should be required.
--
check_logs_controle_integrite_et_envoi_mail.sh
--
The check integrity script run several times a day and check for integrity checks of VDR. I run it at 6h, 12h and 18h.
But because I never got any corrupted integrity check, I can't check the error value of a integrity check. So this script sends and email everytime there is an integrity check. This can help as an activity indicator.
Edit this file and enter your email. Nothing more should be required.
Sorry for the partial french langage in scripts. Feel free to ask if you don't understand something.
My crontab :
#tous les jours a 07h00
00 07 * * * /root/scripts/check_logs_svg_journaliere_et_envoi_mail.sh >> /dev/null 2>&1
#toutes les 6 heures de 06h00 a 18h00
00 06-18/6 * * * /root/scripts/check_logs_controle_integrite_et_envoi_mail.sh >> /dev/null 2>&1
#tous les dimanches a 11h30
30 11 * * 0 /sbin/reboot
Hi,
Sorry for the offtopic but just in case anyone out there still with VDR 1.1. After migrating one month ago or so to 1.2, integrity check errors disappeared completely.
Regards.
Hi,
I tried your script, they work fine but my log file /var/vmware/datarecovery/operations_log.utx is empty.
It is not filled during a backup
My version of VDR is in 1.2. and my vcenter is in 4.0.
you have an idea?
Thanks
Regards
Hi,
It seems that this file gets bugged if you manually touch it.
Did you modify this file by hand ?
I don't know what you could do, maybe via the graphical interface try "reset logs" ? Try to stop the service, delete the file, and restart the service to see if it recreates it.
Thanks,
The file is recreated but it runs a recatalog task.
Why it takes so long, for you too
You mean integrity check ?
Recatalog is fast for me. Integrity can be very long.
Sharantyr - Thanks for the scripts! I'm having an issue getting all of the results. It looks like it's not populating the successfulls.tmp file for some reason. The only thing I did was add my email address to the script.
Also, why do you say to run it just once a day?
Hi,
There was some bugs with the scripts, here is the improved one.
Only once because I store the last results and delete them on the next script round.
I can modify it so you can run it several times a day if you want ?
Here is the corrected version to run 1 time a day (I hope no more bugs).
Just tried it out and it appears to be working better. I think that we're going to make a few modifications to your script to try and sort the "Successfull" section by virtual machine along with sending the output as an attachment. When/if we make those mods, I'll post that version as well. Thanks, again!
Hi,
A bug in my script ( :smileysilly: ) :
Change
if [[ $ != 0 && $ != 0 ]] with if [[ $ != 0 || $ != 0 ]]
[@Sharantyr3|~1027260]
Thanks for your script - looks good.
One Suggestion and one wish:
I think, it´s better to use grep -i
... and please could you translate your comments in english - I haven´t any knowledge for french, and it´s impossible to translate them with translations-tools - its gives only crap.
Thanks
Peter
I am currently out of the office, returning Monday, November 29th.
Please
feel free to call the helpdesk at 513-763-1822 or
use the internal helpdesk at http://manageengine:8080
NOTICE: The information contained in this electronic mail transmission is intended by Kemba Credit Union, Inc. for the use of the named individual or entity to which it is directed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this email is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email, so that the sender's address records can be corrected.
many thanks for the translation now it´s easyer for me to do something with the script ... and I have done something (see attachments)
I've done:
script is now complete in english ^^
a little bit redesign for the output
integrated frommail in the script, so that the mail-header is now static (why not integrate in the script too?)
counting the events
informational subject for quick info
brief overview at the top of the mail
filtering the successfulls to remove not really successfuls (like incomplete -> successfully or idle/loading/preparing -> successfully or backup started a day before yesterday and completed yesterday) - described in the script
I would be really glad, if someone can check the script for errors I missed.
My thougths about other possible modifications and improvements:
show all backupped disks -> some of my vm´s have 2 or 3 disks - the script shows only the last backup (could be done by awk I think ...)
handle the processes around 00:00 better
use a 24h-time-range, not 2 days
is the "nothing happend" section really neccesary? I think no, because at least the integrity-checks are running daily on our DR-appliances
make the script shorter - but I haven't so much shellscripting-expirience to make 50 lines script into one line;)
Again a big "Thank You" to Sharantyr for the great input!
cya Peter
UPDATED:
Attached is sample log file, to help you programmers prepare.
-
FYI, we'll need to tweak our email scripts, VDR 2.0 logs are slightly different, we just loaded last night. If you are a beta tester, here is link to discussion. http://communities.vmware.com/thread/294459?tstart=0
I wish I was a beta tester
I did fill the beta signup form but no answer
Is the vrdrreport_3.sh (mistype in that, he?) - script a combination of both the scripts originated by Sharantyr3 ?
Or is it only the job-reporting part?
Do i really need both of them ?
Matthias