-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snmp: Add ddwrt module #147
Conversation
This is the info I get from my DD-WRT from the UCDAVIS MIB, in case someone wants to check I didn't botch the types (I've 00-ified the MACs). I've mapped
|
A general observation... there's an enormous amount of duplicate OID mangling in Since |
I'm running into a very odd problem. I think it's a bug in DD-WRT honestly but I'm wondering if there's some way to work around it. It seems that there are
This makes it impossible to do the
Is it possible to work around that? I tried keeping two |
These need to be added to the generator configuration. |
You're right about not duplicating the Of course, it'd be way better to use the Another ddwrt option would be to use collectd, since it has the option to provide a prometheus target endpoint. |
I spent two days trying to get node_exporter to run on my router :P. Switched firmware a few times over, Merlin one's kernel was too old but it turns out DD-WRT compiles for MIPS without FPU emulation which makes Go break. It's been a long long day 😛. Hence why I went down this road. |
Yea, embedded systems can be a huge pain. |
Eh, so how do I add the In that same spirit, do I need to do something specific once I've amended generator, like run it and include the result in the PR too? |
We need the MIB, as that's how SNMP is designed. If one doesn't already exist, your best option in this case is probably to contribute one to dd-wrt and make sure it ends up somewhere easy to download.
Yes. You'll also need to include a pointer to the MIB in the README. |
Hmm, might be a while, if ever, for them to pull that in. But I can create one and host it on a GitHub repository for now. Would that be enough for the scope of this PR? |
Slightly different question. Lets say for |
Alright, in that case I'll amend the PR to include the defined entries from UCDAVIS and deal with the Final question, I think. There are some entries from |
There's no current option in the For now, you have to be a bit verbose in the walk list and only include the exact list you want included. |
I'm struggling a bit to get the
And a
However, running a
|
Oh, it's a dual column format, file name + MIB name. My bad. |
Alright. I think that's it. Thank you so much for your help and guidance @SuperQ, @brian-brazil! |
We would prefer the MIB from the vendor, otherwise we can't know that you got all the details right. |
There is no MIB from the vendor unfortunately. Someone contributed a simple script to DD-WRT named |
I've removed |
generator/generator.yml
Outdated
- interfaces | ||
- ifXTable | ||
- 1.3.6.1.2.1.25.2 # hrStorage | ||
- 1.3.6.1.4.1.2021.4 # ucdavis mem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this object is called memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
generator/generator.yml
Outdated
- 1.3.6.1.2.1.25.2 # hrStorage | ||
- 1.3.6.1.4.1.2021.4 # ucdavis mem | ||
# ucdavis laTable (load avg) | ||
- 1.3.6.1.4.1.2021.10.1.1 # laIndex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called processIndex in the MIB I'm looking at. Are you sure you're using the right MIB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you're looking at the right MIB: http://www.oidview.com/mibs/2021/UCD-SNMP-MIB.html? prIndex
is at 1.3.6.1.4.1.2021.2.1.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah indeed, I was looking at the wrong object.
generator/generator.yml
Outdated
- 1.3.6.1.4.1.2021.10.1.1 # laIndex | ||
- 1.3.6.1.4.1.2021.10.1.2 # laNames | ||
- 1.3.6.1.4.1.2021.10.1.5 # laLoadInt | ||
- 1.3.6.1.4.1.2021.11 # ucdavis systemStats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just systemStats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? The other one where I'm requesting everything is prefixed with ucdavis
, like ucdavis memory
. The laLoad
one has a header of ucdavis laLoad
and then the three OIDs that are of interest explicitly listed. Consistency wise, this is what's done before. I'm happy to change it but then I'd like to do this once so if you can tell me what you'd like the whole block to look like I'm happy to amend it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention in this file is for the comment to be just the object name, without any reference to the module name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. Done. I've updated all the comments to reflect that then.
The list of SNMP OIDs to care about for DD-WRT can be found here: https://www.dd-wrt.com/wiki/index.php/SNMP#Known_OID.C2.B4s_via_SNMP This works with routers running DD-WRT. It includes the usual things like network interfaces from SNMPv2-SMI and some information about the device itself through HOST-RESOURCES-MIB. I left out support for `hrSWRun`, `hrSWRunPerf`, `hrSWInstalled` and `hrMIBAdminInfo` as they seem bad fits for what Prometheus would care about and in the case of my device don't contain any data. Same thing for `hrDevice`. The `1.3.6.1.4.1.2021` bits come from the UCD-SNMP-MIB, part of Net-SNMP which is what appears to be the SNMPd on these devices: * .10: laTable (load information) * .11: systemStats
Thanks! |
Thank you too! |
* [FEATURE] Add Homepage on /. prometheus#135 * [IMPROVEMENT] Add ddwrt OIDs to generator. prometheus#147 * [IMPROVEMENT] Add synology OIDs to generator. prometheus#149, prometheus#154 * [IMPROVEMENT] Use lookup node's index label in the generator. prometheus#162 * [BUGFIX] Fix `authNoPriv` in config parsing. prometheus#141 * [BUGFIX] Update gosnmp vendoring to fix timeouts/errors. prometheus#139, prometheus#171
The list of SNMP OIDs to care about for DD-WRT can be found here: https://www.dd-wrt.com/wiki/index.php/SNMP#Known_OID.C2.B4s_via_SNMP
This works with routers running DD-WRT. It includes the usual things like network interfaces from SNMPv2-SMI and some information about the device itself through HOST-RESOURCES-MIB. I left out support for
hrSWRun
,hrSWRunPerf
,hrSWInstalled
andhrMIBAdminInfo
as they seem bad fits for what Prometheus would care about and in the case of my device don't contain any data.The
1.3.6.1.4.1.2021
bits come from the UCD-SNMP-MIB, part of Net-SNMP which is what appears to be the SNMPd on these devices:.4
: memory.10
: laTable (load information).11
: systemStats.255
: unknown (used by DD-WRT to store wireless client info so I had to make up names for it)