Changes

From Amahi Wiki
Jump to: navigation, search
2,922 bytes added ,  03:52, 18 June 2017
[[Category:Apps]]
 
== Getting More Info ==
After the one click install of phpsysinfo in Amahi 6 or greater, you need to do some modifications to get all system information displayed.
After the one click install of phpsysinfo in Amahi 5.1 I needed to do some modifications to get all system information displayed.For other users, this is what I did.==Install lm-sensors ===== Fedora ===first open a terminal session and login as rootfrom another computerin windows with puttyor if you have sudo configured use sudo in linux: ssh root@hdafront of all commands.
type
su -
at the prompt enter your root password
then type
yum install lm_sensors
sensors-detect
 
::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.
 
=== Ubuntu ===
 
sudo apt-get install lm-sensors
sudo sensors-detect
 
 
Answer the questions. At the end of sensors-detect, Type "yes" to have sensors-detect insert modules into /etc/modules, or edit /etc/modules yourself service module-init-tools start
See [https://help.ubuntu.com/community/SensorInstallHowto#Install_and_Configure_lm-sensorsInstall and configure lm-detectsensors] for additional help.
keep pressing enter for default answers.== Configure Settings ==first make a backup of your original configuration file
cd /var/hda/web-apps/phpsysinfo/html
cp phpsysinfo.ini phpsysinfo.inibak
 
if neccessary
 
yum install nano
 
::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.
 
modify the configuration file
nano phpsysinfo.ini
 
optional changes
 
DEFAULT_LANG="en"
LOAD_BAR=true
USE_VHOST=true
SENSOR_PROGRAM="LMSensors"
HDD_TEMP="command"
HIDE_FS_TYPES="tmpfs,devtmpfs"
 
 
For Ubuntu run also
sudo dpkg-reconfigure hddtemp
and set suid to YES
 
after saving phpsysinfo.ini phpsysinfo will provide voltage, fan, temperature data and more
 
=== Configure SMART information ===
Ref: [http://mewbies.com/how_to_install_phpsysinfo_nix_tutorial.html How to install phpSysInfo]
 
yum install smartmontools
 
::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.
 
In phpsysinfo.ini (located in ''/var/hda/web-apps/phpsysinfo/html'')<br />
:<code>ADD_PATHS="/usr/sbin,/sbin"</code>
:<code>PLUGINS="SMART"</code>
:<code>DEVICES="/dev/sda,/dev/sdb"</code>
 
You also need to change the plugin script and give apache permission to use smartctl with the sudo command:
 
Because the cmd 'smartctl' is only available to root; it will not work for your web server, we need to set some permissions on it and change the command it uses:
First we make a copy of the original
cp /var/hda/web-apps/phpsysinfo/html/plugins/smart/class.smart.inc.php /var/hda/web-apps/phpsysinfo/html/plugins/smart/class.smart.inc.php.bak
 
Now edit the following file:
nano /var/hda/web-apps/phpsysinfo/html/plugins/smart/class.smart.inc.php
Search for (Ctrl+w) (line 60): --all
It has this:
 
:<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {</code>
 
Change it to:
cp config:<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('sudo', 'smartctl --all '.php config' '.php_bak to make a backup of your original config file$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {</code>
nano config.phpJust a note that all we changed was:<br />:<code>'smartctl', '--all'</code>To:<br />:<code>'sudo', 'smartctl --all '</code>
I changed Change yours to be the following linessame, but of course this is optional.define('sensorProgram', 'LMSensorsincluding the space: all ');define(Be sure that line isn'hideMounts', t broken into multiple lines. If it is you'/bootll see on your ');define('hideFstypesxml.php?plugin=SMART', 'tmpfspage errors containing ');define('hddTemp', \n'tcp');define('loadBar', true);And be sure that <code>smartctl</code> is the correct path.
after saving the config.php phpsysinfo also provides voltageNext we need to add your web server group to ''sudo'' to be able to run <code>smartctl</code> cmds: sudo visudoPaste in this line under ''# User privilege specification'', fan and temperature datachanging yourweb server group (apache) to your own.For example I have pasted in:<br />:<code>apache ALL=NOPASSWD: /usr/sbin/smartctl</code>
12,424

edits