from oids.oid_node import OidNode ipAddrTable = OidNode('1.3.6.1.2.1.4.20', 'ipAddrTable') ipAddrTable.addChildren([ OidNode('1', 'ipAddrEntry') ]) ipAddrTable['ipAddrEntry'].addChildren([ # IP-MIB::ipAdEntAddr # # The IPv4 address to which this entry's addressing # information pertains. OidNode('1', 'ipAdEntAddr'), # IP-MIB::ipAdEntIfIndex # # The index value which uniquely identifies the interface to # which this entry is applicable. The interface identified by # a particular value of this index is the same interface as # identified by the same value of the IF-MIB's ifIndex. OidNode('2', 'ipAdEntIfIndex'), # IP-MIB::ipAdEntNetMask # # The subnet mask associated with the IPv4 address of this # entry. The value of the mask is an IPv4 address with all # the network bits set to 1 and all the hosts bits set to 0. OidNode('3', 'ipAdEntNetMask'), # IP-MIB::ipAdEntBcastAddr #
from oids.oid_node import OidNode # IF-MIB::ifNumber # # The number of network interfaces (regardless of their # current state) present on this system. ifNumber = OidNode('1.3.6.1.2.1.2.1', 'ifNumber') # ---------------------------------------------------------- ifTable = OidNode('1.3.6.1.2.1.2.2', 'ifTable') ifTable.addChildren([ OidNode('1', 'ifEntry') ]) ifTable['ifEntry'].addChildren([ # IF-MIB::ifIndex # # A unique value, greater than zero, for each interface. It # is recommended that values are assigned contiguously # starting from 1. The value for each interface sub-layer # must remain constant at least from one re-initialization of # the entity's network management system to the next re- # initialization. OidNode('1', 'ifIndex'), # IF-MIB::ifDescr # # A textual string containing information about the # interface. This string should include the name of the # manufacturer, the product name and the version of the
# floppies without file systems on them are typically # not allocated in chunks by the operating system to # requesting applications, and therefore shouldn't # appear in this table. Examples of valid storage for # this table include disk partitions, file systems, ram # (for some architectures this is further segmented into # regular memory, extended memory, and so on), backing # store for virtual memory (`swap space'). # # This table is intended to be a useful diagnostic for # `out of memory' and `out of buffers' types of # failures. In addition, it can be a useful performance # monitoring tool for tracking memory, disk, or buffer # usage. hrStorageTable = OidNode("1.3.6.1.2.1.25.2.3", "hrStorageTable") hrStorageTable.addChildren([OidNode("1", "hrStorageEntry")]) hrStorageTable["hrStorageEntry"].addChildren( [ # The type of storage represented by this entry. OidNode("2", "hrStorageType"), # A description of the type and instance of the storage # described by this entry OidNode("3", "hrStorageDescr"), # The size, in bytes, of the data objects allocated # from this pool. If this entry is monitoring sectors, # blocks, buffers, or packets, for example, this number # will commonly be greater than one. Otherwise this # number will typically be one. OidNode("4", "hrStorageAllocationUnits"), # The size of the storage represented by this entry, in