JOY-DATALOGGER DEFINITIONS ::= BEGIN

IMPORTS
        OBJECT-TYPE, MODULE-IDENTITY, Unsigned32, Integer32, enterprises, IpAddress
                FROM SNMPv2-SMI
        TEXTUAL-CONVENTION, DisplayString, TruthValue
                FROM SNMPv2-TC;
--
-- Joy Datalogger, part of the KSES EOID.
--
kses MODULE-IDENTITY
    LAST-UPDATED "201506041256Z"
    ORGANIZATION "Keystone Electronic Solutions"
    CONTACT-INFO "physical:  469 Julius Jeppe
                             Waterkloof
                             0181
                 "
    DESCRIPTION  "Joy Datalogger."
    REVISION "201506041256Z"
    DESCRIPTION "
        Revised exact integer types (un/signed, size, etc). Use seconds since epoch instead
        of strange DateAndTime
    "
    REVISION "201506011117Z"
    DESCRIPTION "Added streaming RX and TX info tables with additional scalars for log information."
    REVISION "201504161056Z"
    DESCRIPTION "The base MIB for the joy datalogger."
    ::= { enterprises 30153 }

joydatalogger  OBJECT IDENTIFIER ::= {kses 4}

--
-- Our own type definitions.
--
-- The type to describe transmission/communication status.
TransferState ::= TEXTUAL-CONVENTION
    STATUS       current
    DESCRIPTION "
        Represents the state of transfer (either to or from, but this is not defined).
        The state can be unknown if the sub-agent has not had enough time to determine it or has
        not been communicated with.
    "
    SYNTAX INTEGER { unknown(0), on(1), off(2) }

YesNoState ::= TEXTUAL-CONVENTION
    STATUS       current
    DESCRIPTION "
        Represents a yes/no value."
    SYNTAX INTEGER { unknown(0), yes(1), no(2) }


--
-- End of type definitions.
--

--
-- Streaming table definitions. There is RX and TX tables.
--

-- RX table.

JoydataloggerRxStreamingInfoEntry::= SEQUENCE
{
    joydataloggerRxStreamingIndex INTEGER,
    joydataloggerRxStreamingIP IpAddress,
    joydataloggerRxStreamingPort INTEGER,
    joydataloggerRxStreamingState TransferState,
    joydataloggerRxStreamingLastTimestamp Unsigned32
}

joydataloggerRxStreamingTable OBJECT-TYPE
    SYNTAX SEQUENCE OF JoydataloggerRxStreamingInfoEntry
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION "
        List of RX streaming information entries.
    "
    ::= {joydatalogger 13}

joydataloggerRxStreamingInfoEntry OBJECT-TYPE
    SYNTAX JoydataloggerRxStreamingInfoEntry
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION "
      Rx streaming info interface.
    "
    INDEX {
        joydataloggerRxStreamingIndex
    }
    ::={joydataloggerRxStreamingTable 1}

joydataloggerRxStreamingIndex OBJECT-TYPE
    SYNTAX INTEGER (0..65535)
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        Index number for streaming info.
    "
    ::={joydataloggerRxStreamingInfoEntry 1}

joydataloggerRxStreamingIP OBJECT-TYPE
    SYNTAX IpAddress
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        IP of streaming transmission.
    "
    ::={joydataloggerRxStreamingInfoEntry 2}

joydataloggerRxStreamingPort OBJECT-TYPE
    SYNTAX INTEGER (0..65535)
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
      Port number of streaming transmission.
    "
    ::={joydataloggerRxStreamingInfoEntry 3}

joydataloggerRxStreamingState OBJECT-TYPE
    SYNTAX TransferState
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        State of streaming transmission.
    "
    ::={joydataloggerRxStreamingInfoEntry 4}

joydataloggerRxStreamingLastTimestamp OBJECT-TYPE
    SYNTAX Unsigned32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        Last date/time of streaming transmission. Seconds since epoch.
    "
    ::={joydataloggerRxStreamingInfoEntry 5}

-- TX table.

JoydataloggerTxStreamingInfoEntry::= SEQUENCE
{
    joydataloggerTxStreamingIndex INTEGER,
    joydataloggerTxStreamingIP IpAddress,
    joydataloggerTxStreamingPort INTEGER,
    joydataloggerTxStreamingState TransferState,
    joydataloggerTxStreamingLastTimestamp Unsigned32
}

joydataloggerTxStreamingTable OBJECT-TYPE
    SYNTAX SEQUENCE OF JoydataloggerTxStreamingInfoEntry
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION "
        List of TX streaming information entries.
    "
    ::= {joydatalogger 14}

joydataloggerTxStreamingInfoEntry OBJECT-TYPE
    SYNTAX JoydataloggerTxStreamingInfoEntry
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION "
      Rx streaming info interface.
    "
    INDEX {
        joydataloggerTxStreamingIndex
    }
    ::={joydataloggerTxStreamingTable 1}

joydataloggerTxStreamingIndex OBJECT-TYPE
    SYNTAX INTEGER (0..65535)
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        Index number for streaming info.
    "
    ::={joydataloggerTxStreamingInfoEntry 1}

joydataloggerTxStreamingIP OBJECT-TYPE
    SYNTAX IpAddress
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        IP of streaming transmission.
    "
    ::={joydataloggerTxStreamingInfoEntry 2}

joydataloggerTxStreamingPort OBJECT-TYPE
    SYNTAX INTEGER (0..65535)
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
      Port number of streaming transmission.
    "
    ::={joydataloggerTxStreamingInfoEntry 3}

joydataloggerTxStreamingState OBJECT-TYPE
    SYNTAX TransferState
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        State of streaming transmission.
    "
    ::={joydataloggerTxStreamingInfoEntry 4}

joydataloggerTxStreamingLastTimestamp OBJECT-TYPE
    SYNTAX Unsigned32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        Last date/time of streaming transmission. Seconds since epoch.
    "
    ::={joydataloggerTxStreamingInfoEntry 5}

--
-- End of streaming table definitions.
--

--
-- Scalar entries.
--
joyDataloggerSerial OBJECT-TYPE
    SYNTAX DisplayString
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        Serial number of the datalogger.
    "
    ::={joydatalogger 1}

joyDataloggerModel OBJECT-TYPE
    SYNTAX DisplayString
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        Model of the datalogger.
    "
    ::={joydatalogger 2}

joyDataloggerType OBJECT-TYPE
    SYNTAX  DisplayString
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        The type of datalogger.
    "
    ::={joydatalogger 3}

joyDataloggerFtpTransmissionStatus OBJECT-TYPE
    SYNTAX YesNoState 
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        Whether or not the datalogger is transmitting log files to the FTP server.
        yes(1), no(2).
    "
    ::={joydatalogger 4}

joyDataloggerInternalLogFileCount OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        The number of internal log files (.log extension) in /mnt/dataflash/logs.
    "
    ::={joydatalogger 5}

joyDataloggerInternalLogArchiveCount OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        The number of internal log archives (.jlg extension) in /mnt/dataflash/logs.
    "
    ::={joydatalogger 6}

joyDataloggerUSBLogFileCount OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        The number of log files (.log extension) in /mnt/dataflash/flasher/logs,
        i.e. the USB.
    "
    ::={joydatalogger 7}

joyDataloggerUSBLogArchiveCount OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        The number of log archives (.jlg extension) in /mnt/dataflash/flasher/logs,
        i.e. the USB.
    "
    ::={joydatalogger 8}

joyDataloggerFtpTransferredCount OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        The number of log archives (.jlg extension) transferred up from the datalogger since
        powerup.
    "
    ::={joydatalogger 9}

joyDataloggerIsValidTime OBJECT-TYPE
    SYNTAX TruthValue
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        If the time on the datalogger is valid (we test if the current year is greater or equal
        to 2015). 1 == yes, 2 == no.
    "
    ::={joydatalogger 10}

joyDataloggerIsStreaming OBJECT-TYPE
    SYNTAX TransferState
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "
        If we are currently streaming from or to somewhere. The state can initially be unknown if
        the streamlogger has not communicated with the subagent yet.
        unknown(0), on(1), off(2).
    "
    ::={joydatalogger 11}

END
