Hello, I have a particular need to publish custom SNMP values. For example, I have a LTE Cellular module connected and I would need to publish its IMEI to be found by a SNMP tool, for example, Paessler SNMP Tester. By the way, I already have an enterprise number from IANA if it's necessary.
I've had some progress by editing the /etc/config/snmpd file adding a section like this:
config exec
option name drq-signalinfo
option prog "/sbin/uqmi -d /dev/cdc-wdm0 --get-signal-info | awk '{print substr($0, 2, length($0) - 2)}'"
option miboid .1.3.6.1.4.49085.3
When running a snmpwalk I get a response like this:
*2/28/2023 1:10:24 PM (14 ms) : 1.3.6.1.4.49085.1.1.1 = "1" [ASN_INTEGER]*
*2/28/2023 1:10:24 PM (20 ms) : 1.3.6.1.4.49085.1.2.1 = "drq-imei" [ASN_OCTET_STR]*
*2/28/2023 1:10:24 PM (25 ms) : 1.3.6.1.4.49085.1.3.1 = "/sbin/uqmi -d /dev/cdc-wdm0 --get-imei | awk '{print substr($0, 2, length($0) - 2)}'" [ASN_OCTET_STR]*
*2/28/2023 1:10:24 PM (139 ms) : 1.3.6.1.4.49085.1.100.1 = "0" [ASN_INTEGER]*
*2/28/2023 1:10:24 PM (235 ms) : 1.3.6.1.4.49085.1.101.1 = ""864744040333609"" [ASN_OCTET_STR]*
*2/28/2023 1:10:24 PM (332 ms) : 1.3.6.1.4.49085.1.102.1 = "0" [ASN_INTEGER]*
*2/28/2023 1:10:24 PM (336 ms) : 1.3.6.1.4.49085.1.103.1 = "" [ASN_OCTET_STR*
Which is not ideal, because it's bringing a lot of unnecessary values, and that number should be typed as integer, not string, so, I have the idea that I need to write a .mib file, but what I would know beyond the how to write it, I want to know what do I have to tell the /etc/config/snmpd file to read my definitions and return the expected data type and get rid of all those outputs that don't bring value to the snmp scan.
Thank you!!