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}

zpool   OBJECT IDENTIFIER ::= {zfs 1}

arc     OBJECT IDENTIFIER ::= {zfs 2}

l2arc   OBJECT IDENTIFIER ::= {zfs 3}

vols    OBJECT IDENTIFIER ::= {zfs 5}

zil     OBJECT IDENTIFIER ::= {zfs 6}

ds      OBJECT IDENTIFIER ::= {zfs 7}

rep	OBJECT IDENTIFIER ::= {zfs 8}

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

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

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

zfsPoolHealth OBJECT-TYPE
    SYNTAX  DisplayString
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
        "The current health of the containing pool, as reported
        by zpool status."
    ::= {zpool 4}

zfsPoolSizeKB OBJECT-TYPE
        SYNTAX  INTEGER32
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "The zfs 'size' property of this zfs pool in KB"
    ::= {zpool 5}

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

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

zfsPoolSizeMB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "The zfs 'size' property of this zfs pool in MB. Useful if
            zfsPoolSizeKB exceeds a 32 bit integer."
        ::= {zpool 14}

zfsPoolOpRead 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)."
        ::= {zpool 15}

zfsPoolOpWrite 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)."
        ::= {zpool 16}

zfsPoolBwRead 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)"
        ::= {zpool 17}

zfsPoolBwWrite 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)."
        ::= {zpool 18}

zfsPoolOpRead1sec 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)."
        ::= {zpool 19}

zfsPoolOpWrite1sec 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)."
        ::= {zpool 20}

zfsPoolBwRead1sec 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)"
        ::= {zpool 21}

zfsPoolBwWrite1sec 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)."
        ::= {zpool 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 zfs 'volsize' property of this zvol in KB."
        ::= {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 zfs 'volsize' property of this zvol in KB. 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}

zfsDatasetName OBJECT-TYPE
        SYNTAX  DisplayString
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "The name of the dataset."
        ::= {ds 1}

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

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

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

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

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

zfsDatasetSizeMB OBJECT-TYPE
        SYNTAX  GAUGE
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "The number of 1 MB blocks of the dataset. Useful if
            zfsDatasetSizeKB exceeds a 32 bit integer."
        ::= {ds 14}

zfsReplicationDatasetName OBJECT-TYPE
        SYNTAX  STRING
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "The name of the dataset being replicated"
        ::= {rep 1}

zfsReplicationDestination OBJECT-TYPE
        SYNTAX  STRING
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "Replication target ip address and dataset name"
        ::= {rep 2}

zfsReplicationEnabled OBJECT-TYPE
        SYNTAX  STRING
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "Replication task enabled status"
        ::= {rep 3}

zfsReplicationStatus OBJECT-TYPE
        SYNTAX  STRING
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "Dataset replication status"
        ::= {rep 4}

zfsReplicationLastSent OBJECT-TYPE
        SYNTAX  STRING
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "Last dataset sent"
        ::= {rep 5}

END
