Check if instances is empty in Volumes.pm
kukoarmas opened this issue · 1 comments
Very frequently I get the following error and collectd dies:
Can't call method "children_get" on an undefined value at /root/Collectd-Plugins-NetApp//Collectd/Plugins/NetApp/Volume.pm line 175
Apparently I'm getting an empty instances object. To avoid the error when we get an empty $instances, I'm using the following patch:
diff --git a/Collectd/Plugins/NetApp/Volume.pm b/Collectd/Plugins/NetApp/Volume.pm
index c155940..4667722 100644
--- a/Collectd/Plugins/NetApp/Volume.pm
+++ b/Collectd/Plugins/NetApp/Volume.pm
@@ -172,7 +172,7 @@ sub cdot_qos_policy {
my $xo = connect_filer($hostname)->invoke_elem($instance_api);
my $instances = $xo->child_get("instances");
- my @instance_result = $instances->children_get();
- my @instance_result = $instances->children_get() if $instances;
my %vol_values;
Hello,
thanks for your feedback. I fixed the code :-)
👍
I also will fix the Flash.pm stuff, but need to look for that file :)
Regards,
Alex