How to implement Arista fan sensor status check

Hi
when I use the ARISTA-ENTITY-SENSOR-MIB, I can find the following…
entPhysicalDescr
.1.3.6.1.2.1.47.1.1.1.1.2.100601111 = STRING: Fan Tray 1 Fan 1 Sensor 1
.1.3.6.1.2.1.47.1.1.1.1.2.100602111 = STRING: Fan Tray 2 Fan 1 Sensor 1
.1.3.6.1.2.1.47.1.1.1.1.2.100603111 = STRING: Fan Tray 3 Fan 1 Sensor 1
.1.3.6.1.2.1.47.1.1.1.1.2.100604111 = STRING: Fan Tray 4 Fan 1 Sensor 1

and

entPhySensorOperStatus
.1.3.6.1.2.1.99.1.1.1.5.100601111 = INTEGER: ok(1)
.1.3.6.1.2.1.99.1.1.1.5.100602111 = INTEGER: ok(1)
.1.3.6.1.2.1.99.1.1.1.5.100603111 = INTEGER: ok(1)
.1.3.6.1.2.1.99.1.1.1.5.100604111 = INTEGER: ok(1)

which is the corresponding status for the above sensors

how would I go about developing the check for these?

I’m looking at https://checkmk.com/cms_legacy_devel_snmpbased.html

but from the example it looks like all info is collected from 1 base OID…
I think I’m looking at .1.3.6.1.2.1.47.1.1.1.1.2. and .1.3.6.1.2.1.99.1.1.1.5. for these 2 values?

Hello,

take a look at the ~/share/check_mk/checks/zebra_model check as an example.

I think this is what you are looking for. So in your case:

check_info["your_check"] = {
<snip>
    "snmp_info": [
        (
            ".1.3.6.1.2.1",
            ["47.1.1.1.1.2", "99.1.1.1.5"],
        ) ,
</snip>
}

It does depend however on what else this OIDs hold. So does an snmpwalk on eg. .1.3.6.1.2.1.99.1.1.1.5 return anything beside 100601111, 100602111 etc.?

br

Hi – thanks for getting back to me!
yes the snmpwalk gives back about 80 or so entries.

I’ll take a look at the check you provided, hopefully it will shed some light =)

I think this is a little bit more complicated.
You need to fetch also the OID_END (100601111, 100602111 and so on). This number is needed to join then booth lists you fetch.
Good example is the https://github.com/tribe29/checkmk/blob/master/checks/cmciii check - info section starting at line 209
Your parse function don’t need to be as complex as the cmciii check but you need to join booth lists to one single list or dictionary (dictionary would be preferred).