Changes

From Amahi Wiki
Jump to: navigation, search
1,335 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 type su -at the host being accessed. Things like uptime and CPU memory are displayed using phpsysinfo. To run it from prompt enter your hda: root password
1. Navigate to the /var/hda/webthen type yum install lm_sensors sensors-apps directory on your hda.detect
2. Search for a phpsysinfo tarball through a web browser. You can find one at http::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</phpsysinfo.sourceforgecode> as the package manager for Fedora 23 and greater.net/
3. Download the tarball into the web-apps directory using wget or another method. For example: === Ubuntu ===
'''wget http://downloads.sourceforge.net/phpsysinfo/phpSysInfo sudo apt-3.0get install lm-RC6.tar.gz'''sensors sudo sensors-detect
4Answer the questions. Unpack the phpsysinfo tarball with At the tar command: 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
'''tar See [https://help.ubuntu.com/community/SensorInstallHowto#Install_and_Configure_lm-zxvf phpSysInfosensors Install and configure lm-3.0-RC6.tarsensors] for additional help.gz'''
This will create == Configure Settings ==first make a phpsysinfo directory and unpack all the files.backup of your original configuration file
cd /var/hda/web-apps/phpsysinfo/html
cp phpsysinfo.ini phpsysinfo.inibak
5. Remove the tarball since it will no longer be needed if neccessary
'''rm -rf phpSysInfo-3.0-RC6.tar.gz''' yum install nano
::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.
6. Enter modify the new configuration file nano phpsysinfo directory: '''cd phpsysinfo'''.ini
7. Next, copy the php new configuration file to config.php using the cp command: optional changes
'''cp config.php.new config.php''' DEFAULT_LANG="en" LOAD_BAR=true USE_VHOST=true SENSOR_PROGRAM="LMSensors" HDD_TEMP="command" HIDE_FS_TYPES="tmpfs,devtmpfs"
8. Use nano or another editor For Ubuntu run also sudo dpkg-reconfigure hddtempand set suid to modify config.php as desired. YES
'''nano configafter saving phpsysinfo.php'''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]
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. yum install smartmontools
10. Enter "phpsysinfo" in the Name field. The Root Path field will automatically append the directory name onto the ::'''NOTE:''' <code>yum</varcode> (deprecated) has been replaced with <code>dnf</hda/web-apps directorycode> as the package manager for Fedora 23 and greater.
11. Click Create. A URL will be created and displayedIn 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>
12. PHPSysInfo should now be succesfully installed You also need to change the plugin script and running. To verify, click on give apache permission to use smartctl with the URL. If you are presented with your system information, phpsysinfo has been successfully installed.sudo command:
== Getting More Info ==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
After Now edit the one click install of following file: nano /var/hda/web-apps/phpsysinfo I needed to do some modifications to get /html/plugins/smart/class.smart.inc.phpSearch for (Ctrl+w) (line 60): --all system information displayed.For other users, It has this is what I did.:
first open a terminal session and login as rootfrom another computerin windows with puttyor in linux: ssh root@hda<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {</code>
typesensors-detectkeep pressing enter for default answers.Change it to:
cd /var/hda/web:<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('sudo', 'smartctl --apps/phpsysinfo/htmlcp configall '.' '.php config$diskdev.php_baknano config' '.php$diskname, $buffer, PSI_DEBUG))) {</code>
I Just a note that all we changed the following lines, but of course this is optional.was:<br />define(:<code>'sensorProgramsmartctl', 'lmsensors--all');</code>define('hideMounts', 'To:<br /boot');>define(:<code>'hideFstypessudo', 'tmpfssmartctl --all ');define('hddTemp', 'suid');</code>
I also tried Change yours to set "define(be the same, including the space: all 'loadBarBe sure that line isn', true);" but this did not work t broken into multiple lines. If it is you'll see on my sytemyour ''xml.php?plugin=SMART'' page errors containing ''\n''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