#Harvest - Rest LUN add igroup.name to get intiator name

1 messages · Page 1 of 1 (latest)

peak salmon
#

Hi all 🙂
I'd like to add on the rest lun scraping the initiator name available from "api/protocols/san/lun-maps/<LUN_UUID>"
At this point, I havent succeded (creating a custom template or overiding the lun.yaml one).
First question : is it possible ? ^^
If yes, could you guide me to achieve this ?

late kayak
#

@peak salmon For the Rest Collector, only overriding is supported. Please check if the following modified lun.yaml is helpful. Initiator name should come in lun_labels metric with this template.

name:                       Lun
query:                      api/storage/luns
object:                     lun

counters:
  - ^^uuid
  - ^location.node.name     => node
  - ^location.qtree.name    => qtree
  - ^location.volume.name   => volume
  - ^name                   => path
  - ^status.state           => state
  - ^svm.name               => svm
  - space.size              => size
  - space.used              => size_used

endpoints:
  - query: api/protocols/san/lun-maps
    counters:
      - ^^lun.uuid              => uuid
      - ^igroup.initiators      => initiators

plugins:
  - MetricAgent:
      compute_metric:
        - size_used_percent PERCENT size_used size
  - LabelAgent:
      value_to_num:
        - new_status state online online `0`
    # There are two flavors of path names
    # /vol/volName/lunName
    # /vol/volName/lun401/lunName
      split_regex:
        - path `^/[^/]+/([^/]+)(?:/.*?|)/([^/]+)$` volume,lun

export_options:
  instance_keys:
    - lun
    - node
    - qtree
    - svm
    - volume
  instance_labels:
    - state
    - initiators
peak salmon
#

Holly cow !
Thank you very much Rahul, you save me a lot of time !
It's exactly what I was looking for, and it works perfectly 🙂
I thought that the endpoint stanza was dedicated to the private api only.
One stone, two birds : I know now that the endpoint stanza could be use with any api path, and with your help, how I can use it !
Again, thank you !

late kayak
#

Gr8! We'll improve Rest endpoints documentation.

late kayak
peak salmon
#

Great, I hope it will be usefull for many of us ^^

late kayak
peak salmon
#

@late kayak Thanks for the update 🙂
I'm very pleased to see you following each point like this one !
It's a fantastic community 🙂
Keep up your good work !