I am trying to create a harvest template for doing a 'count' of the number of locks on the filers. I don't want to capture all the locks, there could be thousands of them, but what I want is a count of locks per node.
What we have previously done is use the Netapp_API call and search throught the data. For each record returned, we loop and search for a node list we provide (via another call) and if the node is in the list, we increment the dictionary to increase the number of locks that each node has.
The metric we publish looks like this:
fileserver_locks{filername="nodename"} 58
etc.
We then use this data in prometheus to set alerts that are sent if this number exceeds the total we would LIKE to not see.
Here's what I believe is a starting point for this data, but I know it returns a list of all of the data, not just a count.
name: Locks
query: lock-get-iter
object: lock
collect_only_labels: true
counters:
lock-info:
- ^node
- ^^lockid
I'd guess that this would return node and lock id for each unique value of both, which is NOT what I would like to publish to prometheus.
Thanks,