views:

494

answers:

1

Hi,

I am looking to find the SunOS system details using Kstat. I have found Solaris::Kstat module in CPAN but this only supports Solaris 2.5.1, 2.6 & 2.7. The Sun developer's site mentions a Sun::Solaris::Kstat which I have not found in CPAN. Can anyone please help me with the Perl scripting to find details from kstat on Solaris 5.10.

A: 

According to Brendan Gregg who actually develops Perl tools to work with Solaris systems:

The KStat perl library is shipped with Solaris.

However, in one of his modules he includes the following note:

# - If you have upgraded /usr/bin/perl, this program may be unable to 
#   find the Sun::Solaris::Kstat library (which is under /usr/perl5).
#   Before the "use strict;" line, you may need to add,
#   use lib "/usr/perl5/5.6.1/lib";
#   to point to your location of Sun/Solaris/Kstat.pm.

If that doesn't work, you may want to run a find command for Kstat.pm, to be certain of whether or not this file exists anywhere on your system.

Adam Bellaire
Thanks Adam, I have found this at the same path you gave but when using this this path in my script i get the same error "Can't locate loadable object for module Sun::Solaris::Kstat". Please suggest.
Space
@Virus: That module has to do with loading the C libraries necessary for Kstat. The error message itself should tell you the name of the particular file (usually ending in `.so` or `.o`). You need to find that find on your system, and then add its path to the `LD_LIBRARY_PATH` enviroment variable, or modify `/etc/ld.so.conf` and run `ldconfig` with root priviledge to modify the system-wide library configuration.
Adam Bellaire