ITM v6 log files use a hexadecimal timestamp (to save space? who the hell knows), which adds unnecessary effort when the reason you’re looking at the logs is to determine an issue in the first place. In any case… Here’s the script I wrote when I first encountered the nonsense in ITM v6 logs a few years ago:
#!/bin/perl
foreach (<STDIN>) {
if (/^[^\s\d\w]+([\w\d]*)/) {
@t=localtime(hex($1));
$time=sprintf(“%02d:%02d:%02d %02d/%02d/%04d”,
$t[2],$t[1],$t[0],$t[4]+1,$t[3],$t[5]+1900);s/^[^\s\w\d]+[\w\d]*/$time/;}print $_;}
Here’s a one-liner that Venkat.Saranathan at Gulfsoft.com cranked out, rendering my script pretty much obsolete
perl -lane ‘if ($_ =\ /^(.)([\dA-F]+)(\..*)/) { printf “%s%s%s”, $1, scalar(localtime(oct(“0x$2″))),$3; }’
Tags: foreach, hexadecimal, itm, localtime, perl, printf, script, stdin, time, time print, unnecessary effort
Posted in ITM6.x | Comments (0)
In a nutshell: use the ‘eventcreate‘
I had an issue with ITM Windows Agent creating events which I was then sending out email alerts via a UNIX script.
The simple problem was backslashes in windows paths where the “Take Action” notification script was literalizing characters which might be part of the EventLog Description
For example:
"c:\Damned these\nagging\slashes\argh"
became
c:\Damned these
agging\slashesrgh
Yes, simply quoting my string would have solved most of my problem, IT DID HOWEVER lead me to a handy windows command for testing, called ‘eventcreateid‘
Example : eventcreate /ID 101 /SO FooBar /D “Test Message for ITM” /T ERROR /L Application
Tags: Damned, eventcreate, example, issue, itm, L Application, notification script, Problem, script, slashes, T ERROR, test message, unix, unix script, windows command
Posted in ITM6.x, WindozeMiscellaneous | Comments (0)
ITM v6 log files use a hexadecimal timestamp (to save space? who the hell knows), which adds unnecessary effort when the reason you’re looking at the logs is to determine an issue in the first place. In any case…
Here’s the script I wrote when I first encountered the nonsense in ITM v6 logs a few years ago:
#!/bin/perl
foreach (<STDIN>) {
if (/^[^\s\d\w]+([\w\d]*)/) {
@t=localtime(hex($1));
$time=sprintf("%02d:%02d:%02d %02d/%02d/%04d",
$t[2],$t[1],$t[0],$t[4]+1,$t[3],$t[5]+1900);
s/^[^\s\w\d]+[\w\d]*/$time/;
}
print $_;
}
Here’s a one-liner that Venkat.Saranathan at Gulfsoft.com cranked out, rending my script pretty much obsolete
perl -lane 'if ($_ =\ /^(.)([\dA-F]+)(\..*)/) { printf "%s%s%s", $1, scalar(localtime(oct("0x$2"))),$3; }'
Tags: foreach, gulfbreeze, hexadecimal, itm, localtime, logs, perl, printf, script, stdin, time, time print, timestamp, unnecessary effort
Posted in ITM6.x | Comments (0)
DOWNLOAD:
The ‘um_cleanup’ script that comes with ITM6 Universal Agent I’m convinced was written by an intern or co-op who just learned the basics of scripting.
I “rewrote” the whole darn thing with the following comments and syntax:
um_cleanup_jds.ksh -h
USAGE: um_cleanup_jds.ksh [UA|CMS|CNPS|ALL]
um_cleanup_jds.ksh -f
You need only supply a single arg - the component or force
where
-f is only required if NO ARGS are supplied
no args assumes ALL and prompts unless '-f'
This is a cleaned up version of the 'um_cleanup' script provided
with ITM6.x. It'll figure out the variables as a half-way decentprogram should.
#############################################################################
# Modified by Jim Sander : jimsander@jdsmedia.net
# Date: 03.20.09
# Laziest damn script fix up
# - there's no reason why somebody in the automation business
# needs to be pluggin in specific variables for an already 'shotgun'
# approach.
# - Added simple iterative loops to run down every friggin
# working path
# - The ONLY required input value should be the 'CLEANOPT'
# and it should take a list
# - no args assumes 'ALL' and prompt or force option
# - take an individual arg
# - TEMSNAME is only used on a TEMS (so why do they expect you to do
# provide it on every component
#############################################################################
Tags: ALL, args, automation business, cleanup, DOWNLOAD, input value, iterative loops, itm ibm universal agent cleanup, Jim Sander, ksh, script, shotgun approach, The, universal agent
Posted in ITM, Non-Tivoli | Comments (0)