Changes

From Amahi Wiki
Jump to: navigation, search
161 bytes added ,  19:43, 24 July 2015
yum install smartmontools
in phpsysinfo.ini(located in ''/var/hda/web-apps/phpsysinfo/html'') <code>PLUGINS="SMART"ADD_PATHS="/usr/sbin,/sbin" 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:
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:
:<code>if ( trim($diskname != "") && (CommonFunctions::executeProgram('sudo', '/usr/sbin/smartctl --all '.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {</code>
Just a note that all we changed was:
<code>'smartctl', '--all'</code>
To:
<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
12,424

edits