NetApp / harvest

Open-metrics endpoint for ONTAP and StorageGRID
https://netapp.github.io/harvest/latest
Apache License 2.0
150 stars 37 forks source link

How to collect metrics for ifgrp status and information? #520

Closed jmg011 closed 2 years ago

jmg011 commented 3 years ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like ifgrp status and MLAG'd ports information metrics

Describe alternatives you've considered Custom Monitor

Additional context N/A

ruanruijuan commented 3 years ago

The ifgrp related ZAPI is net-port-ifgrp-get for a specific ifgrp. The same attributes are also available in net-port-get-iter (for all ports).

jmg011 commented 3 years ago

Thank you, will add this.

ruanruijuan commented 3 years ago

Question was answered. Closing.

jmg011 commented 2 years ago

@ruanruijuan: I built and tested the template but it is not working. Can you take a look?

Template

name: NetIfgrp query: net-port-ifgrp-get object: net_ifgrp

collect_only_labels: true

counters: net-ifgrp-info:

plugins: LabelAgent: value_mapping: status status up 0

export_options: include_all_labels: true

Error from the log file:

{"level":"error","Poller":"poller_name","collector":"Zapi:NetIfgrp","stack":[{"func":"New","line":"35","source":"errors.go"},{"func":"(Client).invoke","line":"422","source":"client.go"},{"func":"(Client).InvokeBatchWithTimers","line":"292","source":"client.go"},{"func":"(Zapi).PollData","line":"367","source":"zapi.go"},{"func":"(task).Run","line":"61","source":"schedule.go"},{"func":"(*AbstractCollector).Start","line":"293","source":"collector.go"},{"func":"goexit","line":"1581","source":"asm_amd64.s"}],"error":"api request rejected => Missing input: ifgrp-name; Missing input: node; Extra input: max-records","task":"data","caller":"goharvest2/cmd/poller/collector/collector.go:340","time":"2021-11-09T10:57:15-08:00"}

When I run zapi command to get the data for the api, I get below error:

(NetApp Release 9.8P4: Mon May 03 09:22:00 UTC 2021) 2021/11/09 11:03:54 api request rejected => Missing input: ifgrp-name; Missing input: node

cgrinds commented 2 years ago

hi @jmg011 net-port-ifgrp-get won't work without some code changes since that ZAPI is not a -get-iter ZAPI. For the most part, Harvest config ZAPIs only work with the -get-iter ZAPIs.

Let's see if we can get what you need from net-port-get-iter.

jmg011 commented 2 years ago

@cgrinds Thank you. I have actually the template for net-port-get-iter. With ifgrp-get, I was trying to get up and down ports for ifgrps.

name: NetPort query: net-port-get-iter object: net_port

counters: net-port-info:

plugins: LabelAgent: value_mapping: status status up 0

export_options: include_all_labels: true

cgrinds commented 2 years ago

@jmg011 excellent! that means you have what you need. net-port-get returns exactly the same info as net-port-get-iter. I verified this by diffing the two.

We just need to figure out which counter, from what you pasted above, has what you want. Is it link-status?

jmg011 commented 2 years ago

yes, it is link-status => status. I summed it with ifgrp, status and port. I can work with this. Thanks for looking into this.

image