Re: NULL result with net-snmp-5.9.4_1,1

From: Budi Janto <budijanto_at_studiokaraoke.co.id>
Date: Sun, 02 Jun 2024 07:23:51 UTC
On 6/1/24 22:45, Mark Johnston wrote:
> On Sat, Jun 01, 2024 at 11:35:02AM -0400, Dan Langille wrote:
>> On Sun, May 26, 2024, at 2:00 AM, Budi Janto wrote:
>>> Hi,
>>>
>>> I need some help with Net-SNMP packages for monitoring CPU temperature.
>>>
>>> # uname -smr
>>> FreeBSD 14.0-RELEASE-p5 amd64
>>>
>>> # pkg info | grep net-snmp
>>> net-snmp-5.9.4_1,1             Extendable SNMP implementation
>>>
>>> # sh x/snmp-cpu-temperature.sh
>>> 30.0
>>> 29.0
>>> 28.0
>>> 28.0
>>> 29.0
>>> 29.0
>>> 29.0
>>> 29.0
>>> 30.0
>>> 28.0
>>> 28.0
>>> 27.0
>>>
>>> # snmpwalk -v2c -c public localhost . | grep
>>> 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature"'
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".1 = STRING:
>>>
>>> That's NULL result.
>>>
>>> But, I changed to net-snmp-5.9.4,1 version.
>>> # pkg info | grep net-snmp
>>> net-snmp-5.9.4,1               Extendable SNMP implementation
> 
> I believe that in net-snmp-5.9.4_1,1, snmpd is running as the "snmpd"
> user rather than as root.  Can you confirm this?  net-snmp-5.9.4_2,1
> reverts back to running as root.  Does that fix the problem for you?
> 
> What is in your snmp-cpu-temperature.sh script?  Does it need to run as
> root?  (I'd be a bit surprised if so.)
> 
>>>
>>> # snmpwalk -v2c -c public localhost . | grep
>>> 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature"'
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".1 = STRING: 35.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".2 = STRING: 35.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".3 = STRING: 38.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".4 = STRING: 38.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".5 = STRING: 38.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".6 = STRING: 38.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".7 = STRING: 36.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".8 = STRING: 36.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".9 = STRING: 39.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".10 = STRING: 39.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".11 = STRING: 35.0
>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."cpu-temperature".12 = STRING: 36.0
>>
>> with net-snmp-5.9.4_2,1 for what it's worth:
>>
>> [dvl@besser:~] $ snmpwalk -v3 -l authPriv -u roMinion -a SHA -A $AUTHPASS -X $PRIVPASS -x AES dev-nginx01.int.unixathome.org | grep temperature
>> [dvl@besser:~] $
> 
> This is in the extension MIB, so presumably Budi has some configuration
> to add these OIDs.  Did you add something like that?

Thanks folks,

Sorry for late, yesterdays, I just upgrade to newers version of 
net-snmp. That problem already gone.

# pkg info | grep snmp
net-snmp-5.9.4_2,1             Extendable SNMP implementation

-- 
Regards,
Budi Janto