-- **********************************************************
-- XCP-NG-VMINFO-MIB
--
-- Custom MIB for XCP-ng VM information, modeled after
-- VMWARE-VMINFO-MIB vmwVmTable.
--
-- Enterprise Number: 60652
-- OID Base: .1.3.6.1.4.1.60652
--
-- **********************************************************

XCP-NG-VMINFO-MIB DEFINITIONS ::= BEGIN

IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE, Integer32,
    enterprises
        FROM SNMPv2-SMI
    DisplayString
        FROM SNMPv2-TC;

xcpNgVmInfo MODULE-IDENTITY
    LAST-UPDATED "202602260000Z"
    ORGANIZATION "LibreNMS"
    CONTACT-INFO
        "Custom MIB for XCP-ng hypervisor VM information."
    DESCRIPTION
        "This MIB module provides information about virtual machines
         running on an XCP-ng hypervisor host. It is modeled after
         the VMWARE-VMINFO-MIB vmwVmTable."
    REVISION "202602260000Z"
    DESCRIPTION
        "Initial version."
    ::= { LibreNMS 100 }

-- **********************************************************
-- Top-level enterprise OID
-- **********************************************************

LibreNMS OBJECT IDENTIFIER ::= { enterprises 60652 }

xcpNgVmInfo OBJECT IDENTIFIER ::= { LibreNMS 100 }

-- **********************************************************
-- VM Table
-- **********************************************************

xcpNgVmTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF XcpNgVmEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A table containing information about each virtual machine
         on this XCP-ng host."
    ::= { xcpNgVmInfo 1 }

xcpNgVmEntry OBJECT-TYPE
    SYNTAX      XcpNgVmEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An entry in the VM table representing a single virtual machine."
    INDEX { xcpNgVmIdx }
    ::= { xcpNgVmTable 1 }

XcpNgVmEntry ::= SEQUENCE {
    xcpNgVmIdx          Integer32,
    xcpNgVmDisplayName  DisplayString,
    xcpNgVmConfigFile   DisplayString,
    xcpNgVmGuestOS      DisplayString,
    xcpNgVmMemSize      Integer32,
    xcpNgVmState        INTEGER,
    xcpNgVmVMID         DisplayString,
    xcpNgVmGuestState   DisplayString,
    xcpNgVmIpAddress    DisplayString,
    xcpNgVmCpus         Integer32,
    xcpNgVmUUID         DisplayString
}

xcpNgVmIdx OBJECT-TYPE
    SYNTAX      Integer32 (0..65535)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An integer index uniquely identifying a virtual machine
         on this host. This is used as the table index."
    ::= { xcpNgVmEntry 1 }

xcpNgVmDisplayName OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The display name (label) of the virtual machine as shown
         in XCP-ng / Xen Orchestra."
    ::= { xcpNgVmEntry 2 }

xcpNgVmConfigFile OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The path or identifier of the VM configuration file."
    ::= { xcpNgVmEntry 3 }

xcpNgVmGuestOS OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The guest operating system identifier string for
         this virtual machine."
    ::= { xcpNgVmEntry 4 }

xcpNgVmMemSize OBJECT-TYPE
    SYNTAX      Integer32
    UNITS       "megabytes"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The amount of memory (in megabytes) allocated to this
         virtual machine."
    ::= { xcpNgVmEntry 5 }

xcpNgVmState OBJECT-TYPE
    SYNTAX      INTEGER {
                    running(1),
                    halted(2),
                    paused(3),
                    suspended(4),
                    crashed(5)
                }
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The current power state of the virtual machine.
         running(1)   - VM is powered on and running,
         halted(2)    - VM is shut down,
         paused(3)    - VM is paused,
         suspended(4) - VM is suspended to disk,
         crashed(5)   - VM has crashed or is dying."
    ::= { xcpNgVmEntry 6 }

xcpNgVmVMID OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "A numeric identifier for the virtual machine, such as
         the Xen domain ID."
    ::= { xcpNgVmEntry 7 }

xcpNgVmGuestState OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The state of the guest tools or agent running inside
         the virtual machine. Typical values: running, not installed."
    ::= { xcpNgVmEntry 8 }

xcpNgVmIpAddress OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The primary IP address of the virtual machine as reported
         by the guest tools or agent."
    ::= { xcpNgVmEntry 9 }

xcpNgVmCpus OBJECT-TYPE
    SYNTAX      Integer32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of virtual CPUs allocated to this virtual machine."
    ::= { xcpNgVmEntry 10 }

xcpNgVmUUID OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..36))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The universally unique identifier (UUID) of this
         virtual machine."
    ::= { xcpNgVmEntry 11 }

END
