:<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 your
web server group (apache) to your own. For example I have pasted in:<br />
:<code>apache ALL=NOPASSWD: /usr/sbin/smartctl</code>