i am using something like this ... #This perl script can be used to send diffrent types of allerts from TSM server #Don`t make any changes in this script unless you know perl and how to fix it . # This should remove all the header lines from TSM output # thus giving you a usable report to do as you wish # It opens an argument and a temporary file # strips the headers from the temp file # and then renames the temp file to the # original filename #rename ( $tmpfilename, $filename ); my $filename = "/tmp/file.out"; #$ARGV[0]; my $tmpfilename = "/tmp/file2.out"; my $script; $script="$ARGV[0] $ARGV[1]"; system ($script); open ( FH , "$filename" ) || die "no open $!"; open ( FH2 , "> $tmpfilename" ) || die "no open $!"; # should open two files, a temp and the orig while (<FH>) { if ( $_ =~ /^(Tivoli|Command|\(C\)|\s|ANS8002I|ANR1462I|ANS8000I)/ ) { } else { print FH2 $_; } } close ( FH ); close ( FH2 ); #my $people="shekhar.dhotre\@lendleaserei.com" ; my $people="shekhar.dhotre\@lendleaserei.com,adrian.ortiz\@lendleaserei.com,davi "; system("mailx -s\"Midrange ATLANTA- Daily backup status\" $people \< /tmp/file2 .out" ); unlink $filename; unlink $tmpfilename;
Matt Simpson <[EMAIL PROTECTED]> Sent by: "ADSM: Dist Stor Manager" <[EMAIL PROTECTED]> 01/07/2003 08:27 AM Please respond to "ADSM: Dist Stor Manager" To: [EMAIL PROTECTED] cc: Subject: Re: Format of output file using select statements At 23:33 -0600 1/6/03, Roger Deschner wrote: >Neither of these formats, which were designed to be human-readable, are >particularly easy for re-digestion by a computer program of any kind - >especially when a field is split across lines. One of the challenges to machine-readable output from dsmadmc is all the extra stuff it wraps around the output, e.g: -- Tivoli Storage Manager Command Line Administrative Interface - Version 5, Release 1, Level 1.0 (C) Copyright IBM Corporation 1990, 2002 All Rights Reserved. Session established with server UKCCSERVER1: Solaris 7/8 Server Version 4, Release 2, Level 3.0 Server date/time: 01/07/03 08:15:20 Last access: 01/07/03 08:14:44 (stuff I really want) ANS8002I Highest return code was 0. -- People here have suggested various ingenious combinations of tail/awk/grep to strip out the garbage, and they work fairly well. But that seems a little Rube Goldbergish, and I'm a little worried that it might break if something in the output changes. I think I already know the answer (No), but does anybody know of a way to keep that stuff from appearing in the output, instead of finding it and throwing it away afterwards? -- Matt Simpson -- OS/390 Support 219 McVey Hall -- (859) 257-2900 x300 University Of Kentucky, Lexington, KY 40506 <mailto:[EMAIL PROTECTED]> mainframe -- An obsolete device still used by thousands of obsolete companies serving billions of obsolete customers and making huge obsolete profits for their obsolete shareholders. And this year's run twice as fast as last year's.