How extend the SNMP agent in Solaris to get ZFS attributes Part 2

The need of extending SNMP agent in Solaris to get ZFS attributes has became an ongoing project for me, because I’ve been requested to add more parameters to monitor, in this case the requirements were ARC Most Recently Used size (p) and Target Size (c), in order to calculate the ARC Most Frequent Usage Size.

The ARC Most Frequently Used Size (MFU) can be obtained by subtracting MRU (p) minus Target Size (c). These values can be gotten by issuing the following command:


$ kstat zfs:0:arcstats:c

module: zfs instance: 0
name: arcstats class: misc
c 17179869184

$ kstat zfs:0:arcstats:p

module: zfs instance: 0
name: arcstats class: misc
p 15231792640


So, what I’ve done is forked our colleague’s solaris-extra-snmp original project and added these two indicators to the zfs-snmp script and also extended NYMNETWORKS MIB definitions. To see what have changed, please refer to this commit.

A demonstration of what I’m currently getting is shown below:


$ snmpwalk -v 2c -m ALL -c localhost qadata2

NYMNETWORKS-MIB::zfsFilesystemName.1 = STRING: “zpool1″
NYMNETWORKS-MIB::zfsFilesystemAvailableKB.1 = Gauge32: 278383836
NYMNETWORKS-MIB::zfsFilesystemUsedKB.1 = Gauge32: 313062179
NYMNETWORKS-MIB::zfsPoolHealth.1 = INTEGER: online(1)
NYMNETWORKS-MIB::zfsFilesystemAvailableMB.1 = Gauge32: 271859
NYMNETWORKS-MIB::zfsFilesystemUsedMB.1 = Gauge32: 305724
NYMNETWORKS-MIB::zfsARCSizeKB.0 = Gauge32: 16777207
NYMNETWORKS-MIB::zfsARCMetadataSizeKB.0 = Gauge32: 0
NYMNETWORKS-MIB::zfsARCDataSizeKB.0 = Gauge32: 15933167
NYMNETWORKS-MIB::zfsARCHits.0 = Counter32: 777948518
NYMNETWORKS-MIB::zfsARCMisses.0 = Counter32: 3739319790
NYMNETWORKS-MIB::zfsARCTargetSize.0 = Counter32: 16777216
NYMNETWORKS-MIB::zfsARCMru.0 = Counter32: 14275045
NYMNETWORKS-MIB::zfsL2ARCHits.0 = Counter32: 0
NYMNETWORKS-MIB::zfsL2ARCMisses.0 = Counter32: 0
NYMNETWORKS-MIB::zfsL2ARCReads.0 = Counter32: 0
NYMNETWORKS-MIB::zfsL2ARCWrites.0 = Counter32: 0
NYMNETWORKS-MIB::zfsReadKB.0 = Counter32: 333216374
NYMNETWORKS-MIB::zfsReaddirKB.0 = Counter32: 9875
NYMNETWORKS-MIB::zfsWriteKB.0 = Counter32: 2798705367


The task for next week will be version 2 of the cacti template.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">