Amanda-Users

Re: I want to make the shell script to judge the amdump Success or Failed with no mail.

2007-12-21 09:35:48
Subject: Re: I want to make the shell script to judge the amdump Success or Failed with no mail.
From: "Dustin J. Mitchell" <dustin AT zmanda DOT com>
To: "Yoshihiro Ishikawa" <chiyotsu AT gmail DOT com>
Date: Fri, 21 Dec 2007 09:28:09 -0500
On Dec 21, 2007 8:26 AM, Yoshihiro Ishikawa <chiyotsu AT gmail DOT com> wrote:
> So, my question is what is the best solution to judge the ※"last amdump
> result" Success or Failed with no mail.
> ※"last amdump result" is the adjacent amdump result.
>
> First of all,I checked the amadmin command(amadmin DailySet01 find --sort
> d), but that wasn't complete.
> I experienced to show the no line  when the amdump was failed.
>
> Second of all, I checked the "amdump.1 log". But I don't know the all
> pattern about Success or Failed.
> I know the next line's script isn't enough.
> "less DailySet01/amdump.1 | grep -e -i "fail\|missing\|error"
>
> Third of all, I checked the "amreport command". But that includes amreport's
> log.
> Example: "amreport: ERROR unexpexted log line...."
>
> I made the output  to do next line's script.
> "$ amreport DailySet1 -f outputfile
>  $ grep -e -i "fail\|missing\|error" outputfile"
>
> At least amreport is not a chance because it includes amreport's log.
>
> Please tell me the best solution to judge "last amdump result" Success or
> Failed with no mail.
> I want to know the simple solution!

Part of the problem is that Amanda doesn't define "success" or
"failure" quite the way you do.  For example, if a DLE or two are
unavailable due to network issues, or if there is not enough space on
tape for all of the dumps, Amanda still considers the dump a success.
Depending on your needs, I would suggest either defining a few
"success" conditions, and assuming everything else is failure (which
will probably detect some false failures until you have adjusted your
success conditions), or defining a few "failure" conditions, and
assuming everything else is success.  For both of these options, I
think your last technique -- grepping amreport -- will be the most
effective.

We are working on creating an XML output mode for amreport, although
that work has been stalled on other, more pressing projects.  That may
make your work even easier.

Dustin

-- 
Storage Software Engineer
http://www.zmanda.com


<Prev in Thread] Current Thread [Next in Thread>