Changes

From Amahi Wiki
Jump to: navigation, search
2,162 bytes added ,  03:52, 18 June 2017
[[Category:Apps]]==PHP SysInfoGetting 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 SysInfo is ==Install lm-sensors ===== Fedora ===open a php script that displays information about the host being accessed. Things like uptime terminal session and CPU memory are displayed using phpsysinfologin as root or if you have sudo configured use sudo in front of all commands. To run it from your hda:
1. Navigate to type su -at the /var/hda/web-apps directory on prompt enter your hda.root password
2. Search for a phpsysinfo tarball through a web browser. You can find one at then typehttp://phpsysinfo.sourceforge.net/ yum install lm_sensors sensors-detect
3. Download ::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the tarball into the web-apps directory using wget or another methodpackage manager for Fedora 23 and greater. For example:
'''wget http://downloads.sourceforge.net/phpsysinfo/phpSysInfo-3.0-RC6.tar.gz'''=== Ubuntu ===
sudo apt-get install lm-sensors
sudo sensors-detect
4. Unpack the phpsysinfo tarball with the tar command:
'''tar Answer the questions. At the end of sensors-zxvf phpSysInfodetect, Type "yes" to have sensors-3.0detect insert modules into /etc/modules, or edit /etc/modules yourself service module-init-RC6.tar.gz''' tools start
This will create a phpsysinfo directory See [https://help.ubuntu.com/community/SensorInstallHowto#Install_and_Configure_lm-sensors Install and unpack all the filesconfigure lm-sensors] for additional help.
== Configure Settings ==
first make a backup of your original configuration file
5 cd /var/hda/web-apps/phpsysinfo/html cp phpsysinfo. Remove the tarball since it will no longer be needed ini phpsysinfo.inibak
'''rm -rf phpSysInfo-3.0-RC6.tar.gz'''if neccessary
yum install nano
6. Enter the new phpsysinfo directory:: '''cd phpsysinfoNOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.
7. Next, copy modify the php new configuration file to config nano phpsysinfo.php using the cp command: ini
'''cp config.php.new config.php'''optional changes
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 to modify config.php as desired.
'''nano config.php'''For Ubuntu run also sudo dpkg-reconfigure hddtempand set suid to YES
after saving phpsysinfo.ini phpsysinfo will provide voltage, fan, temperature data and more
9. Save and close the config.php file. Go to your hda Web Apps tab in a browser (=== Configure SMART information ===Ref: [http://setup then select Web Apps)mewbies. Click on New Web Appcom/how_to_install_phpsysinfo_nix_tutorial.html How to install phpSysInfo]
10. Enter "phpsysinfo" in the Name field. The Root Path field will automatically append the directory name onto the /var/hda/web-apps directory. yum install smartmontools
11. Click Create. A URL will be created ::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and displayedgreater.
12In phpsysinfo. PHPSysInfo should now be succesfully installed 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 runningchange 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.phpSearch for (Ctrl+w) (line 60): --allIt has this: :<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {</code> Change it to: :<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('sudo', 'smartctl --all '. ' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {</code> Just a note that all we changed was:<br />:<code>'smartctl', '--all'</code>To verify:<br />:<code>'sudo', 'smartctl --all '</code> Change yours to be the same, click on including the URLspace: all 'Be sure that line isn't broken into multiple lines. If it is you are presented with 'll see on your ''xml.php?plugin=SMART'' page errors containing ''\n''And be sure that <code>smartctl</code> is the correct path. Next we need to add your system informationweb server group to ''sudo'' to be able to run <code>smartctl</code> cmds: sudo visudoPaste in this line under ''# User privilege specification'', phpsysinfo has been successfully installedchanging 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