Backup & Recovery

 View Only
Expand all | Collapse all

VDR email notifications working...

woisch

woischFeb 24, 2010 06:13 PM

TKDN_HOT

TKDN_HOTApr 07, 2010 11:46 AM

  • 1.  VDR email notifications working...

    Posted Jan 27, 2010 03:26 PM

    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^)



  • 2.  RE: VDR email notifications working...

    Posted Jan 30, 2010 10:44 AM

    That's a nice tip, thanks for sharing.

    FYI, You can also install telnet with:

    yum -y install telnet

    from the VDR command line.

    Cheers,

    Mike



  • 3.  RE: VDR email notifications working...

    Posted Feb 10, 2010 03:21 PM

    "Basic" Reporting working.

    Thank you for sharing!



  • 4.  RE: VDR email notifications working...

    Posted Feb 10, 2010 04:21 PM

    why couldn't VMWare include somthing this simple in the wizard. how hard could it be to pass a few variables into a shell script...

    i understand it's "New", and i understand they dont want to tread on thier partners business model. but i shouldn't have to pay upwards of 25k for a solution that can email reports...



  • 5.  RE: VDR email notifications working...

    Posted Feb 11, 2010 11:22 AM

    Hi, this is a good script but at the moment it only shows in the email

    VDR Errors: <number>

    I`m not a shell script guru but it is possible to get the complete error message in the mail and not only how many errors in the job?

    By the way kcucadmin, i also ask me why vmware not implement a email function for data recovery.... in my opinion it is important



  • 6.  RE: VDR email notifications working...

    Posted Feb 11, 2010 04:45 PM

    ...after playing for a while with awk, adding this to the message seems to produce a "more or less" descriptive message of the errors:

    strings -e l /var/vmware/datarecovery/operations_log.utx | grep -i "error" | awk -F"$" '{print substr($2,5, 30) substr($3, 9, 100) substr ($6, 17, 30) $8}'

    sleep 1

    The only problem is that the list of errors will be accumulative if the error log is not cleared. A improvement could be to clear the log from the script.

    Also, the script will fail first time because file olderror.out doesn't exist. I think adding:

    cat /dev/null >> /root/olderror.out

    ..at beginning of the script will work for that. See new attached vdralert.sh.

    Also is important to don't try to correct "HELO" for "HELLO". :smileyhappy:



  • 7.  RE: VDR email notifications working...

    Posted Feb 11, 2010 05:06 PM

    i understand they dont want to tread on thier partners business model. but i shouldn't have to pay upwards of 25k for a solution that can email reports...

    excellent point!



  • 8.  RE: VDR email notifications working...

    Posted Feb 12, 2010 11:35 AM

    Hello,

    attached is new vdralert.sh version with number and short description of (only) new errors. No need to clear log.



  • 9.  RE: VDR email notifications working...

    Posted Feb 24, 2010 06:02 PM

    We couldn't get the above to work so here is what we did (tweak of previous posts, installed mutt too, not as pretty, hopefully Azmir at Vmware can fix and give us email notification and faster integrity scanning in version 2.0 in 2011):

    #vdralert5.sh

    #SCRIPT TO CLEANU UP utx file then PARSE new LOG FILE AND CREATE ERROR ONLY LOG then email.

    #!/bin/bash

    1. Find all errors

    strings -el operations_log.utx > pre_errors.log

    grep -B1 error pre_errors.log > errors.txt

    1. Send email with any errors found

    mutt -s "Daily VDR Error Report attached please review" -a errors.txt youremail@yourdomain.com < /dev/null

    exit 0

    ...then just add to cron



  • 10.  RE: VDR email notifications working...

    Posted Feb 24, 2010 06:13 PM

    could you pls post the whole script?



  • 11.  RE: VDR email notifications working...

    Posted Feb 24, 2010 07:12 PM

    Here are 2 scripts to use.

    The original script for this thread did not work for us as we never got the email because the diff code wasn't working. Maybe someone can tweak and get a decent script that shows new errors only and show the VM that failed, my script shows the error line and the VM name. Not a CentOS guru by any means, but know enough to be dangerous. Used the grep command -B1 to go back 1 line to grab the VM name. Hope this helps.

    I put all my code in the /var/vmware/datarecovery folder.

    Script1 is original code but added -B1 and commented out diff code as it would not work for us.

    Script2 shows a bit more info but not as clean as 1.



  • 12.  RE: VDR email notifications working...

    Posted Feb 24, 2010 07:54 PM

    Oh..for newbies out there...as far as the best best destination, do not use CIFS/SMB, try to first use VMFS/iSCSI (with a replicated SAN offsite) or NFS.



  • 13.  RE: VDR email notifications working...

    Posted Feb 25, 2010 08:54 AM

    Is it easy to implement a solution for sending also successful jobs?



  • 14.  RE: VDR email notifications working...

    Posted Feb 25, 2010 01:49 PM

    Just use the word successful to the string. You might want to add Trouble as well, this comes up when a backup fails if it is still running and backup window timeframe ends.



  • 15.  RE: VDR email notifications working...

    Posted Feb 25, 2010 01:52 PM

    Take that back on the Trouble string, it already contains error in line, change -B1 to -B2 to get vm name in that case.



  • 16.  RE: VDR email notifications working...

    Posted Feb 25, 2010 02:56 PM

    Hello, thanks for the script but wanted to let everyone know I did have a bit of an issue with it at first. For some reason it would work but it would truncate anything after sending DATA though it did send the subject , basically I wouldn't get the body of the email. This was telnet session to an Exchange 2007 server if that makes the difference.

    What I had to do was adjust the line following the subject to REMOVE the space between the quotes, see snippet below:

    echo "data"

    sleep 1

    echo "subject: VDR Errors: "$err

    sleep 1

    echo "from: VDR"

    sleep 1

    echo "to:someone@test.com"

    sleep 1

    echo ""

    sleep 1

    echo " "

    sleep 1

    echo "VDR Errors: "$err

    sleep 1

    cat /root/diff.out

    once I did that I was able to get the body of the email without issue. Also note I added a from and to header, just so the email didn't look like it went to noone (in outlook it wasshowing a blank for the to field) and it "pretties" up the from field to just show VDR.

    EDIT To field was formatted wrong.

    Thanks again!

    Ben



  • 17.  RE: VDR email notifications working...

    Posted Feb 26, 2010 10:41 AM

    Hello,

    for us the script (with diff code) is working fine so far. For example this is the mail received today (only one mail per day in our case):

    VDR Errors: 4

    &gt; 2/26/2010 4:12:00 AM: Failed to create snapshot for SOHS_BACKUP[02], error -3960 ( cannot quiesce virtual machine)

    &gt; 2/26/2010 4:42:34 AM: Failed to create snapshot for SOHS_BACKUP[02], error -3960 ( cannot quiesce virtual machine)

    &gt; 2/26/2010 4:58:07 AM: Failed to create snapshot for BNA_BACKUP[02], error -3960 ( cannot quiesce virtual machine)

    &gt; 2/26/2010 6:07:50 AM: Failed to create snapshot for XEN3[02], error -3960 ( cannot quiesce virtual machine)

    ...the only issue detected so far is that in some cases (e.g. "integrity check failure"), awk code doesn't capture correct description of the error (but an error message is received anyway). For VM errors the description is fine as seen above.



  • 18.  RE: VDR email notifications working...

    Posted Mar 09, 2010 02:05 PM

    Can you re-post the corrected script? Testing with beta VDR 1.2 today. Thanks



  • 19.  RE: VDR email notifications working...

    Posted Mar 09, 2010 06:12 PM

    You \[a customer\] can beta test the upcoming VDR version?

    Very cool.

    We still need to rely on homegrown scripts for something as basic as emailing errors in this next version?

    Well, shit.

    There goes my last remnant of hope to wait until the next vSphere/VDR release.



  • 20.  RE: VDR email notifications working...

    Posted Mar 09, 2010 06:41 PM

    Yep, 1.2 working fine, although only been 18 hours so far. The email function is coming I have been told, probably not this year. Our main concern is to get something stable and reliable.



  • 21.  RE: VDR email notifications working...

    Posted Mar 09, 2010 06:58 PM

    Hmmm i lost the overview... :smileysad:

    Could someone post the whole working script? Maybe also with a succeed message if no error appears in the jobs?

    That would be very nice!



  • 22.  RE: VDR email notifications working...

    Posted Mar 09, 2010 07:11 PM

    The errors do not show up in the body section but in Outlook if I right-click then select Options and look at headers, the missing BODY contents are there, what is telnet command to encapsulate the body properly?

    ---

    X-MDAV-Processed: kembacu.org, Tue, 09 Mar 2010 13:57:51 -0500

    Return-path: <post@kembacu.org>

    Received: from vmdatarecovery.kembacu.org by kembacu.org (MDaemon PRO v11.0.0k)

    with ESMTP id 23-md50000046464.msg

    for <r@kembacu.org>; Tue, 09 Mar 2010 13:57:51 -0500

    X-Spam-Processed: kembacu.org, Tue, 09 Mar 2010 13:57:51 -0500

    (not processed: message from trusted or authenticated source)

    X-Rcpt-To: r@kembacu.org

    X-MDRcpt-To: r@kembacu.org

    X-Return-Path: prvs=1684d547e7=post@kembacu.org

    X-Envelope-From: post@kembacu.org

    X-MDaemon-Deliver-To: r@kembacu.org

    from: post@kembacu.org

    to: r@kembacu.org

    Subject: VDR Errors:0

    3/8/2010 10:44:11 PM: Can't access Backup Set /SCSI-0:1/[02], error -2261 ( can't use Backup Set until integrity check succeeds)

    3/8/2010 10:44:11 PM: 1 execut %.1T: %s][//19/%d execution errors]

    3/8/2010 10:45:34 PM: Backup Set "[01]%.0S

    3/8/2010 10:45:35 PM: 5 execut %.1T: %s][//19/%d execution errors]

    Reply-To: post@kembacu.org

    Message-ID: <MDAEMON-F201003091357.AA5740295md50000000037@kembacu.org>

    Date: Tue, 09 Mar 2010 13:57:51 -0500



  • 23.  RE: VDR email notifications working...

    Posted Mar 09, 2010 08:14 PM

    Your issue sounds similar to mine (no body), try this modified script where I basically removed a space between the quotes. I don't know if this is due to exchange 2007 not liking the space in there but either way once it was removed the script now runs without issue.



  • 24.  RE: VDR email notifications working...

    Posted Mar 09, 2010 09:36 PM

    Thanks Ben13!

    Working good now.

    You have your crontab setup to run once a day?

    -


    Here is my email ouput:

    VDR Errors: 4

    3/8/2010 10:44:11 PM: Can't access Backup Set /SCSI-0:1/[02], error -2261 ( can't use Backup Set until integrity check succeeds)

    3/8/2010 10:44:11 PM: 1 execut %.1T: %s][//19/%d execution errors]

    3/8/2010 10:45:34 PM: Backup Set "[01]%.0S

    3/8/2010 10:45:35 PM: 5 execut %.1T: %s][//19/%d execution errors]

    Also attached is our script, slightly tweaked for Mdaemon email server. Didn't like bare HELO. and since I run script from /var/vmware/datarecovery



  • 25.  RE: VDR email notifications working...

    Posted Mar 10, 2010 02:18 AM

    Glad to hear its working for you and thanks ofr posting the modified for mdaemon as I'm sure someone else will run into it.

    Yup I have it setup in crontab to run daily though in truth i may adjust to run sunday nights as my vdr jobs only run fri/sat and then sunday morning so basically everything is done by sunday afternoon.



  • 26.  RE: VDR email notifications working...

    Posted Mar 10, 2010 05:44 PM

    Also....I added -B2 after the grep, to get the VM name that failed. -B2 goes back previous 2 lines from error line. Other then that working good.



  • 27.  RE: VDR email notifications working...

    Posted Mar 18, 2010 01:52 PM

    I've been working on an alert script using bits and bobs from the other scripts that folks have kindly posted and have attached the results. A few comments on my experiences:

    • The attached script sends an email even if no errors are found.

    • Mutt seems to be the way to go, doing a manual smtp send managled the log file in my mail client, whereas the formatting in the mutt attached text file is fine.

    • Exim is installed within the vDR appliance and can be used for relaying to a mail server with a few tweaks, so I edited /etc/exim/exim.conf with the following changes,

    • Changed the domainlist local_domains line to read

      • domainlist local_domains = @:localhost

    • Then under routers section, commented out

      • #dnslookup:

      • # driver = dnslookup

      • # domains = ! +local_domains

      • # transport = remote_smtp

      • # ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8

      • # no_more

    • And added the following at the bottom of the routers section:

      • passontomailserver:

      • driver = manualroute

      • domains = !+local_domains

      • transport = remote_smtp

      • route_list = * mailserver.your.domain

    • Made those changes, restared exim (service exim restart)

    • After looking at the mutt website and then doing some poking about, I discovered that it can be easily installed by issuing the command "yum install mutt.x86_64". I tested mutt on the command line but had to issue the command "touch /var/spool/mail/root to clear a missing mailfile error.

    Hope my experiences help someone.



  • 28.  RE: VDR email notifications working...

    Posted Mar 30, 2010 01:01 PM

    Hi there,

    thx @ for the script.

    I´ve modified it to display and count errors and successful jobs (on top and in the subject), added some extra infos (time, hostname) and few variables on the beginning.

    Hope you like it!

    Feel free to correct the bugs I´ve included :smileywink:

    Greets

    Peter



  • 29.  RE: VDR email notifications working...

    Posted Apr 04, 2010 07:24 PM

    Hello all.

    My solution is based on swatch that can monitor a log file and perform some actions when certain text appears in that file.

    For emails I use a nice script smtp_send.pl.

    Here is my config file for swatch:

    watchfor /I\x00n\x00t\x00e\x00g\x00r\x00i\x00t\x00y\x00 \x00c\x00h\x00e\x00c\x00k\x00 \x00f\x00a\x00i\x00l\x00e\x00d/

    exec smtp_send.pl -t &lt;destination_email&gt; -f &lt;source_email&gt; -s "VDR Integrity check failed" -r &lt;smtp_smarthost&gt;

    To start swatch:

    swatch --config-file=/etc/swatchrc.datarecovery --tail-file=/var/vmware/datarecovery/operations_log.utx &

    When message "Integrity chech failed" appear in /var/vmware/datarecovery/operations_log.utx email will be sent to &lt;destination_email&gt; with subject "VDR Integrity check failed".

    Hope somebody would find it useful.



  • 30.  RE: VDR email notifications working...

    Posted Apr 05, 2010 03:33 AM

    This and the last couple of posts should light a fire (vmware) for true vdr email feature.

    For anyone who wants to know...we're testing 1.2RC and vdr is coming along, been using datarecovery.ini and only running 1 backup at a time and set full integrity check every 7th day.

    Works best for us, running 8 backups at a time is not needed as we run about 30 vm's total, my backups are quick anyway after 1st full backup. We might go back to 8 but it works fine now, why fiu, lol. Also, allocate at least one hour a day (same time period each day, ex. 7-8am, keep within and not exceed 24hour period) for no backups so integrity does not interfere with running backups, especially the pesky full IC's, IC needs to run incrementals 6 days a week. I've asked them to fix IC so that it runs full check at least 2 hours after backup window ends, to give any jobs to stop then remove snapshots and not start full IC until queue is empty, or give the customer option in ini file.

    • - They have fixed ghost tasks.

    FYI: Make sure vcenter server is never rebooted during tasks, caused us issues. Although, 1.2RC fixes VDR to retry where it left off if vcenter is rebooted.

    They have added double click feature on completed task(s) so you can view the log entry without scanning log. You can also delete items out of summary section.

    Vdr will come around.

    Sent on the Sprint® Now Network from my BlackBerry®



  • 31.  RE: VDR email notifications working...

    Posted Apr 07, 2010 08:21 AM

    Hey Peter, did you see my pm ? :smileywink:)



  • 32.  RE: VDR email notifications working...

    Posted Apr 07, 2010 11:46 AM

    Just now , yes! Replyed it!

    Greets

    Peter



  • 33.  RE: VDR email notifications working...

    Posted Apr 16, 2010 09:11 AM

    Hello there.

    Thanks for all your efforts on this solution.

    Almost every week we encounter the problem of failed integrity checks and therefore no backups being executed until deletion of recovery points and a manual integrity check is done.

    So the email-notification is quite vital for us.

    To the point: I am not used to LINUX, but i have managed to get the script running succesful from the command line via WinSCP.

    But i did not find any CRONTAB for defining a recurring job-entry for that.

    So i copied the script in /ETC/CRON.DAILY/ hoping it would be executed automatically among the other scripts lying there.

    But it doesn't seem to work.

    How do i configure create a CRONTAB for this being a recurring job daily at let's say 15:00 without interfering any other (maybe hidden) task-planning?

    Greetings from Dortmund in good ole Germany.



  • 34.  RE: VDR email notifications working...

    Posted Apr 16, 2010 09:24 AM

    How about you read on one of the hundreds of decent cron turtorials (even for Linux newbies) out there?

    http://linuxwiki.de/crontab (german)

    http://adminschoice.com/crontab-quick-reference

    Basicially, add a line in /etc/crontab like:

    00 15 * * * root /root/myVDRscript.pl

    Make sure the script has the executable permission too if you have problems executing it:

    chmod +x /root/myVDRscript.pl

    Greetings from ye olde Germany too.



  • 35.  RE: VDR email notifications working...

    Posted Apr 16, 2010 09:40 AM

    Surely i looked at such tutorials before, but i wanted to know, if it will be the same in this special case of VDR.

    Because i didn't read anything of the folders CRON.DAILY and CRON.WEEKLY before.

    I thought, it was a special (easy) form of CRONJOB-handling to simply copy scripts into those folders.

    So i only need to create a textfile CRONTAB in ETC and put the mentioned line in, yes?

    It won't interfer with other hidden task-planning, ok?

    Then i can delete the copy of the script out of CRON.DAILY, because it resides already in /VAR/VMWARE/DATARECOVERY/ , yes?

    Thanks for your quick answer...



  • 36.  RE: VDR email notifications working...

    Posted Apr 16, 2010 09:48 AM

    The file /etc/crontab should already exist on any Linux system. Be aware that Linux filesystems are case sensitive too.

    In a nutshell, just execute this:

    echo "00 15 * * * root /var/vmware/datarecovery/myVDRscript.pl" >> /etc/crontab

    This will add the line to /etc/crontab (change the scriptname and times accordingly obviously).

    What interferences are you afraid of? The script just checks a text logfile.



  • 37.  RE: VDR email notifications working...

    Posted Apr 16, 2010 09:58 AM

    On our VDR, there is no /etc/crontab file, only a file called cron.deny. and the folders cron.d, cron.daily and cron.weekly. That's true.

    This is why i was afraid of creating a crontab-file and maybe therefore the scripts residing in cron.daily and cron.weekly would eventually not executed anymore, if they were not mentioned in the newly created crontab.

    Ok, only a guess, so let's go doing it like told.

    Thanks...



  • 38.  RE: VDR email notifications working...

    Posted Apr 16, 2010 09:36 AM

    Here is the syntax for running the Job every 10 minutes: (crontab -e)

    */10 * * * * /root/vdralert.sh

    I want to be informed about a failure very soon not only once a day.



  • 39.  RE: VDR email notifications working...

    Posted Apr 16, 2010 09:45 AM

    Also a good idea, but i don't want to get our e-mail-account so full of MSGs.

    We only have a rather small VI, so the VDR-Appliance hasn't got so much to do.

    Maybe i let CRON do it at 09:00 and 15:00 hrs, so it will be quite enough for our scenario.

    Thanks.



  • 40.  RE: VDR email notifications working...

    Posted Apr 16, 2010 12:43 PM

    MattseG2,

    If it makes you feel better, beta VDR 1.2.0.1046 Build 249035 still has slow full integrity checks and recatalog. : (

    You might want to create/tweak the /var/vmware/datarecovery/datarecovery.ini file so that it looks as such:

    IntegrityCheckInterval=7

    MaxBackupRestoreTasks=1

    (then restart VDR service or reboot)

    More info here:

    http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1013175

    If you can get by with morning alerts:

    On the email notification, make sure your script(s) looks for keywords: error, terminate, successful, in those orders, space out the alerts over 5 minutes, say 8am then 8:05am, etc...

    Ryon Brubaker

    Information Systems Manager

    Kemba Credit Union, Inc.

    http://www.kemba.com/



  • 41.  RE: VDR email notifications working...

    Posted Apr 16, 2010 01:00 PM

    "If it makes you feel better, beta VDR 1.2.0.1046 Build 249035 still has

    slow full integrity checks and recatalog. : ("

    ...does it delete automatically damaged restore points?



  • 42.  RE: VDR email notifications working...

    Posted Apr 16, 2010 01:43 PM

    Not sure, I know we haven't had to do that manually, ever. If they could only fix the slow integrity and other cleanup tasks. What version you on? Are you using iSCSI, CIFS/SMB or NFS for backup destination?

    Use VDR in this order for better performance:

    1. Use a seperate (not same device that VM's reside) iSCSI device

    2. Use a seperate NAS device with NFS

    3. Use a seperate CIFS/SMB device (no more then 500GB)

    I've been testing 2 and 3.

    Will try FREENAS and iSCSI soon.

    Ryon Brubaker

    Information Systems Manager

    Kemba Credit Union, Inc.

    http://www.kemba.com/



  • 43.  RE: VDR email notifications working...

    Posted Apr 16, 2010 02:13 PM

    We are on 1.1. Until recently we had a single 300GB FC SAN disk for backup and "integrity failure check" because of "damaged restore points" started to appear very frequently. We have added a second 300Gb disk and pointed backups jobs to it (keeping old backups in first disk for now) and we got only one "integrity failure check" in several weeks for the moment...

    It is no sense to require the user to delete damaged restore points when they are useless and no backup jobs can be executed with them, or at least and option to do it automatically.



  • 44.  RE: VDR email notifications working...

    Posted Apr 16, 2010 02:33 PM

    Sounds like a hardware issue? Not rebooting the vCenter server daily are you? That will goof up VDR processes as we found out.

    I think the VDR service gets hung from time to time, might create a CRON "preventive maintenance" task to stop/restart the service during non-backup window but need to figure out a way to make sure nothing is running.

    Ryon Brubaker

    Information Systems Manager

    Kemba Credit Union, Inc.

    http://www.kemba.com/



  • 45.  RE: VDR email notifications working...

    Posted Apr 19, 2010 09:45 AM

    Email-notivications up and running with CRONTAB, Yeah and MANY THANKS :smileywink:

    OK Guys, maybe off-topic here, but:

    Our VDR-Target is a separate NFS-Drive on a Win2k3-VM in RAID51-SAN (Datacore SanMelody iSCSI-SANs on 2 ESX4).

    So all of our VI is hosted in only two redundant Boxes. Very virtualized, isn't it?

    What about frequently occcuring corrupted restore-points?

    Since update to VDR 1.1.0.707 this occurs very often. Before it was rather rare.

    Backup-windows and Environment didn't change.

    I understood the meaning of stretching the check-interval and putting datarecovery jobs in a quasi non-multitasking state by modifying datarecovery.ini, but is the stretching secure?

    If a restore-point is corrupted, and we have a very short retention policy due to storage-limitations (1 last month, 1 last week and the last) and let's say the point 31st last month is being corrupted, then the two following points of the next week are useless, correct?

    Any suggestions?

    Is there any other good thread concerning this issue?



  • 46.  RE: VDR email notifications working...

    Posted Apr 19, 2010 12:45 PM

    We have never had to mess with corr. restore points.

    We use default settings for retention policy.

    Open a case with vmware on the corruptions. You should only have to worry about backups that did not finish due to end of backup window.

    When you went to 1.1, did you disable/remove the older vdr plugin before installing 1.1?

    We have backups back to early march.

    Good luck, wish I could help.

    Sent on the Sprint® Now Network from my BlackBerry®



  • 47.  RE: VDR email notifications working...

    Posted Apr 19, 2010 01:56 PM

    I know you have your crontab setup now but just so its noted (Paul did have it in his email but it was in brackets and maybe easy to miss or skip over) as I'm sure there are others not familiar with linux but trying out VDR.

    As mentioned typically linux systems have the file but VDR does not. If you use putty (or another SSH client) and log in to VDR then simply type "crontab - e" you can add to crontab (which uses VI as the editor)

    root@vdr etc# crontab -e

    00 06 * * 1 /root/vdralert.sh



  • 48.  RE: VDR email notifications working...

    Posted Apr 19, 2010 02:29 PM

    Of course i replaced the VDR-plugin when moving to 1.1.

    But i can't remember exactly, if i did it just before or just after installation of 1.1.

    However, i am nearly sure, that VDR 1.1. was never used nor configured with older PlugIn.

    But the deduplication-store was taken from the old version, but that is not a problem, i think.



  • 49.  RE: VDR email notifications working...

    Posted Apr 19, 2010 09:12 PM

    >But the deduplication-store was taken from the old version, but that is not a problem, i think.

    Right, shouldn't be the problem but...I'd create a fresh new backup destination. If you can, start from scratch, like I said, I have never had to mess with bad restore points, etc...

    Although, we're beta testing 1.2 and so far just have had the vdr service hang and a reboot clears all. Maybe 1.2 fixes the restore point issue. I skipped from 1.1 to 1.2 with not much testing on 1.1



  • 50.  RE: VDR email notifications working...

    Posted Apr 27, 2010 02:07 PM

    Hello, all!

    I followed vmbru recommendation and set it up complete fresh:

    1. Backed up crontab and vdrreport.sh, killed appliance and de-dupe-vmdk.

    2. Checked VDR-plugin version and rolled out a new VDR-appliance from OVF with 8 GB ram and 4vCPUs.

    3. Configured network, timezone and other parameters.

    4. Formatted de-dupe-store to mount it and set up new backup-tasks.

    5. Logged on via WinSCP and installed telnet with yum -y install telnet.

    6. Copied crontab to etc and vdrreport.sh to var/vmware/datarecovery like i had before.

    7. Restarted the appliance.

    vdrreport.sh works from CLI, but not from crontab...(surely i checked crontab entries...)

    What did i miss?



  • 51.  RE: VDR email notifications working...

    Posted Apr 27, 2010 02:20 PM

    can you post your crontab file? Permissions on the file okay?

    Alternatively instead of using a crontab file placed in \etc try typing "crontab -e" from CLI and adding that way. (when you run crontab -e you'll be in VI the editor, paste the contents of your crontab file into here and save then exit)

    Also keep in mind depending on who's version of vdrreport.sh file you use if there is nothing to report it won't send an email. Eg if you run manually it will send the first one but on cron running there are no new errors so it won't send. You would have to delete the diff.out and olderror.out files to start "fresh", hope that makes sense.



  • 52.  RE: VDR email notifications working...

    Posted Apr 27, 2010 03:07 PM

    See attached files...

    Rights for both on 755.

    Script is sending, even when no new entries are found. i.e. "Jobs OK:0, FEHLER:0"

    I tried a new with crontab -e, see if it will work now...



  • 53.  RE: VDR email notifications working...

    Posted Apr 27, 2010 03:25 PM

    you could try taking out the user part as you shouldn't need it (the root) at least not if you set it up with crontab -e

    results of my crontab -e

    00 06 * * 1 /root/vdralert.sh

    also have you checked /var/log/cron file to see if anything is listed in there?



  • 54.  RE: VDR email notifications working...

    Posted Apr 28, 2010 08:33 AM

    It wasn't the user part.

    It seems to had really to do with only copying the crontab file to etc by sftp3 without using crontab -e or "echo xxx >> etc/crontab".

    Maybe CronD didn't recognize having a crontab until usage of one of these commands.

    In my first try i used the echo-method and it worked.

    My second try was the copying by SFTP3 and it didn't work.

    And the last try was to do the "crontab -e"-method and it worked.

    So we learned: Use "crontab -e" or "echo "00 09 * * * root /root/vdrreport.sh" >> etc/crontab" and it will work...

    By the way, before usage of one of these commands, var/log/cron shows

    "Apr 23 11:54:02 localhost crond[3768]: (CRON) STARTUP (V5.0)"

    "Apr 23 12:33:01 localhost crond[3768]: (system) BAD FILE MODE (/etc/crontab)"

    every time the appliance is booted.



  • 55.  RE: VDR email notifications working...

    Posted Apr 28, 2010 01:15 PM

    glad its all sorted now. Like you pointed out , looking at /var/log/cron showed that it didn't like the file.

    Did you maybe create the file in windows in notepad or something and then sftp it over?

    Another alternative would have been to create the crontab file with VI directly on the machine and paste the contents in.



  • 56.  RE: VDR email notifications working...

    Posted Apr 28, 2010 02:38 PM

    I copied the files by sftp from the "old" appliance, then killed everything and reinstalled.

    After that, i copied the files again by sftp to the newly installed appliance and did chmod 755 to them.

    You're right. I tried to use the VI but i wasn't used to it and couldn't exit from it. (Oh, these newbies......) :smileywink:



  • 57.  RE: VDR email notifications working...

    Posted Apr 27, 2010 02:29 PM

    Check permissions, you chmod that sh script?

    chmod 755 vdrreport.sh, or 777?

    I think I had to do that for crontab to execute our script.

    Send up your crontab -e config so we can see. Maybe a typo somewhere, have one of us take a look see.

    By the way, running VDR 1.2 for over 2 weeks, stable. Maybe June you folks can get, otherwise join their beta. Recommend VMFS or NFS to backup destination, skip over SMB/CIFS as integrity checks are super slow.

    Ryon Brubaker



  • 58.  RE: VDR email notifications working...

    Posted Apr 27, 2010 03:09 PM

    Hi, I'm out of the office until the 3rd May 2010, I will attend to your message on my return.

    Thank you,

    Miles Atkinson



  • 59.  RE: VDR email notifications working...

    Posted Apr 28, 2010 03:57 PM

    I used MileATK's version that sends the attachment with Mutt, but I added a .muttrc file in /root so that I could tell which appliance it was coming from.

    set realname = 'ApplianceName'

    set from = 'ApplianceName@yourdomain'

    -


    Shane Wendel

    VCP: vSphere 4

    VCP: VI3



  • 60.  RE: VDR email notifications working...

    Posted Jun 11, 2010 01:25 AM

    Hi,

    Here is something I put together that you may like to use.

    Rather than using telnet etc I just configured exim and installed mailx using yum.

    the Perl regex is not perfect, hence the additonal sed in the script but it looks nice enough.

    we like to have all servers reporting each day as opposed to just errors.

    Thanks

    Edit: 12/06/2010 - I have added another version (vdr-reportv2.sh) using just sed to tidy the file which now outputs nicely! You should use this instead.



  • 61.  RE: VDR email notifications working...

    Posted Jun 12, 2010 12:26 PM

    Vdr 1.2 out now for all... sportsfans!

    They are trying to get it stable, been ok for us.

    Hopefully next version has email feature builtin and integrity check as a hidden background task that does not interfere.

    I hope they try to support more then 1TB.



  • 62.  RE: VDR email notifications working...

    Posted Jun 29, 2010 09:23 AM

    YFYI:

    Hey Guys,

    i upgraded to VDR 1.2 after patching our ESXs from 4.0.0 to 4.0.0u2.

    Believe it or not: VDR 1.2 must have TELNET already installed.

    Thats because i forgot the "yum -y install telnet" command and implemented e-mail-notifications like explained before in this thread.

    By testing the vdrreport-script on the CLI, it worked without TELNET being installed to the VDR-appliance.

    Greetings from good ole Germany



  • 63.  RE: VDR email notifications working...

    Posted Jun 28, 2010 12:03 AM

    Good Day Everyone,

    The vdr-reportv2 script is nice, but how do you filter so only the logs for the current day are sent, and NOT the entire logs? I am a newbie at bash scripting

    Thanks

    Stevester



  • 64.  RE: VDR email notifications working...

    Posted Jul 04, 2010 02:10 AM

    You could use egrep and the date commands to filter certain date ranges/times from the ouput.

    Try modifying the line beginning with $STRINGS to:

    $STRINGS -e l $BINLOG | egrep -i "$(date -d 'yesterday' +'%-d/%-m/%Y')|$(date +'%-d/%-m/%Y')" \

    This should only ouput yesterdays and todays logs. Obviously you need to ensure your VDR servers date is correct.

    I have not tested this and you will probably need to change the date formats because I set the locale for our VDR server to D/M/YYYY instead of American Style with the month first.

    If you just want today or yesterday only then you will need to remove one of the date commands from the egrep command but be aware that if your backup time window spans a day you may be missing stuff from the log.

    Let me know if it works.



  • 65.  RE: VDR email notifications working...

    Posted Jul 04, 2010 02:29 AM

    Anyone on vdr 1.2 yet? Seeing any weird integrity checks running at 50 percent with both numbers incrementing?

    Sent from my Verizon Wireless BlackBerry



  • 66.  RE: VDR email notifications working...

    Posted Jul 04, 2010 12:36 PM

    Good Day Jelloir,

    Unfortuantely this is still not working. Mainly because your egrep command doesn't have a file specified to perform the match to. I created two variables: EGREP=bin/egrep and CURRENTDATE=`date +"%-m/%-d/%Y"` and performed the following substitution - $EGREP -i $CURRENTDATE $BINLOG \. However i still only the full output and not the current date matched.



  • 67.  RE: VDR email notifications working...

    Posted Jul 07, 2010 05:00 AM

    Hi Stevester,

    I have tested this and fixed some errors, including removing the old /tmp/vdrlog*.txt

    Attached is an updated version which should work as expected (double check your date format of course).

    I'll leave it to you to add variables for date commands etc where you want.



  • 68.  RE: VDR email notifications working...

    Posted Jul 07, 2010 05:41 AM

    Good Evening Jelloir,

    I checked your script and it works nice. However there is one small little hurdle. Your $SERVERNAME variable does not get defined correctly. For example, one of my VM's name is FC-Chicago WSUS Server. When the output of your script is displayed, I get "=====REPORT FOR FC-Chicago =======" instead of

    "=====REPORT FOR FC-Chicago WSUS Server========="

    Thanks

    Stevester



  • 69.  RE: VDR email notifications working...

    Posted Jul 07, 2010 10:31 AM

    This is due to the line:

    SERVERNAME=$($GREP 'Copying' $server | awk '{print $5}')

    Which prints the 5th field delimited by spaces and since your VM has a space in its filename only prints the first field FC-Chicago.

    Try replacing it with:

    SERVERNAME=$($GREP 'Copying' $server | awk '{ for (i=5; i<=NF; i++) printf("%s ", $i); printf("\n") }'

    Which prints everything from field 5 to the end of the line.

    Cheers



  • 70.  RE: VDR email notifications working...

    Posted Jul 07, 2010 01:47 PM

    Great it works!!!!!!!!!!! However you forgot a trailing ) bracket to enclose the variable SERVERNAME. Now what if you would like the script to also print the integrity checks that occurs as well. I would like the script to check for those of the current date as well as printing the normal backups that is currently implemented. The reason I am asking is the I found out that with the Linux INCRON package, you can get as closest to a built in email alert as possible. With INCRON, you can implement a setup where when the operations.utx.log file is opened and then closed (IN_CLOSE_WRITE attribute), the kernel will perform an action that you specify.

    Thanks

    Stevester



  • 71.  RE: VDR email notifications working...

    Posted Jul 19, 2010 02:36 PM

    Hi all,

    Thanks Jelloir for your script. But it doesn't work ... maybe because i just installed vdr 1.2 ? Did log paths/files changed since 1.1 ?

    I only have a vmware-root dir in /tmp with vixDiskLib-*.log files inside. Can't find any vdrbackup.log.

    Here's the execution log (vdr-report.sh is your vdr-reportv2-stevester.sh)

    # ./vdr-report.sh

    rm: cannot remove `/tmp/vdrbackup.log': No such file or directory

    ls: /tmp/vdrlog*.txt: No such file or directory

    grep: /tmp/vdrbackup.log: No such file or directory

    /bin/cat: /tmp/vdrbackup.log: No such file or directory

    Null message body; hope that's ok

    Thanks for your help !



  • 72.  RE: VDR email notifications working...

    Posted Jul 19, 2010 02:51 PM

    Good Morning ROM13,

    I had the same issue as well. Log files are been called which don't exist in the location specified. It may be simpler to GREP and use the SED command on the operations.utx file. Something of this nature: ($STRINGS -e l $BINLOG | $EGREP -i $CURRENTDATE | $SED -e:o -e's/$\[[^][]\]//g; s/$\[.\]//g' -eto |..... AWK....) should suffice. I just got in from vacation and was going to work on it, but haven't had time to yet.

    Also, if you use the Linux INCRON command (you may have to install it) to detect changes on files, folders, and etc, it would make a great email notification system.

    Thanks

    Stevester



  • 73.  RE: VDR email notifications working...

    Posted Jul 20, 2010 01:33 PM

    I would need to see the output of the strings command, i,e, the log output before it it piped through the rest of the script, e.g.

    strings -e l /var/vmware/datarecovery/operations_log.utx &gt; /tmp/rawvdroutput.log

    We are using 1.2 and it works ok for us.

    post a .txt attachment with an excerpt (just a single server will do) of the strings output and i'll look at the why nothing is generated from the logs on your servers when time allows.

    Edit: I should also clarify as you appear to be confused about the log location. The logs vdrbackup.log and vdrlog*.txt are generated by the script and have nothing to do with vdr. The fact they do not exist is because the script is not creating them due to nothing going into them.



  • 74.  RE: VDR email notifications working...

    Posted Jun 30, 2010 03:11 PM

    Hi everyone

    the mailx way:

    never configured exim before - where do i have to set up my internal mail server (exchange)? Is there any smallest/easiest config for exim sending only to ms exchange arround?

    the telnet way:

    vdralert is working on my test maschine, but latest vdrreport always says no jobs ?!?

    regards

    Innu



  • 75.  RE: VDR email notifications working...

    Posted Jul 07, 2010 05:07 AM

    Hi Innuendo_,

    Exim MTA on the VDR Server

    Exim is already installed and running on VDR so edit Exim's config file to add the following settings

    vi /etc/exim/exim.conf

    Locate the line that reads "# qualify_domain =", uncomment it and edit it to (replace example.com with your FQDN):

    qualify_domain = example.com

    Then add this before “dnslookup:” in the Routers section (replace 10.1.1.2 with your relays/smarthosts IP or hostname)

    to_smart_host:

    driver = manualroute

    +domains = ! local_domains

    transport = remote_smtp

    route_list = "* 10.1.1.2;"

    Restart exim

    service exim restart

    Install mailx

    yum install mailx



  • 76.  RE: VDR email notifications working...

    Posted Jul 21, 2010 10:45 AM

    It's ok...

    I misunderstood date format (and missread previous posts also :smileywink: ), i just replaced 2 occurences of %-d/%-m/%Y with %-m/%-d/%Y and it's working now.

    Thanks for your help !



  • 77.  RE: VDR email notifications working...

    Posted Sep 20, 2010 01:31 PM

    New version to resolve some issues.

    VM reports were disjointed if backups ran mutiple times which made the report hard to read.

    errors on backed up VM's were not always correctly formatted.

    The script is less automated and relies on VM's being reported on being input as variables or arguments. This was required as per the previous comments above.

    Make sure you set log start time and date the same as your VDR backup job and get your variables/arguments correct.

    I have not tried using it with multiple jobs but it should work by simply using seperate script arguments where required.

    All the best.



  • 78.  RE: VDR email notifications working...

    Posted Oct 14, 2010 07:37 AM

    Hi all,

    how could i implement the script from Jelloir. How should i configure exim and mailx? Once the script is stored in /scripts do i needto create a cronjob for this or came there a message if the backup job is ready?

    Could someone give me an example ho the output looks like with the script from Jelloir?

    best regards



  • 79.  RE: VDR email notifications working...

    Posted Oct 14, 2010 07:43 AM

    In der Zeit vom 11.10. bis einschließlich 15.10.2010 bin ich nicht erreichbar. Ihre Nachricht wird nicht weitergeleitet.

    Herr Kiupel wird mich in dieser Zeit vertreten: m.kiupel@pc-team.de

    Sie erreichen unser PC-Team unter der Rufnummer 02291 - 9267-0

    Besten Dank für Ihr Verständnis und

    mit freundlichen Grüßen

    Klaus Ader



  • 80.  RE: VDR email notifications working...

    Posted Oct 14, 2010 08:19 AM

    MTA on the VDR Server

    == Edit Exim's config file to add the following settings

    vi /etc/exim/exim.conf

    Locate the line that reads "# qualify_domain =", uncomment it and edit it to

    qualify_domain = example.com

    (replace with you fully qualified domain obviously)

    Then add this before the “dnslookup:” section. Replace 10.1.1.2 with the address of your mail relay/smarthost.

    to_smart_host:

    driver = manualroute

    domains = ! +local_domains

    transport = remote_smtp

    route_list = "* 10.1.1.2;"

    == Restart exim

    service exim restart

    == Install mailx

    yum install mailx

    == The Script

    Place the script at /usr/local/bin/vdr-report.sh

    chmod +x /usr/local/bin/vdr-report.sh

    == Setup Cron

    Add a new cron entry to root's crontab

    crontab -e

    SHELL=/bin/bash

    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

    #m h dom mon dow command

    0 9 * * * /usr/local/bin/vdr-report.sh

    Research how cron works to alter when the report is sent.



  • 81.  RE: VDR email notifications working...

    Posted Oct 14, 2010 09:00 AM

    Hi,

    Thanks all for your scripts, I built mine using your ideas.

    Btw, I did not configure exim neither install anything else, default exim is working fine for me.

    See attached files. You need a /root/scripts directory, and put the script in it.

    Hope to help :smileyhappy:



  • 82.  RE: VDR email notifications working...

    Posted Oct 14, 2010 09:16 AM

    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.



  • 83.  RE: VDR email notifications working...

    Posted Oct 14, 2010 10:47 AM

    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?



  • 84.  RE: VDR email notifications working...

    Posted Oct 20, 2010 08:49 AM

    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



  • 85.  RE: VDR email notifications working...

    Posted Oct 20, 2010 01:23 PM

    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.



  • 86.  RE: VDR email notifications working...

    Posted Oct 27, 2010 08:12 PM

    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?



  • 87.  RE: VDR email notifications working...

    Posted Oct 28, 2010 07:09 AM

    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).



  • 88.  RE: VDR email notifications working...

    Posted Oct 28, 2010 06:24 PM

    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!



  • 89.  RE: VDR email notifications working...

    Posted Nov 08, 2010 08:18 AM

    Hi,

    A bug in my script ( :smileysilly: ) :

    Change

    if [[ $ != 0 && $ != 0 ]] with if [[ $ != 0 || $ != 0 ]]



  • 90.  RE: VDR email notifications working...

    Posted Nov 23, 2010 07:06 AM













  • 91.  RE: VDR email notifications working...

    Posted Nov 23, 2010 07:15 AM

    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.



  • 92.  RE: VDR email notifications working...

    Posted Nov 23, 2010 10:00 AM

    Hi,

    Up to u to add -i to the command, I think you could change

    GREP=/bin/grep

    with

    GREP=/bin/grep -i

    Or something similar

    I attach the scripts with english comments in my post.

    I hope this help you :smileyhappy:



  • 93.  RE: VDR email notifications working...

    Posted Nov 25, 2010 03:01 PM

    Hi !

    many thanks for the translation :smileyhappy: now it´s easyer for me to do something with the script ... and I have done something :smileywink: (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 -&gt; successfully or idle/loading/preparing -&gt; 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 -&gt; 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



  • 94.  RE: VDR email notifications working...

    Posted Dec 01, 2010 01:55 PM

    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



  • 95.  RE: VDR email notifications working...

    Posted Dec 01, 2010 02:00 PM

    I wish I was a beta tester :smileyhappy:

    I did fill the beta signup form but no answer :smileysad:



  • 96.  RE: VDR email notifications working...

    Posted Dec 02, 2010 01:41 PM

    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



  • 97.  RE: VDR email notifications working...

    Posted Dec 02, 2010 03:42 PM

    Hi Matthias,

    yes - i mistyped it, correct name for me is vdrreport3.sh - but the name of the script doesnt´t matter - you can rename it as you like.

    The vdrreport3.sh is a modificated version of sharantys script (modifications see above) - you need only the script and the mail_header-file.

    HTH

    Peter



  • 98.  RE: VDR email notifications working...

    Posted Dec 03, 2010 12:07 PM

    I just want to say that I implemented the " vdrreport3.sh" on a new testserver yesterday. Unfortenly the script has some errors resulting in that it looks like it doesn't work. I can provide more information if someone wants to have the details and fix the script via email (anders.nyman@exait.se).

    /Anders



  • 99.  RE: VDR email notifications working...

    Posted Dec 03, 2010 12:21 PM

    I'm not sure that someone will want to fix the things for you :smileyhappy:



  • 100.  RE: VDR email notifications working...

    Posted Dec 03, 2010 01:54 PM

    That was not my intention. Just wanted to say that there are issues with this script that gives false results in the email. For instant it said to me:

    #########################################

    Successfull: 2

    Errors: 11

    Snapshot-Errors: 1

    Incomplete: 0

    Snapshots deleted: 0

    #########################################

    What really happened is that one virtual machine backup failed. 13 machine was sucessfull..... :smileyhappy:



  • 101.  RE: VDR email notifications working...

    Posted Dec 03, 2010 01:56 PM

    I didn't try this version, you may try my version I posted earlier and see what happens.



  • 102.  RE: VDR email notifications working...

    Posted Dec 03, 2010 02:12 PM

    Do most of you run your scripts multiple times in a day or just once a day?

    We have not been able to get any of these tweaked scripts to work except for original script posted. My guess is all scripts will need to be tweaked again after loading 2.0



  • 103.  RE: VDR email notifications working...

    Posted Dec 03, 2010 02:14 PM

    My script is for 1 time / day.

    And it works perfectly on prod environment atm.

    Where did you get news about 2.0 ? First time I heard of it was in this thread.

    Before this I wasnt sure that vdr was still a valid product still in development or not ...

    Any upcoming change list in vdr 2 ?



  • 104.  RE: VDR email notifications working...

    Posted Dec 03, 2010 02:31 PM

    I run them once a day. I have tested both scripts on my last night backup and the script from TKND_HOT has a problem wheres Sharantyr3 works better.

    So if you use please be aware that there is some issue with that script that makes it report the wrong result.

    /Anders



  • 105.  RE: VDR email notifications working...

    Posted Dec 06, 2010 11:39 AM

    &gt; the script from TKND_HOT has a problem

    Could you describe the problem? For me the scripts works without any problem.

    But if you are happy with sharantyrs script and no one else needs my modded version, it isn´t really neccessary to debug it :smileyhappy:

    Greets

    Peter



  • 106.  RE: VDR email notifications working...

    Posted Dec 06, 2010 12:20 PM

    I had one host failing and about 12 sucessfull but the script says in the summary:

    #########################################

    Successfull: 1

    Errors: 46

    Snapshot-Errors: 2

    Incomplete: 0

    Snapshots deleted: 0

    #########################################

    To me this is an indication that all hosts but 1 failed. So the script doesn't work or I dont understand the result :smileyhappy:

    /Anders



  • 107.  RE: VDR email notifications working...

    Posted Dec 06, 2010 12:35 PM

    I think it worth updating ur script, as it outputs something more human readable (you said). Mine is not very user friendly.

    Anyway I won't spend more time in this script because TKDN HOT said 2.0 should make me happy about daily logs, and that 2.0 change things in the output log mechanics.

    So the scripts will need to be remade I guess.



  • 108.  RE: VDR email notifications working...

    Posted Dec 06, 2010 01:37 PM

    &gt; Anyway I won't spend more time in this script

    For me it´s the same ... waiting for 2.0 ...

    @[~580309]: the counts are generated by grep -c. So you should compare the list of your results and the count ...

    Greets

    Peter



  • 109.  RE: VDR email notifications working...

    Posted Dec 09, 2010 08:28 PM

    Your scripts are very good and works but I'm not receiving mails. I configured my mail in your 2 scripts but I get nothing. Is there a setting to add exim.conf for this to work. Excuse me for my english but i'm a poor french.



  • 110.  RE: VDR email notifications working...

    Posted Dec 13, 2010 12:00 PM

    Hi,

    I changed nothing in my exim conf, it found out itself the good smtp server.

    Maybe you can search on google how to configure exim as a mail relay using your local smtp server.



  • 111.  RE: VDR email notifications working...

    Posted Dec 16, 2010 05:32 PM

    Hi, ok, thank you, I managed to configure exim, I receive many mails but why the message body is found in the object, is there an error in the "mail_header" or in the 2 scripts sh? Thank you for your reply.



  • 112.  RE: VDR email notifications working...

    Posted Dec 21, 2010 12:02 PM

    A simple way to do it by telnet is to follow this article (in italian, but very easy to google-translate):

    http://vmgmt.wordpress.com/2010/12/21/vmware-data-recovery-alert-via-email/

    This is the result:

    OGGETTO:

    VDR2-01 VDR-Report 2010.12.21 08:50 New jobs OK: 3, New jobs in errore: 0

    MESSAGGIO:

    Aggiornamento dall’ultimo mail-report dello stato dei Backup Vmware su VDR2-01 del 2010.12.21 08:50 ULTIMI BACKUP OK: 3, ULTIMI BACKUP IN ERRORE: 0

    ####################################################################

    ******************* Dettaglio Jobs Ok (3) **********************

    >

    > 12/20/2010 9:37:39 AM : Starting incremental integrity check 5/%D

    > %.1T: Starting incremental integrity check] 12/20/2010 9:54:33 AM :

    > Execution completed successfully 1/%D %.1T: %s]

    >

    > 12/20/2010 2:00:43 PM : Performing incremental back up of disk "

    > [DSFC01] szuccapp_1/szuccapp-flat.vmdk 12/20/2010 2:03:13 PM :

    > Execution completed successfully 1/%D %.1T: %s]

    >

    > 12/20/2010 2:05:24 PM : Performing incremental back up of disk "

    > [DSFC01] szuccdb_2k3_64/szuccdb_2k3_64_1-flat.vmdk

    > 12/20/2010 2:34:59 PM : Execution completed successfully 1/%D %.1T:

    > %s]

    ####################################################################

    ********************* Jobs in errore totale: (0) ************************

    Tutto ok: nessun processo è andato male!!

    :smileycool:



  • 113.  RE: VDR email notifications working...

    Posted Dec 03, 2010 02:50 PM

    Not allowed to say, check the beta community link I posted earlier in this thread for my beta testing updates...that's if you are registered for beta. You didn't hear from me but... if you DO NEED more then 1 email a day...you may need to adjust your scripts. I posted our log, use it if you like to prepare for 2.0

    I can tell you the original script of this thread fails on searching for "error" AND "successful", the vm name has changed to a variable for those entries, although it does work for the word "terminate", again review the log. Test on it, although it is beta so it could change.



  • 114.  RE: VDR email notifications working...

    Posted Dec 03, 2010 02:59 PM

    I think it's kind of sad that a major version (1.2 -> 2.0 is major to me) doesn't include yet a real log reporting system :smileysad:

    My 2 cents



  • 115.  RE: VDR email notifications working...

    Posted Dec 03, 2010 03:49 PM

    Sharantyr3,

    You did state 1 email a day right?, if so...you'll be happy with the new version, trust me.

    Myself...I like to get emails right away... on any errors concerning "failed backups", between hours of 7am to 10pm, that is why I am trying to fix my script to adapt. I asked for them to add a real-time email error alert with a time schedule, ie: anytime or during a time period. Not sure it will be considered. If it is, no need for custom scripts.

    Hope this clarifies.



  • 116.  RE: VDR email notifications working...

    Posted Dec 03, 2010 03:52 PM

    Ah so it sounds like a good news.

    I think it's easy to catch an error in "real time" (check every 5 minuts for exemple), in fact much more easy that a summary of daily actions.

    I'll see what I can do if they don't release that, when I'll have access to 2.0 :smileyhappy:

    Because it would be too slow to make something only with source logs, need to test from localside.



  • 117.  RE: VDR email notifications working...

    Posted Oct 26, 2010 08:40 AM

    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



  • 118.  RE: VDR email notifications working...

    Posted Oct 26, 2010 08:46 AM

    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.



  • 119.  RE: VDR email notifications working...

    Posted Oct 26, 2010 09:47 AM

    Thanks,

    The file is recreated but it runs a recatalog task.

    Why it takes so long, for you too



  • 120.  RE: VDR email notifications working...

    Posted Oct 26, 2010 11:47 AM

    You mean integrity check ?

    Recatalog is fast for me. Integrity can be very long.



  • 121.  RE: VDR email notifications working...

    Posted Jan 12, 2011 09:03 AM

    Hello,

    I have installed the latest mail notification script, and all works fine.

    Now I do not understand the meaning of an error in the email report:

    #########################################

    Successfull:          11

    Errors:               0

    Snapshot-Errors:     3

    Incomplete:          0

    Snapshots deleted:     0

    #########################################

    ------------------> ERRORS :

    #########################################

    1/11/2011 9:01:22 PM: Performing incremental back up of disk "[VM02] vm-xxxx/vm-xxxx-000002-flat.vmdk" using "Network"

    1/11/2011 9:02:28 PM: Performing incremental back up of disk "[VM03] vm-yyyy-spr/vm-yyyy-spr-000002-flat.vmdk" using "SCSI Hot-Add"

    1/11/2011 9:07:37 PM: Performing incremental back up of disk "[VM03] vm-yyyy-spr/vm-yyyy-spr_1-000002-flat.vmdk" using "SCSI Hot-Add"

    #########################################

    Can someone explain the meaning of Snapshot Error?

    Thanks a lot.



  • 122.  RE: VDR email notifications working...

    Posted Jan 12, 2011 09:08 AM

    Hi,

    I introduced this "snapshot error" but it's not very revelant.

    Let me explain.

    Sometimes, vdr seems to bug and don't delete the snapshot it created. This "error" tells you that the VM'disk being backep up is a snapshot of the disk.

    I'm not sure if it's very clear but it warned me many times about a VM locked with a VDR snapshot.


    Simple version :

    When you receive this message, just check that this particular VM has no unwanted snapshots.

    If all is ok, you're fine.

    Else you probably will run in an undeletable snapshot issue, that will need "new snapshot" + "delete all" to get resolved.



  • 123.  RE: VDR email notifications working...

    Posted Jan 12, 2011 11:13 AM

    Hello Shanityr3

    Thanks for clarification, another question,

    how can I clear these errors in the log after verifying that there are no problems with the snapshot?

    Because every day I receive log contains these errors, even though in reality I do not see any snapshot locked for Vm reported in the log.

    Thanks a lot.



  • 124.  RE: VDR email notifications working...

    Posted Jan 12, 2011 11:45 AM

    I think ur using a modified version of my script.

    Try mine and see what happens. I gave instructions ealier.



  • 125.  RE: VDR email notifications working...

    Posted Jan 12, 2011 09:30 AM

    With this version:

    http://vmgmt.wordpress.com/2010/12/21/vmware-data-recovery-alert-via-email/

    you can view details of all errors, snapshot errors included

    Hope this helps



  • 126.  RE: VDR email notifications working...

    Posted Jan 12, 2011 11:15 AM

    Grazie Marco,

    I tried your script, but I found several problems with the copy and paste from your ownsite.
    Could you post here your version as a file attachment?

    Thanks.



  • 127.  RE: VDR email notifications working...

    Posted Jan 12, 2011 11:28 AM

    just replace all strange “ or ” with a simple " and it will work fine


    in this example, in the body of the email you can see all details of the appliance:


    jobs (successful or in error), integrity check (ok or not) and incomplete for any reason and restore point deleted by retention policy...and so on..


    you can go deeper as you want, just add a "string -e" detail under the section # errorlist of the config file.

    Aggiornamento dall'ultimo mail-report dello stato dei Backup Vmware su VDR2-02 del  2011.01.12 08:50 ULTIMI BACKUP OK: 12, ULTIMI BACKUP IN ERRORE: 3

    ####################################################################

    ******************* Dettaglio Jobs Ok (12) **********************

    > 1/11/2011 9:00:05 AM:  Starting incremental integrity check 5/%D %.1T:

    > Starting incremental integrity check]

    > 1/11/2011 9:10:40 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/11/2011 10:00:20 AM : Deleted restore point 12/28/2010 0:00:09.000

    > AM for virtual machine

    > 1/11/2011 10:07:39 AM : Execution completed successfully 1/%D %.1T:

    > %s]

    > 1/11/2011 7:01:10 PM:  Performing incremental back up of disk "

    > [DSFC03] sfitmonitoring/sfitmonitoring-flat.vmdk

    > 1/11/2011 7:16:51 PM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/11/2011 7:01:18 PM:  Performing incremental back up of disk "

    > [DSFC03] sfitproxywmi/sfitproxywmi-flat.vmdk

    > 1/11/2011 7:18:09 PM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:02:59 AM:  Performing incremental back up of disk "

    > [DSFC03] sarianna05/sarianna05-flat.vmdk

    > 1/12/2011 1:10:33 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:02:40 AM:  Performing incremental back up of disk "

    > [DSFC09] Sdatacdc1/Sdatacdc1-flat.vmdk

    > 1/12/2011 1:11:21 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:04:50 AM:  Performing incremental back up of disk "

    > [DSFC08] sdafitrm03-dc/sdafitrm03-dc-flat.vmdk

    > 1/12/2011 1:12:16 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:02:09 AM:  Performing full back up of disk " [DSFC03]

    > srbaserm03-dc/srbaserm03-dc-flat.vmdk

    > 1/12/2011 3:23:54 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:04:11 AM:  Performing full back up of disk " [DSFC02]

    > sfitdc00/sfitdc00-flat.vmdk

    > 1/12/2011 3:34:43 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:01:09 AM:  Performing full back up of disk " [DSFC03]

    > sfitrm02-dc/sfitrm02-dc-flat.vmdk

    > 1/12/2011 4:15:54 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:03:22 AM:  Performing full back up of disk " [DSFC03]

    > CafitCed/CafitCed-flat.vmdk

    > 1/12/2011 4:30:34 AM:  Execution completed successfully 1/%D %.1T: %s]

    > 1/12/2011 0:04:30 AM:  Performing full back up of disk " [DSFC01]

    > Sfitnet01-01/Sfitnet01-01-flat.vmdk

    > 1/12/2011 4:35:20 AM:  Execution completed successfully 1/%D %.1T: %s]

    ####################################################################

    ********************* Jobs in errore totale: (3) ************************

    Backup in errore: 0 - Backup incompleti: 3 - Integrity Chek KO: 0

    >  

    > 1/11/2011 0:02:56 AM: Performing incremental back up of disk "

    > [19][DSFC10]

    > sfitnet07-intranetfit-new/sfitnet07-intranetfit-new-flat.vmdk

    > 1T00:02:56.000Z+01:0

    > 1/11/2011 9:00:03 AM:  [*20750]Script execution terminated at

    > specified stop time. 1T09:00:03.000Z+01:0

    > 1/11/2011 9:07:15 AM: Execution incomplete [//11/%D %.1T: %s]

    >  

    > 1/11/2011 0:01:42 AM: Performing full back up of disk " [19][DSFC03]

    > sfitnet03-fitmail/sfitnet03-fitmail-flat.vmdk 1T00:01:42.000Z+01:0

    > 1/11/2011 9:00:03 AM:  [*20750]Script execution terminated at

    > specified stop time. 1T09:00:03.000Z+01:0

    > 1/11/2011 9:25:24 AM: Execution incomplete [//11/%D %.1T: %s]

    >  

    > 1/11/2011 0:02:29 AM: Performing full back up of disk " [19][DSFC09]

    > sfitnet08-mdc/sfitnet08-mdc-flat.vmdk 1T00:02:29.000Z+01:0

    > 1/11/2011 9:00:03 AM:  [*20750]Script execution terminated at

    > specified stop time. 1T09:00:03.000Z+01:0

    > 1/11/2011 9:26:55 AM: Execution incomplete [//11/%D %.1T: %s]

    Updated from MarcoG



  • 128.  RE: VDR email notifications working...

    Posted Nov 22, 2011 08:15 AM

    Hi Marco!

    Thanks for your script, one question though, why do we get 1/%D %.1T: %s] after execution completed or execution error ?

    Thanks

    Chris



  • 129.  RE: VDR email notifications working...

    Posted Nov 22, 2011 10:16 AM

    it is the "string -e" detail in the config file...u can modify it as you want...



  • 130.  RE: VDR email notifications working...

    Posted Nov 22, 2011 12:25 PM

    Just install VDR 2.0, its out now, been for awhile, has email alert.



  • 131.  RE: VDR email notifications working...

    Posted Feb 03, 2011 04:03 PM

    I tried both of these scripts and tried running them from the console by doing "sh filename.sh" and both throw errors.

    The one from Marco, I'm not sure how to define the variables, do you enter them twice? Like the SMTP row has the IP, do I enter it two times?

    On the original script do you need to isntall that telnet RPM or can I just run the script?



  • 132.  RE: VDR email notifications working...

    Posted Feb 04, 2011 09:15 AM

    You have to run it in this way:

    edit a file, copy & paste the code, rename the file in vdrreport.sh and put the file in /tmp (for example)

    cd /

    /tmp/vdrreport.sh

    :smileywink:



  • 133.  RE: VDR email notifications working...

    Posted Mar 22, 2011 12:31 AM

    Good Day Everyone,

       It's been a while since I have been on the VMware posts. Here is a script that should solve everyone's email issue with VDR. The approriate references to the original author(s) have been given. The script works with the Linux service known as INCRON. The INCRON service functions as a trigger to execute the script. The operations.utx is read and the script exectues. You must choose an email service of your choosing.

    Thanks

    Steve



  • 134.  RE: VDR email notifications working...

    Posted Mar 25, 2011 08:33 AM

    Hello Stevester,

    Scripts looks promising for me, unfortunately all what i know to do is: rpm -ivh :smileyhappy: could you please write more or less steb by step how to configure and run it?



  • 135.  RE: VDR email notifications working...

    Posted Apr 01, 2011 12:05 PM

    We´re also very interested in getting e-mail notification from VDR and i agree with 214kris. It would be awsome to have some detailed instructions how to set this up.



  • 136.  RE: VDR email notifications working...

    Posted Apr 01, 2011 12:07 PM

    Hi,

    You can read above, and find my script, which is working without need to configure anything.

    We use it in production state without problems.



  • 137.  RE: VDR email notifications working...

    Posted Apr 01, 2011 06:21 PM

    Hello All interested with emails from VDR,

    At the end I used this one: http://vmgmt.wordpress.com/2010/12/21/vmware-data-recovery-alert-via-email/  and it works OK for me, and good bless those who write it.

    I had some problems but it was cause my stupidness :smileyhappy: I get this script by Win XP and edit by wordpad, forgot to convert it to be able using by linux :smileylaugh: result was: "unexpected end of file" or "syntax error"

    One more time thx for script

    Regards

    Kris



  • 138.  RE: VDR email notifications working...

    Posted Apr 01, 2011 12:12 PM

    I am currently out of the office. Please feel free to call the Kemba Helpdesk at 513-763-1822 for assistance.

    Ryon Brubaker

    IT Manager

    Kemba Credit Union, Inc.

    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.