Raspberry PI - Temperature, Voltage , Freq

You are not alone, I see the same thing.

Yep, same thing here (to avoid any confusion).

I think that the sensor_oid is wrong in your DB.

SELECT sensor_class, sensor_oid FROM sensors WHERE device_id=X;

should give below result.

+--------------+----------------------------------------------------------------------+
| sensor_class | sensor_oid                                                           |
+--------------+----------------------------------------------------------------------+
| frequency    | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.6  |
| frequency    | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.7  |
| state        | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.8  |
| state        | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.9  |
| state        | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.10 |
| state        | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.11 |
| state        | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.12 |
| state        | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.13 |
| temperature  | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.1  |
| voltage      | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.2  |
| voltage      | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.3  |
| voltage      | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.4  |
| voltage      | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.5  |
+--------------+----------------------------------------------------------------------+

I was missing for some rows the leading dot in column sensor_oid.

Simple fix is to delete the rows and rerun a discovery:
DELETE FROM sensors WHERE device_id=X AND sensor_class IN (ā€˜frequencyā€™,ā€˜voltageā€™);

+--------------+---------------------------------------------------------------------+
| sensor_class | sensor_oid                                                          |
+--------------+---------------------------------------------------------------------+
| temperature  | .1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.1 |
+--------------+---------------------------------------------------------------------+

Just temperature. No other sensors were found. I donā€™t know but the history of this threads shows so many different fixes and suggestions, I donā€™t know what the right way to install is anymore.

The raspberry.sh script was changed, then changed back, it is now in the librenms-agent directory, but I have it running from the snmpd.conf, which if removed makes the temperature not being detected eitherā€¦

@Zucht how did you configure your raspberry? Is it running rasbian?
I am now using the raspberry.sh script, and I think the agent is irrelevant. Iā€™ve tried disabling the raspberry.sh but the agent isnā€™t reporting anything.

Iā€™ve tried several versions of the raspberry.sh script, the one Iā€™m currently using gives me two temperature sensors, nothing else. Iā€™ve seen the array working on discovery once, but have since lost track of what is where.

EDIT:
Iā€™ve just reinstalled the PI with the latest raspbian. Configured SNMP and now the values are added to an array at discovery:
Array
(
[raspberry_pi_sensors] => Array
(
[3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.1] => Array
(
[iso] => 49.4
)

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.2] => Array
                (
                    [iso] => 1.2000
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.3] => Array
                (
                    [iso] => 1.2000
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.4] => Array
                (
                    [iso] => 1.2000
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.5] => Array
                (
                    [iso] => 1.2250
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.6] => Array
                (
                    [iso] => 1200000000
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.7] => Array
                (
                    [iso] => 400000000
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.8] => Array
                (
                    [iso] => enabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.9] => Array
                (
                    [iso] => disabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.10] => Array
                (
                    [iso] => disabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.11] => Array
                (
                    [iso] => enabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.12] => Array
                (
                    [iso] => enabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.13] => Array
                (
                    [iso] => disabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.14] => Array
                (
                    [iso] => H264=2
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.15] => Array
                (
                    [iso] => MPG2=disabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.16] => Array
                (
                    [iso] => WVC1=disabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.17] => Array
                (
                    [iso] => MPG4=2
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.18] => Array
                (
                    [iso] => MJPG=2
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.19] => Array
                (
                    [iso] => WMV9=disabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.20] => Array
                (
                    [iso] => WMV9=disabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.21] => Array
                (
                    [iso] => H264=enabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.22] => Array
                (
                    [iso] => MPG2=1
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.23] => Array
                (
                    [iso] => WVC1=1
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.24] => Array
                (
                    [iso] => MPG4=enabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.25] => Array
                (
                    [iso] => MJPG=enabled
                )

            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.26] => Array
                (
                    [iso] => WMV9=1
                )

        )

However, nothing is being added to the database, just the temperature sensor. Note that this is without using the agent, initially it states that it is required, the documentation clearly states that it doesnā€™t.

Hi, Iā€™m completely new to librenms, and after reading all this Iā€™m more confused than before :slight_smile:

All Information my librenms shows is the cpu temp too.
Did you get a fix yet or not? This thread is like fixed - not fixed - fixed - not fixed, i donā€™t knowā€¦

Well, Iā€™m trying to get information so I can get a working device. I wanted to document it as well, Iā€™ve started going through the files and just trying to see what is happening and what is going wrong. Iā€™ve had the empty graphs, but now I donā€™t and I do see data.

I did see there is a typo in /includes/discovery/sensors/voltage/linux.inc.php, but fixing it doesnā€™t do anything.

	$sensor_type = "rasbperry_volts";
	$oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.';
	for ($volt = 2; $volt < 6; $volt++) {

Which should of course be:

	$sensor_type = "raspberry_volts";

Other than that, I hope I get some more feedback from either Zucht or other users that still have some more sensors in their database after discovery. The array is being filled and the data is being ā€œwalkedā€ by SNMP but it isnā€™t parsed.
Iā€™m thinking of rolling back the discovery files to a previous version, when it did create the graphs and thus sensors to see if the new data is being processed then.

I just did a clean raspbian stretch install and followed the instructions in the docs. For raspian.sh to work i had to add an other user to the sudoers file: Debian-snmp instead of snmp

Yeah, they changed that in a recent version, on my current install that is also the user that runs the raspberry.sh script. However, I only get temperature added in LibreNMS, you posted from your database earlier, and there were frequencies, voltages etc. I get them in an array when I run discovery, and they are polled through SNMP, but they donā€™t show in LibreNMSā€¦

Soā€¦

@laf Iā€™ve been trying to wrap my head around what is going wrong. Iā€™ve been looking at the discovery logs some of the other users have been posting, and I was seeing a difference in the array. In my array, all values are ISO:

[raspberry_pi_sensors] => Array
        (
            [3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.1] => Array
                (
                    [iso] => 48.3
                )

and Iā€™ve seen others with nsExtendOutLine."raspberry" and values as nsExtendOutLine. And in their screenshot I saw the sensors were added but values were empty. I was trying to figure out why, so I reinstalled one raspberry, but nothing changed. I blocked out the mib: line in my /etc/snmp/snmp.conf on the librenms host. When I checked later, it was showing values for the sensors and the discovery log now translates the ISO / array into nsExtendOutline values:

Array
(
    [raspberry_pi_sensors] => Array
        (
            [raspberry.1] => Array
                (
                    [nsExtendOutLine] => 48.3
                )

            [raspberry.2] => Array
                (
                    [nsExtendOutLine] => 1.2625
                )

So it seems all your work was not in vain, and it is now working on my end.

I would suggest to the other guys, to go into their /etc/snmp/snmp.conf and comment out the line mibs:
image

NOTE: if you now receive errors: Cannot find module (SNMPv2-MIB): At line 0 in (none) or Cannot adopt OID in UCD-SNMP-MIB: laIndex ::= { laEntry 1 } when running ./validate.php; install the snmp-mibs-downloader package (sudo apt-get install snmp-mibs-downloader).
In my case it downloaded the MIBS, if it doesnā€™t you can manually trigger the update by running sudo download-mibs

The only thing that differs from my previous configuration is the raspberry.sh file, but I now have a feeling that it doesnā€™t really matter. I will check some more later; just had to share the news :smile:

Edit: One more thingā€¦ ( :smiley: pun intended )
The file includes/discovery/sensors/voltage/linux.inc.php contains a typo on line 6:
$sensor_type = "rasbperry_volts";
Should be
$sensor_type = "raspberry_volts";

Donā€™t know if that makes a difference, but I changed it on my end.

1 Like

Jo0Lz you are the man! I followed the initial instructions and updated the script on the raspberry pi. I then edited the /etc/snmp/snmp.conf file as suggested and got the snmp-mibs-downloader package, perfection! Thank you! Additionally, I did not fix the typo in question, it works w/o the correction.

1 Like

Awesome! Glad to hear it. Iā€™ve got two piā€™s running, both with different shell scripts, but the information stays the same it seems. Canā€™t believe this was the issue all along. And Neil even suggested to remove the line, but with everything going on in this thread, I guess itā€™s easily overlooked.

Huzzah!

just to confirm, this fixes it for me too. thanks @Jo0Lz

1 Like

I followed the standard install instructions on Libres page and 3x checked I # out the mib line, yet I am still broken. Is there more yet more work that needs to be done or could someone point me to to a log to look at?

This fixed my issue for Stretch.

./discovery.php -h HOSTNAME -d | ./pbin.sh
./poller.php -h HOSTNAME -r -f -d | ./pbin.sh
snmpbulkwalk -OUneb -v2c -c COMMUNITY HOSTNAME . | ./pbin.sh

Provide this information, letā€™s have a look :slight_smile:

@Jo0Lz Iā€™m good now thank you very much. The main fix for me was this line here.
Debian-snmp ALL=(ALL) NOPASSWD: /etc/snmp/raspberry.sh, /usr/bin/vcgencmd*
Once I added this line to my install everything started working.

1 Like

Ah, great. Didnā€™t know if it was just your stretch install, or all devices :slight_smile:

Iā€™ve seen builds where the vcgencmd wasnā€™t symlinked from /opt/vc/bin/vcgencmd; in which case you have to create it. Maybe the docs can be updated to check that. Most builds still use the snmp account, debian changed it, raspbian too, Ubuntu remains unchanged afaik. Itā€™s case sensitive too, so I expect people to waste some valuable time there :stuck_out_tongue_winking_eye:

Yeahā€¦ I jumped on IRC yesterday and asked if the help guide could be updated to include that line.

you can contribute to the docs if think something needs to be changed.