• Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

Comments (7)

1 Chris-R commented Permalink

Chris - I wonder if IBM would support www-912.ibm.com/pod/pod as a web service? <br /> It would not be too hard too write a script to take the i/pSeries serial as input, go out to the net and fetch the codes then tally them up [based on above] to check against what's been applied and the CoD history log in the HMC.

2 cggibbo commented Permalink

Hi Chris-R, I'd imagine it would be difficult to write such a script. Even if IBM did not support it, it may still be worth exploring. <div>&nbsp;</div> Cheers. <div>&nbsp;</div> ChrisG

3 Chris-R commented Permalink

Done!

 
$ ./activations.pl 9117 10 06ebp
02 processors activated on 05/23/2011
024 GB memory activated on 05/23/2011
02 processors activated on 03/11/2011
016 GB memory activated on 03/11/2011
055 GB memory activated on 03/02/2011
06 processors activated on 02/22/2011
096 GB memory activated on 02/22/2011
01 processors activated on 01/12/2011
016 GB memory activated on 01/12/2011
06 processors activated on 03/17/2010
072 GB memory activated on 03/17/2010
19 processors activated on 03/16/2010
228 GB memory activated on 03/16/2010
================
TOTAL CPU=36 RAM=519168MB (507GB)
 
$cat activations.pl
#!/usr/bin/perl
#
# PoC Script to go out on the net to the IBM POD site and tally up activations for a given i or p Series machine
# Chris-R rutherfc@gmail.com
# v1.0 9/9/2011
#
# todo - add logic for processor deactivation - who uses that? IBM dont even publish the code on the pod site ;)
#
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("mozilla 8.0");
# $ua->proxy(['http'], 'http://proxy:8080/');
$ua->timeout(10);
use HTTP::Request::Common qw(POST);
if ($#ARGV != 2) {
print "usage: $0 MODEL XX XXXXX e.g $0 9119 83 9f6bf\n";
exit;
}
($model, $serial1, $serial2) = @ARGV;
 
##### main #####
get('http://www-912.ibm.com/pod/pod',"$serial2.htm");
html2txt("$serial2.htm","$serial2.txt");
total("$serial2.txt");
exit;
 
sub get # fakes a mozilla browser, fills in the CGI form and snags the returned page to a local html file
{
my $req = (POST $_[0],
["system_type" => $model,
"system_serial_number1" => $serial1,
"system_serial_number2" => $serial2 ]);
$request = $ua->request($req);
$activations = $request->content;
open(POD,">$_[1]");
print POD $activations;
close(POD);
}
 
sub html2txt # strips out the crap and converts the table to a local txt file to parse
{
open(HTML,"<$_[0]");
open(TXT,">$_[1]");
while () {
if (/<\/table>/) {$f = 0;};
if (//:/g;
s/<[^>][^>]*>//g;
s/ //g;
s/\n//g;
s/:/\n/g;
print TXT $_;
};
};
close(TXT);
close(HTML);
}
sub total # totals up the de/activations to get totals
{
open(TXT,"<$_[0]");
$[ = 1; $\ = "\n";# set array base & output record separator
while (<TXT>) {
($code,$hex,$date) = split(' ', $_, -1);
if (/POD/) {
$p = substr($hex, 27, 2);
print $p . ' processors activated on ' . $date;
$pt = $pt + $p;
};
if (/MOD/) {
$r = substr($hex, 26, 3);
print $r . ' GB memory activated on ' . $date;
$rt = $rt + $r;
};
if (/RMEM/) {
$r = substr($hex, 27, 2);
print $r . ' GB memory activated on ' . $date;
$rt = $rt - $r;
};
};
print '================';
print 'TOTAL CPU=' . $pt . ' RAM=' . $rt*1024 . 'MB (' . $rt . 'GB)';
close(TXT);
}
</TXT>
Posted Date \(MM/) {$f = 1;};
if ($f == 1) {
# poor mans HTML::TableExtract - excuse my sed like perl....
s/

4 jkerschner commented Permalink

Hello Chris, <div>&nbsp;</div> Thanks for posting this! I do have a question. If you have 2 POD/MOD codes do you add the codes together to get the total activated Proc/Mem? <div>&nbsp;</div> I assume this equal 64 procs and 512GB Mem. <br /> POD 3806E589F2067F0C54680000003200419B <br /> POD B7CDE589F2067F0C54680000003200419B <br /> MOD 4CC1X7097C231A85821200000512004102 <br /> MOD 9A26P7097C231A85821200000512004102 <div>&nbsp;</div> <div>&nbsp;</div>

5 cggibbo commented Permalink

Hi Jon, that's right. Looking at your codes (and assuming they are all for the same managed system) then 64 processors and 1GB of memory will be activated in total for the system.

6 jesper_ljungberg commented Permalink

Hi Chris. <div>&nbsp;</div> I couldn't get the script above to work (RHEL linux) with perl-5.10.1-127.el6.x86_64 <div>&nbsp;</div> But appending these lines <br /> s/\&nbsp;//g; <br /> s/;/ /g; <div>&nbsp;</div> just before print TXT $_; in the html2txt function, fixed it. <div>&nbsp;</div> // Jesper <br />

7 pierrotquarkou commented Permalink

Good morning <div>&nbsp;</div> If i go on the http://www-912.ibm.com/pod/pod site i don't ound any code for that <br /> server. Moreover the advanced Entreprise edition has the string 2C20 not 2C28 <br /> Are you sure yours inormations are still OK <br /> best regards <br /> VET <br /> F2FB60ERC4FF3DB50CA1F00002C20004177 <br /> 04/30/2010 <br /> VET <br /> F2FB60ERC4FF3DB50CA1F00002C28004177 <br /> 04/30/2010

Add a Comment Add a Comment