The JKstat API allows programmatic access to Solaris kstats from java code.

To start, instantiate a JKstat. If working locally, this would be a NativeJKstat.

JKstat jkstat = new NativeJKstat();

Once you have a JKstat, you can either read a single Kstat or enumerate the Kstats. To read a whole kstat, you need to know the module, instance, and name. Given a kstat, you can then read all its statistics, or an individual statistic.

Kstat ks = jkstat.getKstat("unix", 0, "system_misc");
Set <String> stats = ks.statistics();
Object data = ks.getData("statistic");
long l1 = ls.longData("avenrun_1min");

The Set of statistics is sorted, being backed by a TreeSet. The data object will be either a String, or a Long for all the numeric values.

@since 0.25