I'm trying to display my PIs temperatures in a website that I can access anywhere at any time.
So far I've been able to get the CPU and GPU temps working. However my HDD temp won't show in the browser. It works fine in terminal.
Here is a pic:
As you'll notice I didn't have the GPU temp showing either, however this was fixed by using the following command:
sudo usermod -G video www-data
I haven't been successful in getting this to work for smartmoxntools, though.
Does anyone know how to make it work?
Also, is it safe to have these in an external website? Can hackers inject php code to run shell commands using it?
Another possibility is that your hard drive is not supported, or you're using a Virtual Machine. Manage Disks and Volumes does support all hard drives, including SSD drives. Click on the hard drive you want to see the temperature of, and click on Properties.
Manage Disks and Volumes does support all hard drives, including SSD drives. Click on the hard drive you want to see the temperature of, and click on Properties. You can find your current temperature under Drive health .
Sometimes, when your internal or external hard drive connection is loosened, the device will not be able to show up the saved files on your computer. So the best way out is to reconnect the drive and make files show up again. Step 1. Reconnect the internal or external hard drive on your computer. To Reconnect Hard Drive:
Fix HDD Not Showing Up in Disk Management Error. If the HDD fails to show up in the Disk Management on your computer, follow the below tips: 1. Press Win + R keys to bring up Run dialog and type: diskmgmt.msc, hit Enter. 2. Find your HDD hard drive and right-click on it, select Change Drive Letter and Paths.
in order to run some root privileged command in website, you need to put www-data in your /etc/sudoers to allow the www-data to run as root for the command, here is the line you need in /etc/sudoers:
www-data ALL=(root) NOPASSWD: /usr/sbin/smartctl
When executing under your web server, your script will probably have a different PATH
configured, so it will run differently from how it runs in the Terminal.
Try putting the full path to smartctl
in your script, e.g.
sudo /usr/local/bin/smartctl -A -d sat /dev/sda | awk '/^194/ {print $10}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With