I am writing a script to give me the output of the TSM 'events' table, showing the error code for when a backup failure occurs. I have written a script which, when launched from the AIX terminal, runs:
dsmadmc -se=$tsm_server -id=$var_userid -password=$var_pswd "SELECT node_name,actual_start,completed,status,result,reason FROM events WHERE node_name='$var_client' AND scheduled_start> '$var_date 00:00:00' AND status!='Future'"
When I run this script, the resulting output gives me the login header info about the TSM version, IBM copyright info, etc, and then my result. I want to remove all of this and just see the result for the client being backed up.
I have tried piping the result into various unix tools, such as 'tail -n +10', grep -vE "{ANS error message}", etc, but no matter which one I use, I get a garbled result, as per the second screenshot.
I have other SELECT queries in my script, which I have been able to successfully cut out extraneous information without affecting the result:
dsmadmc -se=$tsm_server -id=$var_userid -password=$var_pswd "SELECT nodename,date_time,message FROM actlog WHERE nodename='$var_client' AND severity='E' AND date_time> '$var_date 00:00:00' ORDER BY date_time" | tail -n +10
Both queries appear to be the same to me yet I am getting vastly different results when piping them into 'tail' or 'grep', in order to clean up the result. Does anyone know why this is and what can be done to get the desired result?
dsmadmc -se=$tsm_server -id=$var_userid -password=$var_pswd "SELECT node_name,actual_start,completed,status,result,reason FROM events WHERE node_name='$var_client' AND scheduled_start> '$var_date 00:00:00' AND status!='Future'"
When I run this script, the resulting output gives me the login header info about the TSM version, IBM copyright info, etc, and then my result. I want to remove all of this and just see the result for the client being backed up.
I have tried piping the result into various unix tools, such as 'tail -n +10', grep -vE "{ANS error message}", etc, but no matter which one I use, I get a garbled result, as per the second screenshot.
I have other SELECT queries in my script, which I have been able to successfully cut out extraneous information without affecting the result:
dsmadmc -se=$tsm_server -id=$var_userid -password=$var_pswd "SELECT nodename,date_time,message FROM actlog WHERE nodename='$var_client' AND severity='E' AND date_time> '$var_date 00:00:00' ORDER BY date_time" | tail -n +10
Both queries appear to be the same to me yet I am getting vastly different results when piping them into 'tail' or 'grep', in order to clean up the result. Does anyone know why this is and what can be done to get the desired result?