Posts Tagged ‘script’

ITM Logs Timestamp Conversion

July 8th, 2009

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; }’

  • Share/Bookmark

Tags: , , , , , , , , , ,
Posted in ITM6.x | Comments (0)

ITM : Testing Windows Event Logs

July 7th, 2009

In a nutshell: use theeventcreate

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, calledeventcreateid

Example : eventcreate /ID 101 /SO FooBar /D “Test Message for ITM” /T ERROR /L Application

  • Share/Bookmark

Tags: , , , , , , , , , , , , , ,
Posted in ITM6.x, WindozeMiscellaneous | Comments (0)

ITM Logs Timestamp Conversion

June 29th, 2009

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; }'
  • Share/Bookmark

Tags: , , , , , , , , , , , , ,
Posted in ITM6.x | Comments (0)

“Smart um_cleanup”

March 21st, 2009

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

#############################################################################

  • Share/Bookmark

Tags: , , , , , , , , , , , , ,
Posted in ITM, Non-Tivoli | Comments (0)

  • LinkedIn

    If you want to see my LinkedIn profile, click on this button:

    Jim Sander
  • Save MySQL

JDS Media is Digg proof thanks to caching by WP Super Cache