Template for Metrocluster Switchover Check #2517
Replies: 5 comments 1 reply
-
That template does not have any metrics defined in the Try adding plugins:
- LabelAgent:
# metric label zapi_value rest_value `default_value`
value_to_num:
- new_result check_result ok ok `0`
collect_only_labels: true
export_options:
instance_keys:
- check_name
instance_labels:
- check_result The permissions problem is probably because you are using the least-privilege approach to permissions? If so, you can add that permission to your harvest or harvest2-role (depending on what you named the role) like this, at the ONTAP CLI.
With those two changes how does your Zapi template work? |
Beta Was this translation helpful? Give feedback.
-
hi @wagneradrian92 excellent! See if this API has what you need. Try something like, replacing $ip, user, and pass curl --silent --insecure --user user:pass 'https://$ip/api/cluster/metrocluster/diagnostics' |
Beta Was this translation helpful? Give feedback.
-
thats the response i get
and this is how my template currently looks like. i am still trying to figure out if theres a way to somehow combine the value_to_num statements so that if every state is ok the value is 1 and otherwise 0.
|
Beta Was this translation helpful? Give feedback.
-
This API seems to be a bit different than other ONTAP APIs in that sometimes you get a response and other times you get an error code I haven't figured out why sometimes there are results and 30 seconds later there is an error. Setting that issue aside for a moment, can you say more about how you would like these metrics exported @wagneradrian92?
Is a REST only solution acceptable? The information returned by the Zapi and Rest APIs are different and Rest's looks more useful. To do the roll-up in #b, we'll need to create a plugin.
|
Beta Was this translation helpful? Give feedback.
-
hey @cgrinds, sure a REST only solution is perfect. As i understand it that metrocluster check is a netapp scheduled job that runs separeted on each side every 30min. if the rest call is done during that check you wont get any metrics or i guess an error then. in my aggr_status i also see the state of the if_status. so i'd say we can go with option a so you dont have to create a plugin just for that one case. thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
hi everyone,
currently i am trying to create a template zapi or rest to get the information from the scheduled metrocluster switchover -simulate task that can be found under api/cluster/metrocluster/diagnostics
but either with zapi or rest i am not able to get the metrics out. here is an example .yaml file for zapi
when i test the object with the following command i get an error that no metrics were found
/bin/harvest start mypoller --foreground --loglevel=2 --collectors Zapi --objects MetroclusterCheck
when i try to get the attributes using the query metrocluster-check-cluster-get-iter i get "request rejected"
API request rejected => Insufficient privileges: user 'harvest' does not have read access to this resource
doing the same using the rest tool to get the metrics from cluster/metrocluster/diagnostics works
now i am a bit clueless on where to start searching. what do i have to adjust or check to make this work?
thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions