NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
bozolino1
Apr 03, 2011Aspirant
NasMonitor: PHPSysInfo problem
I've just installed the latest NasMonitor (3.6.00) on my Ultra 6
- now PHPSysInfo behaves strangely:
upon bringing up the interface, i get about a dozen JavaScript pop-up messages with the content "--undefined--".
when the interface finally loads, there's a message in the top right corner stating:
Error Loading XML Document for Plugin SMART
How do I solve this?
- now PHPSysInfo behaves strangely:
upon bringing up the interface, i get about a dozen JavaScript pop-up messages with the content "--undefined--".
when the interface finally loads, there's a message in the top right corner stating:
Error Loading XML Document for Plugin SMART
How do I solve this?
6 Replies
Replies have been turned off for this discussion
- TechZ1Aspirant
bozolino wrote: I've just installed the latest NasMonitor (3.6.00) on my Ultra 6
- now PHPSysInfo behaves strangely:
upon bringing up the interface, i get about a dozen JavaScript pop-up messages with the content "--undefined--".
when the interface finally loads, there's a message in the top right corner stating:
Error Loading XML Document for Plugin SMART
How do I solve this?
What kind of Hard Disks (model) do you use in your Ultra 6?
*edit* Just updated mine to 3.6.00, same error.
In addition LoadAvg gives me the following error:Warning: Division by zero in /c/webroot/loadavg/calculations.php on line 250
Warning: Division by zero in /c/webroot/loadavg/calculations.php on line 701 - super_poussinVirtuoso3.6.10 should help
- TechZ1AspirantI doubt this is fixable by you s-p, but I noticed loadavg just cannot deal with gigE throughput, it can only show a max of 100mbit type speeds. The latest version of the NASMon (for PRO) uses v1.5 of loadavg, perhaps the newer versions can accurately read gigE speeds. *edit* Apparently v1.5 is the latest...
receive rate
High (1:54pm): 11,709.7 KB/s
Low (4:12am): 0.1 KB/s
Mean: 162.8 KB/s
Latest: 0.1 KB/s
Today's estimate: 13.4 GB
^ I know for a fact I was pushing over 40MB/s at that time, and beyond those speeds in earlier tests.
3.6.10 isn't linked in the addon thread, so I'm assuming you're working on it ;) - Vegas1AspirantHello,
Im using Readynas Ultra 4 plus and got the same problem. My phpSysinfo version is 3.6.11 and radiator 4.2.19. Both the RAID and SMART reporting isnt working.
Im using four WDC WD1003FBYX-01Y7B0 disks.
Thanks
Vegas - szimonekAspirantHello,
This problem is caused by MDStatus plugin to phpsysinfo and is relatively easy to fix. Problem is that, function addAttribute($name, $value) at /c/webroot/loadavg/phpsysinfo/includes/xml/class.SimpleXMLExtended.inc.php cannot add attribute with empty string as attribute value and such attribute is not added to result XML. No attribute or wrong value, show all that "undefined" warnings when page is generated. The reason why that value is empty, is in function _toUTF8($str) in the same class, which trims input string before conversion to UTF8:
private function _toUTF8($str)
{
if ($this->_encoding != null) {
$enclist = mb_list_encodings();
if (in_array($this->_encoding, $enclist)) {
return mb_convert_encoding(trim($str), 'UTF-8', $this->_encoding);
}
else if (function_exists("iconv")) {
return iconv($this->_encoding, 'UTF-8', trim($str));
}
else {
return mb_convert_encoding(trim($str), 'UTF-8');
}
} else {
return mb_convert_encoding(trim($str), 'UTF-8');
}
}
public function addAttribute($name, $value)
{
$nameUtf8 = $this->_toUTF8($name);
$valueUtf8 = htmlspecialchars($this->_toUTF8($value));
$this->_SimpleXmlElement->addAttribute($nameUtf8, $valueUtf8);
}
Now what attribute, what value you ask? Every disk in RAID array has status parameter. But in data source file for plugin (/proc/mdstat) this parameter is empty when disk is OK (F when Failed, S when Spare). So plugin gets status of disk, and cannot add it as attribute to result XML element.
Solution is to change disk status value to "_" (as "Disk OK" status) instead of " " which will generate correct attribute.
One need to edit two files:
- plugin class in /c/webroot/loadavg/phpsysinfo/plugins/MDStatus/class.MDStatus.inc.php and change line:$this->_result['devices'][$dev]['partitions'][$partition[1]]['status'] = " ";
to:$this->_result['devices'][$dev]['partitions'][$partition[1]]['status'] = "_";
- js plugin file /c/webroot/loadavg/phpsysinfo/plugins/MDStatus/js/MDStatus.js to add in function mdstatus_diskicon(xml) new line after line 'case "":'
case " ":
case "":
to:
case " ":
case "":
case "_":
Now MDStatus plugin and phpsysinfo, works like a charm again.
It took me two hours, but it was fun to recall my php knowledge. Happy hacking :-)
Best regards.
Szymon - Vegas1AspirantThank you I'll give this a shot. :)
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!