0

nterfaces with an actual description are returned as a string, for example the interface with Device1ILO

However the interfaces without a description configured, are returned as Hex-STRING 00.

How can I get it to return either an empty string or a "0" when using the metrics exported to my snmp-exporter prometheus instance? I would rather not configure a description for the interfaces that are unused because there are far too many at the moment.

snmpwalk -v2c -c SECRET HOST 1.3.6.1.2.1.31.1.1.1.18

iso.3.6.1.2.1.31.1.1.1.18. = STRING: "Device1ILO" iso.3.6.1.2.1.31.1.1.1.18. = Hex-STRING: 00 00

For reference this is the basic IF-MIB module and this is the IfAlias - Hardware is a Dell S4820T

1
  • 3
    Unfortunately, it returns what it returns. You could open a case with Dell (but don't expect it to be fixed anytime soon.)
    – Ricky
    Commented Jan 23, 2023 at 23:20

2 Answers 2

3

(Legally obligatory notice - I work for Dell)

As @Ricky pointed out, it returns what it returns. Hex 00 is typically the null terminator for strings so I'm guessing there's some traditional C-family language stuff going on and since there's nothing there, you're just getting the null terminator back. Edit: to clarify, this would fall into the realm of expected behavior. This is just another way of saying nothing is there.

If you're using Prometheus my suggestion would be to shape the data on the exporter side rather than creating descriptions for everything.

Edit: For the curious - would Dell change something like that? Yes - but we have to justify feature requests with a business case. It doesn't necessarily have to bring in money directly, but it does have to be something globally applicable that would be useful to a large audience. This is indeed unlikely to fit the criteria.

3
  • It's not a "feature request". This is a dirt simple bug. (the SNMP agent isn't recognizing the description isn't set. I'm shocked someone as big as Dell didn't catch this themselves.)
    – Ricky
    Commented Jan 24, 2023 at 0:36
  • 1
    Is it returning the null string or is it returning a text string that says Hex-STRING 00? The null string makes sense to me as a programmer (that is the c version of an empty string), if it actually is a string that literally says Hex-STRING 00, then that does not Commented Jan 24, 2023 at 0:39
  • 3
    Hex-STRING is the snmpclient's text for the returned OID tytpe. (turn off that output with one of the dash-oh options)
    – Ricky
    Commented Jan 24, 2023 at 2:43
0

bit late to the party but did you try using:

snmpwalk -Oa

1
  • Please elaborate: what does it do? Which devices does it work on?
    – Zac67
    Commented Feb 14 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.