-
Notifications
You must be signed in to change notification settings - Fork 2
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 counter overflows #1
Comments
The MIB was 'thrown together' without much regard (but 'some') to what the values actually where, so I'm not overly surprised by this. I haven't been running it myself in a while, because I have stability issues because of 'load sensitivity' on my primary (bad SAS/SATA card/driver). The I'll see what I can do, but if you have concrete changes, feel free to open a pull request. |
Ok so I changed the MIB to use Integer64 for the values in zfsPoolStatusTable but Net-SNMP still does not return them properly. Then I found this patch https://sourceforge.net/p/net-snmp/patches/737/ but it does not appear to have been applied. I am running Ubuntu Vivid (15.04) with Net-SNMP 5.7.2 but even latest upstream doesn't look like it handles it properly. |
Then I don't know off-hand what to do :( |
On a side note, I love the clean code in https://github.com/calmh/solaris-extra-snmp/blob/master/zfs-snmp although it depends on kstat and doesn't appear to keep persistency, but that could be fixed fairly easily. I think a better way of getting the zpool usage (instead of using
Total capacity is obviously the sum of all 3 values |
That still don't help unfortunately. The maximum value of a (unsigned) 64-bit int is Discussion actually jogs some distant memories though. It feels like I've had this discussion with myself but couldn't solve it… https://en.wikipedia.org/wiki/Integer_(computer_science)#Common_integral_data_types |
I've been trying to do something about this in https://github.com/FransUrbo/snmp-modules/tree/int64_size-free, but it didn't work as I expected. |
With this patch on the |
I took your recommendation to use I'm still trying to figure out how to fix the MIB. BUT, the code in the
The fact that it returns a |
https://tools.ietf.org/html/draft-perkins-opaque-01 might help you understand more. Looking at that patch and the file it applies to, that section of code is all about unsigned longs which means it should be returning a type of ASN_OPAQUE_U64 and have a definition of 'Unsigned64'. That then leaves no 'integer64' (signed) in which case the #ifdef probably also needs another clause added to handle signed 64-bit integers. The implementation would be the same for all 3 if I'm not wrong. The difference between Counter64, Integer64 and Unsigned64 is that Counters don't decrease and of course the interpretation of +/-. For our purposes we really want Unsigned64. See also https://sourceforge.net/p/net-snmp/code/ci/1b4ca14972d39d61a93bb0e3e4eea76795bedb89/tree/include/net-snmp/library/asn1.h line 80 and onwards. |
Tripple checking and actually LOOKING at the code more closely this time, you're probably right. Using a unsigned instead of signed in the code, because we don't need negative values, In practice though, it shouldn't really matter right now. We can return a 9ZB value (instead of a 18ZB value with unsigned). That still isn't enough to account for the total size of a ZFS pool :). But it should be enough for almost everyone. For now. To be able to return the value of the maximum size of a ZFS pool (256ZB), we need a 128bit value! However, although you're right in that, the problem is currently how to incorporate that into the MIB. I have added both a I64 and a U64, but neither work as expected. But I'm starting to wonder if it matter if it returns a Could you try the |
I've taken your suggestions for net-snmp and walked (not ran :) with it - http://sourceforge.net/p/net-snmp/mailman/message/34291537/. However, my two patches isn't included in the web archive for some reason. https://gist.github.com/FransUrbo/a2bfee606ffda0b7b81e This gives me:
which seems to just fine (except that instead of a |
Don't seem to need any special stuff in the MIB. Just made the
|
|
Same code on a host that doesn't have a patched Net-SNMP:
|
Querying a unpatched server from a OSX Lion:
And to the patched server:
So I guess the patch still needs some work. Or possibly the MIB. |
Great work on developing these modules but I seem to be overflowing the 32bit counters for my zpool info:
Seems ok coming out of the perl script:
Any suggestions?
The text was updated successfully, but these errors were encountered: