FREENAS-MIB DEFINITIONS ::= BEGIN

-- Currently defines structures for monitoring the zfs-stats in freenas (more to come)
-- via snmp. Taken from https://github.com/jm66/solaris-extra-snmp. License below:
-- Copyright (c) 2012, Jakob Borg
-- All rights reserved.
-- 
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--    * Redistributions of source code must retain the above copyright
--      notice, this list of conditions and the following disclaimer.
--    * Redistributions in binary form must reproduce the above copyright
--      notice, this list of conditions and the following disclaimer in the
--      documentation and/or other materials provided with the distribution.
--    * The name of the author may not be used to endorse or promote products
--      derived from this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY JAKOB BORG ''AS IS'' AND ANY EXPRESS OR IMPLIED
-- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-- EVENT SHALL JAKOB BORG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-- OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-- IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-- OF SUCH DAMAGE.

IMPORTS
	enterprises FROM RFC1155-SMI
	OBJECT-TYPE FROM RFC-1212
	DisplayString FROM RFC-1213;

freenas	OBJECT IDENTIFIER ::= {enterprises 25359}

zfs     OBJECT IDENTIFIER ::= {freenas 1}

fs      OBJECT IDENTIFIER ::= {zfs 1}

arc     OBJECT IDENTIFIER ::= {zfs 2}

l2arc   OBJECT IDENTIFIER ::= {zfs 3}

vols    OBJECT IDENTIFIER ::= {zfs 5}

zil     OBJECT IDENTIFIER ::= {zfs 6}

zfsFilesystemName OBJECT-TYPE
    SYNTAX  DisplayString
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
        "The name of the filesystem."
    ::= {fs 1}

zfsFilesystemAvailableKB OBJECT-TYPE
    SYNTAX  GAUGE
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
             "The number of 1 KB blocks that are available for use."
    ::= {fs 2}

zfsFilesystemUsedKB OBJECT-TYPE
    SYNTAX  GAUGE
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
             "The number of 1 KB blocks that are in use."
    ::= {fs 3}

zfsPoolHealth OBJECT-TYPE
    SYNTAX  INTEGER { online(1), degraded(2), faulted(3), unknown(4) }
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
             "The current health of the containing pool, as reported
         by zpool status."
    ::= {fs 4}

zfsFilesystemSizeKB OBJECT-TYPE
        SYNTAX  INTEGER32 { online(1), degraded(2), faulted(3), unknown(4) }
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
             "The number of 1 MB blocks that are assigned"
    ::= {fs 5}

zfsFilesystemAvailableMB OBJECT-TYPE
    SYNTAX  GAUGE
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
             "The number of 1 MB blocks that are available for use.
         Useful if zfsFilesystemAvailableKB exceeds a 32 bit
         integer."
    ::= {fs 12}

zfsFilesystemUsedMB OBJECT-TYPE
    SYNTAX  GAUGE
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
             "The number of 1 MB blocks that are in use Useful if
         zfsFilesystemUsedKB exceeds a 32 bit integer."
    ::= {fs 13}

zfsFilesystemSizeMB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                 "The number of 1 MB blocks that are assigned  Useful if
                 zfsFilesystemSizeKB exceeds a 32 bit integer."
        ::= {fs 14}

zfsFilesystemOpRead OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The number of read I/O operations sent to the pool or device,
                including metadata requests (averaged since system booted)."
        ::= {fs 15}

zfsFilesystemOpWrite OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The number of write I/O operations sent to the pool or device 
                (averaged since system booted)."
        ::= {fs 16}

zfsFilesystemBwRead OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The bandwidth of all read operations (including metadata),
                expressed as units per second (averaged since system booted)"
        ::= {fs 17}

zfsFilesystemBwWrite OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The bandwidth of all write operations, expressed as units per 
                second (averaged since system booted)."
        ::= {fs 18}

zfsFilesystemOpRead1sec OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The number of read I/O operations sent to the pool or device,
                including metadata requests (over 1 second interval)."
        ::= {fs 19}

zfsFilesystemOpWrite1sec OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The number of write I/O operations sent to the pool or device 
                (over 1 second interval)."
        ::= {fs 20}

zfsFilesystemBwRead1sec OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The bandwidth of all read operations (including metadata),
                expressed as units per second (over 1 second interval)"
        ::= {fs 21}

zfsFilesystemBwWrite1sec OBJECT-TYPE
        SYNTAX COUNTER64
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The bandwidth of all write operations, expressed as units per 
                second (over 1 second interval)."
        ::= {fs 22}

zfsArcSize OBJECT-TYPE
        SYNTAX GAUGE
        ACCESS read-only
        STATUS mandatory
        ::= {arc 1}

zfsArcMeta OBJECT-TYPE
        SYNTAX GAUGE
        ACCESS read-only
        STATUS mandatory
        ::= {arc 2}

zfsArcData OBJECT-TYPE
        SYNTAX GAUGE
        ACCESS read-only
        STATUS mandatory
        ::= {arc 3}

zfsArcHits OBJECT-TYPE
        SYNTAX Counter32
        ACCESS read-only
        STATUS mandatory
        ::= {arc 4}

zfsArcMisses OBJECT-TYPE
        SYNTAX Counter32
        ACCESS read-only
        STATUS mandatory
        ::= {arc 5}

zfsArcC OBJECT-TYPE
        SYNTAX GAUGE
        ACCESS read-only
        STATUS mandatory
        ::= {arc 6}

zfsArcP OBJECT-TYPE
        SYNTAX GAUGE
        ACCESS read-only
        STATUS mandatory
        ::= {arc 7}

zfsArcMissPercent OBJECT-TYPE
        SYNTAX DisplayString
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "Arc Miss Percentage.
                (Note: Floating precision sent across SNMP as a String"
        ::= {arc 8}

zfsArcCacheHitRatio OBJECT-TYPE
        SYNTAX DisplayString
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "Arc Cache Hit Ration Percentage.
                (Note: Floating precision sent across SNMP as a String"
        ::= {arc 9}

zfsArcCacheMissRatio OBJECT-TYPE
        SYNTAX DisplayString
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "Arc Cache Miss Ration Percentage.
                (Note: Floating precision sent across SNMP as a String"
        ::= {arc 10} 

zfsL2ArcHits OBJECT-TYPE
        SYNTAX Counter32
        ACCESS read-only
        STATUS mandatory
        ::= {l2arc  1}

zfsL2ArcMisses OBJECT-TYPE
        SYNTAX Counter32
        ACCESS read-only
        STATUS mandatory
        ::= {l2arc  2}

zfsL2ArcRead OBJECT-TYPE
        SYNTAX Counter32
        ACCESS read-only
        STATUS mandatory
        ::= {l2arc  3}

zfsL2ArcWrite OBJECT-TYPE
        SYNTAX Counter32
        ACCESS read-only
        STATUS mandatory
        ::= {l2arc  4}

zfsL2ArcSize OBJECT-TYPE
        SYNTAX GAUGE
        ACCESS read-only
        STATUS mandatory
        ::= {l2arc  5}

zfsVolumeName OBJECT-TYPE
        SYNTAX  DisplayString
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                "The name of the filesystem type Volume."
        ::= {vols 1}

zfsVolumeAvailableKB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                 "The number of 1 KB blocks that are available for use."
        ::= {vols 2}

zfsVolumeUsedKB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                 "The number of 1 KB blocks that are in use."
        ::= {vols 3}

zfsVolumeSizeKB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                 "The number of 1 KB blocks of the volume."
        ::= {vols 4}

zfsVolumeAvailableMB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                 "The number of 1 MB blocks that are available for use.
                 Useful if zfsVolumeAvailableKB exceeds a 32 bit
                 integer."
        ::= {vols 12}

zfsVolumeUsedMB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                 "The number of 1 MB blocks that are in use Useful if
                 zfsVolumeUsedKB exceeds a 32 bit integer."
        ::= {vols 13}

zfsVolumeSizeMB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                 "The number of 1 MB blocks part of the volume Useful if
                 zfsVolumeSizeKB exceeds a 32 bit integer."
        ::= {vols 14}

zfsZilstatOps1sec OBJECT-TYPE
        SYNTAX  COUNTER64
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                "The ops column parsed from the command zilstat 1 1"
        ::= {zil 1}

zfsZilstatOps5sec OBJECT-TYPE
        SYNTAX  COUNTER64
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                "The ops column parsed from the command zilstat 5 1"
        ::= {zil 2}

zfsZilstatOps10sec OBJECT-TYPE
        SYNTAX  COUNTER64
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
                "The ops column parsed from the command zilstat 10 1"
        ::= {zil 3}
END
