Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been discussed in other threads (https://communities.netapp.com/thread/1405). I have been teaching myself Ruby and have found that no matter how I try to pass arguments to perf-object-get-instances it will always ignore the counters and instances arguements. For instance, when looking at aggregate performance I have been trying to get the API to return on the total_transfers counter on one aggregate. The following snippet will restrict the output to aggr0, but returns all the counters for that aggregate.
aggr_perf = s.invoke("perf-object-get-instances", "objectname", "aggregate", "instances", "aggr0", "counters", "total_transfers")
aggr_perf.child_get("instances").child_get("instance-data").child_get("counters").children_get.each do |counter|
puts counter.child_get_string("name") + " ==> " + counter.child_get_string("value")
end
Perhaps I'm coding this incorrectly?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mathew -
The invoke method doesn't take array inputs. Please use zexplorer for testing and code generation. Also the example perf_operatioin.rb in the SDK code example directory is helpful. In the meantime, the code below should help.
pogi = NaElement.new("perf-object-get-instances");
pogi.child_add_string("objectname", "aggregate");
counters = NaElement.new("counters");
counters.child_add_string("counter", "total_transfers");
pogi.child_add(counters);
instances = NaElement.new("instances");
instances.child_add_string("instance", "aggr0");
Regards,
- Rick -
pogi.child_add(instanes);
aggr_perf = s.invoke_elem(pogi);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rick,
Thanks for your post. It pointed me in the right direction, so I was able to code something in Perl. I wrote it up here: https://communities.netapp.com/thread/24839
It's probably too late for the original poster, but I'm adding this comment in case it helps someone else when they search the web site.
Thanks,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Chris for an excellent post. I will put it in my blog.
Regards,
- Rick -
