Hi. Just wonder way u still can set cpu temp to "C" "F" and "K" when it does not show??
What is not showing? The CPU temp on your status box in the admin web page, or the options to change the CPU temperature units on the admin web page (settings > API/Web Interface)?
If you want to change this from the Linux command line, the options are as follows for the pihole
command (reference pihole -a -h
):
-a, admin [options]
(Admin options):
...
-c, celsius Set Celsius as preferred temperature unit
-f, fahrenheit Set Fahrenheit as preferred temperature unit
-k, kelvin Set Kelvin as preferred temperature unit
...
Oh sorry I forgot to say where ;(
Its on the main page in the upper left corner where the load is and memory usage
I know they took away it but way is it still an option ?
The feature is still implemented, but if the web interface can't find the temperature, it does not show it.
Ok see what i can do
Where can i go in and change the header. ??
If you really want to, you can modify it at /var/www/html/admin/scripts/pi-hole/php/header.php
. This will not be persisted across updates.
i dont have this in my pihole...its different
if(file_exists("/sys/class/thermal/thermal_zone0/temp"))
{
$output = rtrim(file_get_contents("/sys/class/thermal/thermal_zone0/temp"));
}
elseif (file_exists("/sys/class/hwmon/hwmon0/temp1_input"))
{
$output = rtrim(file_get_contents("/sys/class/hwmon/hwmon0/temp1_input"));
}
I have this
pihole@pihole:/sys/class/thermal$ ls
cooling_device0 cooling_device1
pihole@pihole:/sys/class/thermal$
I got this when I changed to other setting:
But I dont think the temp is 14!!
I had a similar issue. Temp file /sys/class/thermal/thermal_zone0/temp exists but gave a value of 1 meaning that it was filtered later in the headers.php file. Having the file check as successful is not enough of a check on the nested IF, it also needs to check for a valid value as well. Without checking the value the nested IF didnt test other files or hit the ELSE statement. No temperature was visible.
I am running a raspberry pi 1B running TCL - tiny core linux with the latest pihole as of last week.
My workaround is stinky as it requires a permission mod, its also usercase specific but I will share anyway in case it helps others botch their pihole into displaying temperature...
I allowed www-data permissions for the video group to allow it access to a exec() bash command and got the temperature that way. sudo usermod -aG video www-data
Reboot required to take effect.
I replaced lines 21 to 32 in header.php with the following code...
exec("vcgencmd measure_temp",$strData,$o);
$strData = preg_replace("([[:punct:]]|[[:alpha:]]| )",'',$strData[0]);
$intData = (int)$strData/10; // measured in milli-degrees later
$output = $intData;
I got it this time
Needed to change in php to this:
ยดยดยด
// Try to get temperature value from different places (OS dependent)
if(file_exists("/sys/class/thermal/cooling_device0/temp"))
{
$output = rtrim(file_get_contents("/sys/class/thermal/cooling_device0/t$
}
elseif (file_exists("/sys/class/hwmon/hwmon0/temp2_input"))
{
$output = rtrim(file_get_contents("/sys/class/hwmon/hwmon0/temp2_input"$
}
else
{
$output = "";
ยดยดยด