Changes

From Amahi Wiki
Jump to: navigation, search
1,305 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.
==PHP SysInfoInstall lm-sensors ===== Fedora ===open a terminal session and login as root or if you have sudo configured use sudo in front of all commands.
PHP SysInfo is a php script that displays information about the host being accessed. Things like uptime and CPU memory are displayed using phpsysinfo. To run it from your hda: type1. Navigate to the /var/hda/web su -apps directory on your hda. 2. Search for a phpsysinfo tarball through a web browser. You can find one at http://phpsysinfo.sourceforge.net/ 3. Download the tarball into the web-apps directory using wget or another method. For example:  '''wget http://downloads.sourceforge.net/phpsysinfo/phpSysInfo-3.0-RC6.tar.gz'''prompt enter your root password
then type
yum install lm_sensors
sensors-detect
4. Unpack the phpsysinfo tarball ::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the tar command: package manager for Fedora 23 and greater.
'''tar -zxvf phpSysInfo-3.0-RC6.tar.gz''' === Ubuntu ===
This will create a phpsysinfo directory and unpack all the files. sudo apt-get install lm-sensors sudo sensors-detect
5Answer the questions. Remove At the tarball since it will no longer be needed 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
'''rm See [https://help.ubuntu.com/community/SensorInstallHowto#Install_and_Configure_lm-rf phpSysInfosensors Install and configure lm-3.0-RC6.tarsensors] for additional help.gz'''
== Configure Settings ==
first make a backup of your original configuration file
6 cd /var/hda/web-apps/phpsysinfo/html cp phpsysinfo. Enter the new ini phpsysinfo directory: '''cd phpsysinfo'''.inibak
7. Next, copy the php new configuration file to config.php using the cp command: if neccessary
'''cp config.php.new config.php''' yum install nano
::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.
8. Use modify the configuration file nano or another editor to modify configphpsysinfo.php as desired. ini
'''nano config.php'''optional changes
DEFAULT_LANG="en"
LOAD_BAR=true
USE_VHOST=true
SENSOR_PROGRAM="LMSensors"
HDD_TEMP="command"
HIDE_FS_TYPES="tmpfs,devtmpfs"
9. Save and close the config.php file. Go to your hda Web Apps tab in a browser (http://setup then select Web Apps). Click on New Web App.
10. Enter "phpsysinfo" in the Name field. The Root Path field will automatically append the directory name onto the /var/hda/webFor Ubuntu run also sudo dpkg-apps directory.reconfigure hddtempand set suid to YES
11after saving phpsysinfo. Click Create. A URL ini phpsysinfo will be created provide voltage, fan, temperature data and displayed.more
12. PHPSysInfo should now be succesfully installed and running. To verify, click on the URL=== Configure SMART information ===Ref: [http://mewbies. If you are presented with your system information, phpsysinfo has been successfully installedcom/how_to_install_phpsysinfo_nix_tutorial.html How to install phpSysInfo]
== Getting More Info == yum install smartmontools
After ::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as 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 didpackage manager for Fedora 23 and greater.
first open a terminal session and login as rootIn phpsysinfo.ini (located in ''/var/hda/web-apps/phpsysinfo/html'')<br />from another computer:<code>ADD_PATHS="/usr/sbin,/sbin"</code>in windows with putty:<code>PLUGINS="SMART"</code>or in linux: ssh root@hda<code>DEVICES="/dev/sda,/dev/sdb"</code>
typeYou also need to change the plugin script and give apache permission to use smartctl with the sudo command:
yum install lm_sensorsBecause 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
sensorsNow edit the following file: nano /var/hda/web-detectapps/phpsysinfo/html/plugins/smart/class.smart.inc.phpSearch for (Ctrl+w) (line 60): --allIt has this:
keep pressing enter for default answers:<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {</code>
cd /var/hda/web-apps/phpsysinfo/htmlChange 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