Changes

From Amahi Wiki
Jump to: navigation, search
676 bytes added ,  03:52, 18 June 2017
[[Category:Apps]]
{{NeedsUpdate}}
== Getting More Info ==
After the one click install of phpsysinfo in Amahi 6 or 7greater, you need to do some modifications to get all system information displayed. 
==Install lm-sensors ==
=== Fedora ===
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 ===
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
optional changes
DEFAULT_LANG="nlen"
LOAD_BAR=true
USE_VHOST=true
=== Configure SMART information ===
Ref: [http://mewbies.com/how_to_install_phpsysinfo_nix_tutorial.html How to install phpSysInfo]
yum install smartmontools
in phpsysinfo::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.ini PLUGINS="SMART"
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:
(source httpBecause 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/mewbieshda/web-apps/phpsysinfo/html/plugins/smart/class.comsmart.inc.php /how_to_install_phpsysinfo_nix_tutorialvar/hda/web-apps/phpsysinfo/html/plugins/smart/class.html)smart.inc.php.bak
Because Now edit 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 usesfollowing file: nano /var/hda/web-apps/phpsysinfo/html/plugins/SMARTsmart/class.SMARTsmart.inc.php
Search for (Ctrl+w) (line 60): --all
It has this:
 :<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.((PSI_PLUGIN_SMART_DEVICE) ? ' --device '.PSI_PLUGIN_SMART_DEVICE : '')$diskdev.' '.$diskdiskname, $buffer, PSI_DEBUG))) {</code> 
Change it to:
if (CommonFunctions::executeProgram('sudo', '/usr/sbin/smartctl --all '.((PSI_PLUGIN_SMART_DEVICE) ? ' --device '.PSI_PLUGIN_SMART_DEVICE : '').' '.$disk, $buffer, PSI_DEBUG)) {
:<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:<br /> :<code>'sudo', '/usr/sbin/smartctl --all '</code> 
Change yours to be the same, including the space: all '
Be sure that line isn't broken into multiple lines. If it is you'll see on your ''xml.php?plugin=SMART '' page errors containing: ''\n''And be sure that <code>smartctl</usr/sbin/smartctl code> is the correct path for your installation of smartctl.
Next we need to add your web server group to ''sudo '' to be able to run <code>smartctl </code> cmds:
sudo visudo
Paste in this line under ''# User privilege specification'', changing yourweb server group (apache) to your own. For example I have pasted in:<br /> :<code>apache ALL=NOPASSWD: /usr/sbin/smartctl '''(WARNING you are using the vi-editor, first google "vi commands" for some guidance!)'''</code>
12,424

edits