1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Asus Merlin SNMP doesn't report Number of CPU Cores (UCD-SNMP-MIB::ssCpuNumCpus.0) ?

Discussion in 'Asuswrt-Merlin' started by ninja888, Nov 8, 2018.

  1. ninja888

    ninja888 New Around Here

    Joined:
    Aug 7, 2017
    Messages:
    6
    Hi There,

    First off, thanks for the Asus Merlin Firmware - It's awesome!

    As an SNMP server (v2c), although the Asus Merlin SNMP server does answer a remote snmpwalk of the following UCD-SNMP-MIB::systemStats table, it strangely does not include the UCD-SNMP-MIB::ssCpuNumCpus.0 OID (which returns the number of CPU Cores in the router - Should return 2 for my router)

    $ snmpwalk -v 2c -c <SNMP COMMUNITY> <ROUTER IP> UCD-SNMP-MIB::systemStats
    UCD-SNMP-MIB::ssIndex.0 = INTEGER: 1
    UCD-SNMP-MIB::ssErrorName.0 = STRING: systemStats
    UCD-SNMP-MIB::ssSwapIn.0 = INTEGER: 0 kB
    UCD-SNMP-MIB::ssSwapOut.0 = INTEGER: 0 kB
    UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 0 blocks/s
    UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 0 blocks/s
    UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 188 interrupts/s
    UCD-SNMP-MIB::ssSysContext.0 = INTEGER: 4896 switches/s
    UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 1
    UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 1
    UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 97
    UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 323666
    UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 0
    UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 303516
    UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 28658661
    UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 22900
    UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 0
    UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 0
    UCD-SNMP-MIB::ssIORawSent.0 = Counter32: 0
    UCD-SNMP-MIB::ssIORawReceived.0 = Counter32: 0
    UCD-SNMP-MIB::ssRawInterrupts.0 = Counter32: 283879485
    UCD-SNMP-MIB::ssRawContexts.0 = Counter32: 787936477
    UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 323897
    UCD-SNMP-MIB::ssRawSwapIn.0 = Counter32: 0
    UCD-SNMP-MIB::ssRawSwapOut.0 = Counter32: 0
    UCD-SNMP-MIB::ssCpuRawSteal.0 = Counter32: 0
    UCD-SNMP-MIB::ssCpuRawGuest.0 = Counter32: 0
    UCD-SNMP-MIB::ssCpuRawGuestNice.0 = Counter32: 0


    $ snmpwalk -v 2c -c <SNMP COMMUNITY> <ROUTER IP> UCD-SNMP-MIB::ssCpuNumCpus.0
    UCD-SNMP-MIB::ssCpuNumCpus.0 = No Such Object available on this agent at this OID

    This OID (to get the number of CPUs in the router) is useful when doing an snmpwalk across multiple (not just Asus Merlin routers) devices so that the average CPU Utilisation can be calculated as:

    (HOST-RESOURCES-MIB::hrProcessorLoad.196608 + HOST-RESOURCES-MIB::hrProcessorLoad.196609 + HOST-RESOURCES-MIB::hrProcessorLoad.196610 + HOST-RESOURCES-MIB::hrProcessorLoad.196611) / UCD-SNMP-MIB::ssCpuNumCpus.0

    Is there any reason why this OID is not returned? For other devices on my network, this OID is returned as expected...

    FYI - I'm using Asus RT-AC88U - Firmware 384.6...

    EDIT: Also updated to Firmware 384.7_2 and see the same issue...

    Thanks!
     
    Last edited: Nov 8, 2018
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,237
    Location:
    Canada
    I never used SNMP, and the net-snmp documentation is half useless to explain which of the 30+ modules supports what. You will have to tell me which net-snmp module is missing...
     
  4. ninja888

    ninja888 New Around Here

    Joined:
    Aug 7, 2017
    Messages:
    6
    Hi @RMerlin,

    I'm assuming that all of the standard SNMP MIBs that are included in the Asus Merlin firmware releases are these exact versions at the following URL:

    https://github.com/RMerl/asuswrt-merlin.ng/tree/master/release/src/router/net-snmp-5.7.2/mibs

    If so, the issue seems to be that the standard (non-Asus-specific) MIBs that are included in the firmware are quite old and are missing some standard OIDs.

    As an example (I'm sure there are others...) the UCD-SNMP-MIB.txt MIB at the above URL has the line LAST-UPDATED "200901190000Z" in the file yet, my Ubuntu and NAS versions of UCD-SNMP-MIB have the line LAST-UPDATED "201407310000Z", indicating the file at the URL above is 5 years older...

    My UCD-SNMP-MIB.txt also has the following definition for ssCpuNumCpus which is missing from the UCD-SNMP-MIB.txt at the URL above:

    ssCpuNumCpus OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "The number of processors, as counted by the agent.
    This object's value may be useful in the management
    of certain operating systems where notions such as
    load average do not take into account the number of
    processors in the system.
    For other objects in the systemStats group whose
    descriptions refer to 'N processors', this object's
    value is N."
    ::= { systemStats 67 }

    To get the latest versions of these MIB files, this is how I did it on my Ubuntu 18.10 install (and also on my NAS):

    Install SNMP (Client) - https://www.digitalocean.com/commun...ure-an-snmp-daemon-and-client-on-ubuntu-14-04:
    o sudo apt-get install snmp-mibs-downloader
    o sudo download-mibs

    Running download-mibs then grabs the latest versions of the MIBs files and copies them to /usr/share/snmp/mibs)...

    Given the above:

    (A) Is it possible to update the MIBs to the latest versions in the Asus Merlin Firmware itself (possibly this may have to be an upstream fix from Asus)? Possibly also include an option in the Web GUI to run "download-mibs" to grab the latest MIB files?
    (B) Is it possible for me to "inject" the updated MIBs into my current Asus Merlin Firmware (384.7_2), possibly by just scp'ing the latest MIB.txt files themselves over the existing ones using SSH, rather than installing snmp-mibs-downloader and running download-mibs on the router itself)? I assume that, if I get this working but the firmware isn't patched to include the latest MIB updates in the future, I'd have to do this on each new firmware release?

    Thanks again!
     
  5. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,237
    Location:
    Canada
    No. The list of MIBs I enable are here:

    https://github.com/RMerl/asuswrt-merlin.ng/blob/master/release/src/router/Makefile#L5436

    I am only one version behind the last net-snmp release (unless they issued a new one very recently).

    No, you need to enable the necessary modules at compile time. If the supported MIBs are not up-to-date, you will have to tell that to the net-snmp authors.
     
  6. ninja888

    ninja888 New Around Here

    Joined:
    Aug 7, 2017
    Messages:
    6

    Hi @RMerlin,

    From the makefile URL you sent it looks like net-snmp-5.7.2 is being used and this appears to be quite a bit older than the more recent versions (appears to be 6 years older than latest):

    From https://sourceforge.net/projects/net-snmp/files/net-snmp/ :
    5.7.2 = 2012-10-09 (this appears to be the version used in the Asus Merlin Firmware and this is missing the ssCpuNumCpus OID from UCD-SNMP-MIB.txt)
    5.7.3 = 2014-12-08 (this includes the missing ssCpuNumCpus OID and a few more...)
    5.8 = 2018-07-16 (this includes the missing ssCpuNumCpus OID and a few more...)

    Is there any chance you could bump the net-snmp package to the latest (5.8)?

    Many Thanks!
     
  7. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,237
    Location:
    Canada
    I can take a look, yes. At the time I enabled SNMP support, 5.7.3 was still the latest, and it didn't show much changes, so I didin't bother updating it at the time.
     
  8. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,237
    Location:
    Canada
    I successfully upgraded to 5.8, NumCpu is now properly returned.

    (unfortunately, still no go on HND support, snmpd still causes a kernel crash as it tries to probe the Broadcom switch interfaces).
     
  9. ninja888

    ninja888 New Around Here

    Joined:
    Aug 7, 2017
    Messages:
    6
    Fantastic! Is there a beta release I can test with or will the new net-snmp package be released in the next update?

    Also, what's HND support?

    Many thanks again for taking a look into this!
     
  10. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,237
    Location:
    Canada
    It should be part of the next batch of alpha builds that I occasionally push to the Test Folder on Onedrive.

    HND is the Broadcom platform used by the RT-AC86U and RT-AX88U. It has a newer kernel and a new SDK environment, which so far is not compatible with net-snmp. Starting snmpd causes the router to reboot while net-snmp tries to query all the available network interfaces.
     
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!