Ad Widget

Collapse

{#SNMPVALUE} or {#SNMPINDEX} macro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michael_ox
    Junior Member
    • Dec 2019
    • 1

    #1

    {#SNMPVALUE} or {#SNMPINDEX} macro

    Hi,

    im trying to monitor Fex status on cisco nexus devices. The issue i come to is that to name each item correctly, I need to modify the {#SNMPINDEX} (or the value).

    I've tried many combinations of regsub to modify the macro in the SNMP OID but i still cannot get it to work. The regex is good, however, it does not run as code. I am trying to do this in a discovery rule.

    Below are two examples. the text in red is the part i'd like to extract

    SNMPv2-SMI::mib-2.47.1.1.1.1.2.100000022 = STRING: "Fex-100 Fabric Extender Module: 32x10G BaseT downlinks in FixedModule-1"
    SNMPv2-SMI::mib-2.47.1.1.1.1.2.
    101000022 = STRING: "Fex-101 Fabric Extender Module: 32x10G BaseT downlinks in FixedModule-1"
    SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.
    100021590 = INTEGER: 34 SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.100021591 = INTEGER: 29
    SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.
    100021592 = INTEGER: 23 SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.100021593 = INTEGER: 33
    SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.
    101021590 = INTEGER: 29 SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.101021591 = INTEGER: 30
    SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.
    101021592 = INTEGER: 22 SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.101021593 = INTEGER: 32

    Thanks in advance
  • Sevlow
    Junior Member
    • Dec 2019
    • 4

    #2
    Hi Michael,

    I happened upon this old post whilst looking into something I thought might be related. Just curious why you need extract those parts of the string? The value returned from polling those items will be either those strings (which provides full detail for the two FEX modules), or an integer (whatever those represent - percentage, temp, etc.). Of course, you can specify whatever value for 'Units' in the item/item prototype setup.

    Another thing you might want to do, to clean up the output generated by snmp(walk/bulkwalk/get) is grab the ENTITY-MIB and put it on your Zabbix server. If you're using *nix, best to use something like /usr/local/share/snmp/mibs so that an update to the server doesn't erase. Adds useful detail to your output:

    snmpwalk 10.xx.xx.xx SNMPv2-SMI::mib-2.47.1.1.1.1.2
    ENTITY-MIB::entPhysicalDescr.10 = STRING: Fabric [VPC domain:50]
    ENTITY-MIB::entPhysicalDescr.22 = STRING: 48X10GE/Modular Supervisor in Fixed Module-1
    ENTITY-MIB::entPhysicalDescr.23 = STRING: 16 port Flexible GEM
    ENTITY-MIB::entPhysicalDescr.149 = STRING: Nexus 5596 Chassis
    ENTITY-MIB::entPhysicalDescr.214 = STRING: Fixed Slot-1
    ENTITY-MIB::entPhysicalDescr.215 = STRING: Module Slot-2
    ENTITY-MIB::entPhysicalDescr.216 = STRING: Module Slot-3
    ENTITY-MIB::entPhysicalDescr.217 = STRING: Module Slot-4
    ENTITY-MIB::entPhysicalDescr.278 = STRING: PowerSupplyBay-1
    ENTITY-MIB::entPhysicalDescr.279 = STRING: PowerSupplyBay-2
    ENTITY-MIB::entPhysicalDescr.342 = STRING: FanBay-1
    ENTITY-MIB::entPhysicalDescr.343 = STRING: FanBay-2
    ENTITY-MIB::entPhysicalDescr.344 = STRING: FanBay-3
    ENTITY-MIB::entPhysicalDescr.345 = STRING: FanBay-4
    ENTITY-MIB::entPhysicalDescr.470 = STRING: Nexus PSU module, 100-240VAC 1100W
    ENTITY-MIB::entPhysicalDescr.471 = STRING: Nexus PSU module, 100-240VAC 1100W
    ENTITY-MIB::entPhysicalDescr.534 = STRING: FanModule-1
    ENTITY-MIB::entPhysicalDescr.535 = STRING: FanModule-2
    ENTITY-MIB::entPhysicalDescr.536 = STRING: FanModule-3
    ENTITY-MIB::entPhysicalDescr.537 = STRING: FanModule-4

    ---CUT----

    Comment

    Working...