What's new

Is there a way to get temperature values through SNMP?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

pidy

Occasional Visitor
Hi Everyone,

I'd like to pull temperature data from my RT-AX86U through SNMP.
I got encouraged when I saw LM-SENSORS-MIB among the mibs on github, but snmpwalk didn't return anything from that mib, so maybe it's not included after all? I tried looking for the mibs, but couldn't find them in the usual spot.
Listing the directories provided by the 'net-snmp-config --default-mibdirs' command through SSH also didn't work. I guess it's a permissions issue.

Does anyone know how to get this to work?
Also, if LM-SENSORS-MIB is not included in the fw, does anyone know why?

Thanks. :)
 
Also, if LM-SENSORS-MIB is not included in the fw, does anyone know why?
Because it would be useless. The router runs a proprietary SoC, not a generic x86 platforms, so it would be unable to report anything.
 
Because it would be useless. The router runs a proprietary SoC, not a generic x86 platforms, so it would be unable to report anything.
Ah, OK. Thanks for the explanation. I guess that mib being there tricked me a bit. :)

As an alternative approach I figured I'd try to take advantage of the snmp extend functionality also described in this post.
I've created the script with the updated commands to output the right temperature values for CPU and the wireless modules, however I've run into an issue with the snmpd.conf file.

I would have to add an exec/extend line to the file, but the one in /tmp directory doesn't seem to be persistent, it apparently gets recreated at reboot.
Is there a persistent copy of this somewhere perhaps that ends up being copied to the /tmp directory during reboot and that I could perhaps edit?
(The only other snmpd.conf I was able to find is in /var/net-snmp and looks quite different and clearly states that it shouldn't be edited.)

It occurred to me that making the config file in /tmp read-only could perhaps prevent it from being overwritten, but I'm not sure if this would work, (what the right permission set would be) and if it could lead to any issues.

What would be the best way to go about this in your opinion?
 
Never mind, I've just come across the custom config files wiki page, which should solve this. I'll be looking into it tomorrow.
I'm new to this fw and have a lot to learn, but I'm loving it so far. Thanks for all your work!
 
Update:
after some tinkering, the custom script + snmp extend approach is working great.
(I've used the custom config files functionality to append the /tmp/snmpd.conf file.)

My updated script for pulling the temperature data on my RT-AX86U:
Bash:
#!/bin/ash

# CPU Temperature with mC->C calculation performed
cat /sys/class/thermal/thermal_zone0/temp | awk '{print $1 / 1000}'

# Wireless Module Temperatures with calculations performed (eth6: 2.4GHz, eth7: 5GHz)
wl -i eth6 phy_tempsense | awk '{print $1 / 2 + 20}'
wl -i eth7 phy_tempsense | awk '{print $1 / 2 + 20}'

Out of curiosity, in case anyone knows, what is the background to this weird calculation for the wireless modules? I've found a reference to it in a post, and it provides the same numbers that are visible in the GUI so I applied it, but it just looks so weird. :)
 
Last edited:
Out of curiosity, in case anyone knows, what is the background to this weird calculation for the wireless modules? I've found a reference to it in a post, and it provides the same numbers that are visible in the GUI so I applied it, but it just looks so weird. :)
No idea, but it's based on code within Asus's own code, and I assume they based that calculation on documentation they received from Broadcom.
 
No idea, but it's based on code within Asus's own code, and I assume they based that calculation on documentation they received from Broadcom.
Cool, thanks for the details.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top