Path: usenet.cise.ufl.edu!newsfeeds.nerdc.ufl.edu!news.magicnet.net!news.maxwell.syr.edu!news-nyc.telia.net!newsfeed.cwix.com!192.220.250.21!netnews1.nw.verio.net!netnews.nwnet.net!uunet!in4.uu.net!news.neta.com!not-for-mail
From: Alan Burlison <[email protected]>
Newsgroups: comp.lang.perl.announce,comp.lang.perl.modules
Subject: [ANNOUNCE] Perl modules Solaris::MapDev and Solaris::Kstat]
Followup-To: comp.lang.perl.modules
Date: 16 Oct 1998 16:24:01 GMT
Organization: Sun Microsystems
Lines: 62
Approved: [email protected] (comp.lang.perl.announce)
Message-ID: <[email protected]>
NNTP-Posting-Host: gadget.cscaper.com
X-Trace: news.neta.com 908555041 19740 206.67.186.3 (16 Oct 1998 16:24:01 GMT)
X-Complaints-To: [email protected]
NNTP-Posting-Date: 16 Oct 1998 16:24:01 GMT
X-Disclaimer: The "Approved" header verifies header information for article transmission and does not imply approval of content.
Xref: usenet.cise.ufl.edu comp.lang.perl.announce:160 comp.lang.perl.modules:4971

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