Skip to main content

SNMP data validation

What nl6 checks about a resource file's snmp array at load, and which vendor subtrees a human has read against a MIB. The reasoning behind each rule, and the audit findings, are on SNMP data fidelity.

Load rules​

validateSNMPResourceValues runs three rules over every snmp entry, in the order the encoder applies them. Each rule decides by calling the production encoder, never by a second predicate.

RuleRefusesDecided by
1. Sentinela response exactly equal to noSuchObject or endOfMibViewisSNMPExceptionValue, the encoder's own exact test
2. OID-typed valuea value on an OBJECT IDENTIFIER leaf that encodeOID cannot representcalling encodeOID and testing for the degenerate 06 00
3. Typed classa value on a leaf the type table types that does not encode at that typecalling encodeTypedValue and comparing the emitted tag with the declared one

Rule 3 covers Counter32, Gauge32, TimeTicks, Counter64 and IpAddress leaves.

Value on a typed leafOutcome
negative on Counter32, Gauge32, TimeTicksloads with a warning; wrap-cast to 32 bits on the wire
negative on Counter64refused
surrounding whitespace (" 42")refused
units, hex, fraction, or past the type's widthrefused
IpAddress leaf not a dotted-quad IPv4refused

A rejection at startup exits the process. A rejection over REST answers 400 with the file's base name, the OID and the value. See Web API → resource_file failures.

What the rules do not cover​

SurfaceStatus
OID keysunchecked; only values are validated
Bare table columns and wrong INDEX arityno rule; needs the MIB. A hand audit deleted 61 entries
Semantic faithfulness to the MIBno rule; five arcs audited by hand, fourteen labelled UNAUDITED-ARC(<pen>)
MAX-ACCESS (write-only, not-accessible)no rule; one confirmed write-only object (writeMem) deleted
Leaves the type table does not typeserved as INTEGER or OCTET STRING, whatever the value parses as
Vendor 64-bit countersuntyped, served as INTEGER, not diverted for SNMPv1
sysName, sysLocationserved outside the resource map; sysLocation is filtered once at load
SSH, API, optical sections; trap and syslog catalogsnever reach encodeTypedValue; the catalogs have their own validation
Version-0 GETBULKanswered as-is, 0x46 tags included

ENTITY-MIB structure​

Four corpus tests check the shape of every shipped entPhysicalTable, and a fifth checks the port rows of the four generated profiles. They run in make test, not at load, so they cover shipped profiles and not operator files.

TestRefuses
TestEveryEntityTableHasOneChassisRoota table with no row or several rows of entPhysicalContainedIn 0, a root that is not chassis(3) or whose entPhysicalParentRelPos is not -1, and a row contained in an index the profile does not serve
TestEveryProfileServesOnlyItsOwnVendorArcan entPhysicalVendorType under another vendor's PEN, including the IANA-reserved PEN 0
TestEntityInventoryColumnsAreWellFormedOrAbsentan entPhysicalMfgDate that is not an 8- or 11-octet DateAndTime with its fields in range, an entPhysicalUris that is not zero-length or space-separated absolute URIs, and an entPhysicalUUID that is not 0 or 16 octets
TestEntityManufacturerIsNamedAndConsistenta root row with no or an empty entPhysicalMfgName, and a row whose non-empty entPhysicalMfgName differs from the root's
TestGeneratedFamilyPortRowsServeNoInventedValuesa non-empty revision, serial number, manufacturer, model name or asset ID on a port row of cisco_nexus_9500, cisco_catalyst_9500, juniper_mx960 or palo_alto_pa3220

An unknown vendor type is zeroDotZero (0.0), as RFC 4133 prescribes. The four generated profiles serve zero-length inventory strings on their port rows, as RFC 4133 prescribes for an unknown or unassigned value. Port rows of the other profiles still carry synthetic revisions and serial numbers. No shipped profile serves entPhysicalMfgDate, entPhysicalUris or entPhysicalUUID. The resource format sends a string as its literal bytes, so it cannot spell a DateAndTime.

Vendor arc disposition​

Every enterprise arc a shipped profile serves is exactly one of three things. A new device type that serves a vendor subtree and is none of them fails TestEveryVendorArcIsAuditedLabelledOrExcluded by name.

DispositionMeaningWhere it is recorded
auditedsomebody read the vendor's MIBthe PEN is in auditedArcPENs, each row naming its reading test
labellednobody has read a MIB for itevery part carrying the arc has UNAUDITED-ARC(<pen>) in its _comment
excludedthe arc is not a vendor claimthe (profile, PEN) pair is in excludedArcPairs with a reason

Audited arcs​

Counts are distinct OIDs found wrong or unresolvable, out of distinct OIDs read.

VendorPENWrong
Palo Alto254618 of 11
Cisco911 of 13
Arista300656 of 6
Ciena12710 of 1
Juniper263613 of 15 (19 of 22 entries)
NVIDIA5703not applicable: NVIDIA publishes no SNMP GPU MIB, so every object below the PEN is nl6's own definition

Labelled arcs​

Fourteen profiles, one arc each, twenty-five parts carrying the marker.

ProfilePEN
check_point_156002620
dell_emc_unity1139
dell_poweredge_r750674
dlink_dgs3630171
extreme_vsp44501916
fortinet_fortigate_600e12356
hpe_proliant_dl380232
huawei_ne80002011
ibm_power_s9222
nec_ix3315119
netapp_ontap789
nokia_7750_sr126527
pure_storage_flasharray40482
sonicwall_nsa67008741

Excluded pairs​

ProfilePENReason
aws_s3_storage32473RFC 5612 documentation PEN; no vendor MIB exists to audit against