Subject: [ANNOUNCE] Perl modules Solaris::MapDev and Solaris::Kstat]
From: Alan Burlison <[email-masked]>
Date: 16 Oct 1998 16:24:01 GMT
Newsgroups: comp.lang.perl.announce,comp.lang.perl.modules

What are they?
--------------
Solaris::Mapdev is a perl module that converts between instance names
and device names, e.g. sd0 to c0t0d0 and vice-versa.

Solaris::Kstat provides easy access to the Solaris Kstats interface,
representing the statistics as a set of nested hashes.

The following simple example shows how Solaris::Mapdev and
Solaris::Kstat might be used:

#!/usr/local/bin/perl -w
use strict;
use Solaris::MapDev qw(inst_to_dev);
use Solaris::Kstat;
my $ks = Solaris::Kstat->new();
my $ctd = inst_to_dev("sd0");
my $then = $ks->{sd}{0}{sd0}{crtime};
my $r_then = 0;
my $w_then = 0;
while(1)
   {
   my $now = $ks->{sd}{0}{sd0}{snaptime};
   my $r_now = $ks->{sd}{0}{sd0}{reads};
   my $w_now = $ks->{sd}{0}{sd0}{writes};
   my $howlong = $now - $then;
   printf("%s %.1f reads/sec %.1f writes/sec\n",
          $ctd, ($r_now - $r_then) / $howlong,
          ($w_now - $w_then) / $howlong);
   $r_then = $r_now;
   $w_then = $w_now;
   $then = $now;
   sleep(5);
   $ks->update();
   }

Also included are the following example scripts:

dump_kstat
Dump the entire kstats structure to stdout.

mapdev
This will display the full list of mappings, and can be used as a filter
to commands such as sar.

iost+
An enhanced version of iostat, modelled closely on the SE toolkit script
'siostat.se'

What do I need to use them?
---------------------------
* Solaris 2.5.1 or above
* Perl 5.004_04 or above
* A C compiler

Where can I find them?
----------------------

$CPAN/authors/Alan_Burlison/Solaris-0_01_tar.gz

Alan Burlison