Raspberry PI - Temperature, Voltage , Freq

Sorry folks but I’ve done my best with this, it’s working for me with the data provided. Not sure I can help any further.

Understood. BTW, what changed recently? It was working before, but the recent updates seem to have broken it … :-(.

More than happy to help here, but I’m nowhere near an expert at the LibreNMS code. The script output makes sense, but I’m lost after it goes in to the LibreNMS engine.

It wasn’t working before, the raspberry pi image itself has changed and no longer had a string in we used to detect things.

Ahh, gotcha - didn’t realize they broke things here … :-(.

FYI, I just checked the script output - and I do see the voltages and frequencies in there. So is it really on the RPi image side of things (where the issue is)?

Thanks!

Laf,

Just curious, what was the string used for detection? Also, if you want a Raspberry pi to connect to and play with I can stand one up for you and give you access. Let me know.

What does this mean? I have the extend line on the pi’s for running the raspberry.sh script. Does this need to change?
I feel that with the deprecated manual, and the recent changes, we are missing something that was changed on your end but not on ours.

Like before I can give you access to my LibreNMS, I have two PI’s connected you can test with…

Fix: https://github.com/librenms/librenms/pull/7144

1 Like

Works now - thanks!!!

Weird. I still see only CPU temp on both my PI’s.

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