Re: [ADSM-L] finding possible values for a particular column
2015-04-10 10:37:13
It's just a bash script, so:
yesterday=`date -d yesterday +%m/%d/%Y`
today=`date +%m/%d/%Y`
-
Cameron Hanover
chanover AT umich DOT edu
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
--Benjamin Franklin
> On Apr 9, 2015, at 3:18 PM, Rhodes, Richard L. <rrhodes AT FIRSTENERGYCORP
> DOT COM> wrote:
>
> Hi Cameron,
>
> I'd be interested how you get the value for var ${yesterday} in your script?
> (assuming you compute it off of ${today} ?)
>
> I've wanted to derive an earlier date (like the date of a week ago) in a
> script a number of times and couldn't come up with a simple way to do it.
>
> Rick
>
>
> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf
> Of Hanover, Cameron
> Sent: Thursday, April 09, 2015 1:15 PM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Re: finding possible values for a particular column
>
> Rather than figure out all the possible conditions, I just scripted for the
> ones I cared about and warned on the rest:
>
> for STATUS in `tsm_run_command_as_admin $INSTANCE -tab "select status from
> events where domain_name like upper('${PREFIX}%') and
> scheduled_start>'${yesterday} 09:00' and scheduled_start<'${today} 09:00'"`;
> do
> if [[ "$STATUS" == Failed* ]]; then
> NODESFAILED="YES"
> elif [ "$STATUS" = "Missed" ]; then
> NODESMISSED="YES"
> # Some unknown exception will produce a "WARNING"
> elif [ ! "$STATUS" = "Completed" ] && [ ! "$STATUS" = "In Progress" ]
> && [ ! "$STATUS" = "Started" ] && [ ! "$STATUS" = "Pending" ]; then
> EXCEPTIONFOUND="YES"
> fi
> done
> …
> if [ "$NODESFAILED" = "YES" ]; then
> SUBJECT="[TSMCLIENT] NODES FAILED: $LABEL Daily Report"
> elif [ "$NODESMISSED" = "YES" ]; then
> SUBJECT="[TSMCLIENT] NODES MISSED: $LABEL Daily Report"
> elif [ "$EXCEPTIONFOUND" = "YES" ]; then
> SUBJECT="[TSMCLIENT] WARNING: $LABEL Daily Report"
> else
> SUBJECT="[TSMCLIENT] $LABEL Daily Report"
> fi
>
>
> Hopefully the variable names are obvious. Might have been better with
> `case`, but this works.
>
> --
> Cameron Hanover
> chanover AT umich DOT edu
>
> "A computer once beat me at chess, but it was no match for me at kick boxing."
> --Emo Philips
>
>> On Apr 8, 2015, at 2:55 PM, Lee, Gary <GLEE AT BSU DOT EDU> wrote:
>>
>> Is there a list somewhere of the possible values for different columns in
>> the tsm database?
>>
>> What I am particularly looking for are all the possible values of the status
>> column in the events table.
>>
>> Writing a script to notify backup schedules which have gone amiss.
>>
>> Don't care about restarted, in progress, etc. just error conditions.
>>
>> Thanks for any pointers.
>
>
> -----------------------------------------
> The information contained in this message is intended only for the personal
> and confidential use of the recipient(s) named above. If the reader of this
> message is not the intended recipient or an agent responsible for delivering
> it to the intended recipient, you are hereby notified that you have received
> this document in error and that any review, dissemination, distribution, or
> copying of this message is strictly prohibited. If you have received this
> communication in error, please notify us immediately, and delete the original
> message.
|
|
|