The attached script will allow you to work out which TEMAs are OFFLINE in your ITM environment. It will create a file called offline.sql which can then be run interactively using the supplied utility kdstsns to remove OFFLINE agents.

The script works out which systems are offline using an embedded SOAP call.

,
     sysadmin
     
     ManagedSystem
     ManagedSystemName
     Status
     Name
     Managing_System
,

Run checkoffline.pl script.

,
# ./checkoffline.pl
  Please do the following:
     Change directory to /opt/IBM/ITM/tables/cicatrsq/SQLLIB
     Ensure offline.sql file exists
     Run /opt/IBM/ITM/aix513/ms/bin/kdstsns
,

It then writes the relevant information out to an sql file in the following format:

,
INSERT INTO O4SRV.TNODESTS
     ( O4ONLINE, LSTUSRPRF, NODE, THRUNODE )
       VALUES(
              "D",
              "sysadmin",
              "$systemname",
              "$thrunode);
,

Run /opt/IBM/ITM/aix513/ms/bin/kdstsns command from within the /opt/IBM/ITM/tables/cicatrsq/SQLLIB directory where the offline.sql file that has been created resides.

,
# /opt/IBM/ITM/aix513/ms/bin/kdstsns
To terminate the program at any time, enter "end"
Enter NCS Address Family or "Node" (default: *HUB):ip.pipe
Enter host name/address : systemname
Enter NCS Server Port Number (eg. 1024, ....):1918
Path Specification:
NCS:{SOCKET=ip.pipe:systemname[1918]} CT/DS:{SERVER=SRVR01 USER=DSTSNS}
Socket Specifcation:
ip.pipe:systemname[1918]
Server Version: 400 Build: 07288 Host Type: 5 Host Level: 3 Feature: NLS=Y
Requester Version: 400 Build: 07288 Host Type: 5 Host Level: 3 Feature: NLS=Y
Server Options: Case Matching = 1
Enter SQL member name (or "end" to quit) ... offline.sql
 
< ..... lots of deletion goes on now ..... >
INSERT INTO O4SRV.TNODESTS
 ( O4ONLINE, LSTUSRPRF, NODE, THRUNODE )
 VALUES(
 "D",
 "sysadmin",
 "MBOS.ITUBN255",
 "RKCPXM00:MBOS:CPIRA");
/*********************************************/
/********** Create Request Was Done **********/
/*********************************************/
 
INSERT INTO O4SRV.TNODESTS
 ( O4ONLINE, LSTUSRPRF, NODE, THRUNODE )
 VALUES(
 "D",
 "sysadmin",
 "MBOS.ITUBN253",
 "RKCPXM00:MBOS:CPIRA");
/*********************************************/
/********** Create Request Was Done **********/
/*********************************************/
< ..... lots of deletion have happened ..... >
Total Libraries Processed: 1
Total Members Processed: 1
Total SQLs Processed: 1989
Total Errors Encountered: 0
Enter SQL member name (or "end" to quit) ... end
,

Here is the code for checkoffline.pl

,
#!/bin/perl
# Set environment variables
$candlehome="/opt/IBM/ITM";
$hostname=`hostname`;
chop($hostname);
&write_statustxt;
&write_urlstxt;
chdir("/opt/IBM/ITM/aix513/ms/bin");
@lines=`./kshsoap status.txt urls.txt`;
chomp(@lines);
foreach (@lines) {
        push(@newlist,$_) if $_=~/^outfile");
foreach (@newlist) {
        s/<(w+)>//;
        s///;
        print OUT "
" if $_=~/^*/;
        print OUT "$_ ";
}
close(OUT);
open(IN, "outfile");
open(OUT, ">offline.sql");
while () {
        chomp;
        next if /^s*$/;        # Ignore blank lines
        next if /^*ONLINE/;    # Ignore *ONLINE entries
        next if /CMS/;          # Ignore offline CMS entries
        ($status, $systemname, $thrunode)=split(/ /);
        print OUT "INSERT INTO O4SRV.TNODESTS
";
        print OUT " ( O4ONLINE, LSTUSRPRF, NODE, THRUNODE )
";
        print OUT " VALUES(
";
        print OUT "   "D",
";
        print OUT "   "sysadmin",
";
        print OUT "   "$systemname",
";
        print OUT "   "$thrunode");
";
        print OUT "
";
}
close(OUT);
close(IN);
print "
	Please do the following:
";
print "		Change directory to $candlehome/tables/cicatrsq/SQLLIB
";
print "		Ensure offline.sql file exists
";
print "		Run $candlehome/aix513/ms/bin/kdstsns
";
exit(0);
sub write_statustxt {
        open(STATUS, ">/opt/IBM/ITM/aix513/ms/bin/urls.txt");
        print STATUS "sysadminManagedSystemManagedSystemNameStatusNameManaging_System";
        close(STATUS);
}
sub write_urlstxt {
        open(URL, ">/opt/IBM/ITM/aix513/ms/bin/urls.txt");
        print URL "http://$hostname:1920///cms/soap";
        close(URL);
}

Twitter Feed

OrbData RT @OrbData: If you missed our #IBMInterConnnect session "NOI: Achieving IT Operations Efficiency" please come to stand 167 & we'll send y…
OrbData If you missed our #IBMInterConnnect session "NOI: Achieving IT Operations Efficiency" please come to stand 167 & we'll send you the slides

Address

Address:
100 Longwater Avenue, Green Park, Reading, RG2 6GP, U.K.
Tel:
+44 (0) 118 945 0130
E-Mail:
This email address is being protected from spambots. You need JavaScript enabled to view it.

markerFind on Google Maps

About Us

Orb Data brings together People, Process and Technology to deliver the cornerstone of business success: the management of IT infrastructure. At our heart are our people. We have unrivalled experience, helping us to achieve an enviable reputation for excellence in project delivery. Because we’re independent, we identify actual issues and help organisations resolve them –from spec to deployment, and beyond –providing the right solution in terms of best of breed technology and support. We offer a refreshingly simple approach to the way we conduct business. We take pride in our abilities to provide first class solutions to business problems, and to conduct working relationships with honesty and integrity.

Follow Us On:

JoomShaper