Thursday, July 27, 2017

.::: Different Output OID ifDescr & ifAlias :::.

1. Different ifDescr, ifName & ifAlias
ifDescr OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
            "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
            interface hardware/software."
    ::= { ifEntry 2 }

ifAlias   OBJECT-TYPE
    SYNTAX      DisplayString (SIZE(0..64))
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
            "This object is an 'alias' name for the interface as
            specified by a network manager, and provides a non-volatile
            'handle' for the interface.

            On the first instantiation of an interface, the value of
            ifAlias associated with that interface is the zero-length
            string.  As and when a value is written into an instance of
            ifAlias through a network management set operation, then the
            agent must retain the supplied value in the ifAlias instance
            associated with the same interface for as long as that
            interface remains instantiated, including across all re-
            initializations/reboots of the network management system,
            including those which result in a change of the interface's
            ifIndex value.

            An example of the value which a network manager might store
            in this object for a WAN interface is the (Telco's) circuit
            number/identifier of the interface.

            Some agents may support write-access only for interfaces
            having particular values of ifType.  An agent which supports
            write access to this object is required to keep the value in
            non-volatile storage, but it may limit the length of new
            values depending on how much storage is already occupied by
            the current values for other interfaces."
    ::= { ifXEntry 18 }

ifName OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
            "The textual name of the interface.  The value of this
            object should be the name of the interface as assigned by
            the local device and should be suitable for use in commands
            entered at the device's `console'.  This might be a text
            name, such as `le0' or a simple port number, such as `1',
            depending on the interface naming syntax of the device.  If
            several entries in the ifTable together represent a single
            interface as named by the device, then each will have the
            same value of ifName.  Note that for an agent which responds
            to SNMP queries concerning an interface on some other
            (proxied) device, then the value of ifName for such an
            interface is the proxied device's local name for it.

            If there is no local name, or this object is otherwise not
            applicable, then this object contains a zero-length string."
    ::= { ifXEntry 1 }


2. OID ifDescr & ifAlias
1.3.6.1.2.1.2.2.1.2     ifDescr LEAF  DisplayString
1.3.6.1.2.1.31.1.1.1.18 ifAlias LEAF  DisplayString
1.3.6.1.2.1.31.1.1.1.1  ifName  LEAF  DisplayString

3. Sample Run snmpwalk
[root@TeguhLab data]# echo ".::: Sample Server1 :::."
.::: Sample Server1 :::.
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 1.3.6.1.2.1.2.2.1.2.12
IF-MIB::ifDescr.12 = STRING: to_SAM, IP interface
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 1.3.6.1.2.1.31.1.1.1.18.12
IF-MIB::ifAlias.12 = STRING: IP interface
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 1.3.6.1.2.1.31.1.1.1.1.12
IF-MIB::ifName.12 = STRING: to_SAM
[root@TeguhLab data]# echo " "

[root@TeguhLab data]# echo ".::: Sample Server2 :::."
.::: Sample Server2 :::.
[root@TeguhLab data]# snmpwalk -v 2c -c teguht 10.10.10.20 1.3.6.1.2.1.2.2.1.2.11
IF-MIB::ifDescr.11 = STRING: ether11
[root@TeguhLab data]# snmpwalk -v 2c -c teguht 10.10.10.20 1.3.6.1.2.1.31.1.1.1.18.11
IF-MIB::ifAlias.11 = STRING: TO FW INTERNET
[root@TeguhLab data]# snmpwalk -v 2c -c teguht 10.10.10.20 1.3.6.1.2.1.31.1.1.1.1.11
IF-MIB::ifName.11 = STRING: ether11
[root@TeguhLab data]#

4. Sample Run script snmpwalk
[root@TeguhLab data]# cat diff.sh
echo ".::: Sample Server1 :::."
snmpwalk -v 2c -c public 10.10.10.10 1.3.6.1.2.1.2.2.1.2.12
snmpwalk -v 2c -c public 10.10.10.10 1.3.6.1.2.1.31.1.1.1.18.12
snmpwalk -v 2c -c public 10.10.10.10 1.3.6.1.2.1.31.1.1.1.1.12
echo " "
echo ".::: Sample Server2 :::."
snmpwalk -v 2c -c teguht 10.10.10.20 1.3.6.1.2.1.2.2.1.2.11
snmpwalk -v 2c -c teguht 10.10.10.20 1.3.6.1.2.1.31.1.1.1.18.11
snmpwalk -v 2c -c teguht 10.10.10.20 1.3.6.1.2.1.31.1.1.1.1.11

[root@TeguhLab data]# ./diff.sh
.::: Sample Server1 :::.
IF-MIB::ifDescr.12 = STRING: to_SAM, IP interface
IF-MIB::ifAlias.12 = STRING: IP interface
IF-MIB::ifName.12 = STRING: to_SAM

.::: Sample Server2 :::.
IF-MIB::ifDescr.11 = STRING: ether11
IF-MIB::ifAlias.11 = STRING: TO FW INTERNET
IF-MIB::ifName.11 = STRING: ether11
[root@TeguhLab data]#

No comments:

Post a Comment

Popular Posts