Re: finding possible values for a particular column
Another possibly interesting way to do it: tsm select distinct(date(current_timestamp - 1 day)) from any table - Cameron Hanover chano...@umich.edu When any government, or church for that matter, undertakes to say to its subjects, this you may not read, this you must not see, this you are forbidden to know, the end result is tyranny and oppression, no matter how holy the motive. --Robert A. Heinlein On Apr 10, 2015, at 3:29 PM, Mitchell, Ruth Slovik rmi...@illinois.edu wrote: This will give you yesterday's date from ksh on AIX: YESTERDAY=`TZ=aaa24 date +%Y%m%d` echo $YESTERDAY (found on www.unix.com) --Ruth U of Illinois, Urbana -Original Message- From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Rhodes, Richard L. Sent: Friday, April 10, 2015 11:22 AM To: ADSM-L@VM.MARIST.EDU Subject: Re: [ADSM-L] finding possible values for a particular column Hmmm . . . Linux . . . We're on AIX and its date doesn't handle that. Have to see about getting gnu date for aix. Thanks! Rick -Original Message- From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Hanover, Cameron Sent: Friday, April 10, 2015 10:36 AM To: ADSM-L@VM.MARIST.EDU Subject: Re: finding possible values for a particular column It's just a bash script, so: yesterday=`date -d yesterday +%m/%d/%Y` today=`date +%m/%d/%Y` - Cameron Hanover chano...@umich.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. rrho...@firstenergycorp.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@VM.MARIST.EDU] On Behalf Of Hanover, Cameron Sent: Thursday, April 09, 2015 1:15 PM To: ADSM-L@VM.MARIST.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 chano...@umich.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 g...@bsu.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. - 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
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 chano...@umich.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 g...@bsu.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.
Re: finding possible values for a particular column
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@VM.MARIST.EDU] On Behalf Of Hanover, Cameron Sent: Thursday, April 09, 2015 1:15 PM To: ADSM-L@VM.MARIST.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 chano...@umich.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 g...@bsu.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.
Re: finding possible values for a particular column
You can always use a ~select distinct(field)~ to view what is within your current environment. tsm:select distinct(status) from events STATUS -- Completed Failed Future Missed Severed tsm: Dwight E. Cook Technical Services Prof. Sr. Strategic Outsourcing Delivery (918) 493-4678 From: Lee, Gary g...@bsu.edu To: ADSM-L@VM.MARIST.EDU Date: 04/08/2015 01:55 PM Subject:finding possible values for a particular column Sent by:ADSM: Dist Stor Manager ADSM-L@VM.MARIST.EDU 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.
Re: finding possible values for a particular column
Gary, You could start with these: failed, failed - no restart, severed, pending. Then, find any others by sending the output of a select statement or a macro to a csv file and sort it by status. The query we run every month is like this with the dates updated: select scheduled_start,domain_name,node_name,status from events where scheduled_start '1900-01-01' and scheduled_start= '2015-04-01' and scheduled_start '2015-05-01' and domain_name ' ' order by scheduled_start Other status conditions are; In Progress, Started, Future, but they aren’t really conditions. For ordinary tables you could run a ‘select unique status from tablename’, but I doubt that will work from the Events table. Good hunting, Keith Arbogast Indiana University On Apr 8, 2015, at 2:55 PM, Lee, Gary g...@bsu.edumailto:g...@bsu.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.
Re: finding possible values for a particular column
Wow, I forgot ‘Missed’. It takes a community to support TSM. Thank you Dwight. K. On Apr 8, 2015, at 3:28 PM, Arbogast, Warren K warbo...@iu.edumailto:warbo...@iu.edu wrote: Gary, You could start with these: failed, failed - no restart, severed, pending. Then, find any others by sending the output of a select statement or a macro to a csv file and sort it by status. The query we run every month is like this with the dates updated: select scheduled_start,domain_name,node_name,status from events where scheduled_start '1900-01-01' and scheduled_start= '2015-04-01' and scheduled_start '2015-05-01' and domain_name ' ' order by scheduled_start Other status conditions are; In Progress, Started, Future, but they aren’t really conditions. For ordinary tables you could run a ‘select unique status from tablename’, but I doubt that will work from the Events table. Good hunting, Keith Arbogast Indiana University On Apr 8, 2015, at 2:55 PM, Lee, Gary g...@bsu.edumailto:g...@bsu.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.