I am working so some stuffs where I need to get some information using kstat -p
. So I am thinking to create a hash variable with all output of kstat -p
.
Sample output from kstat -p
cpu_stat:0:cpu_stat0:user 18804249
To access values
@{$kstat->{cpu_stat}{0}{cpu_stat0}}{qw(user)};
I have also looked at CPAN for any available module and found Sun::Solaris::Kstat
but that is not available with my Sun version. Please suggest code to create a hash variable with output values in kstat -p
.