NetApp ontap_snapvault discovery - allow empty policy name

CMK version:
2.3.0p28
OS version:
RHEL 9

** Short summary**
For S3 bucket in NetApp there is no protection policy label set.

NetApp documentation: Create a mirror relationship for a new bucket (remote cluster)

There’s a snapmirror policy on both clusters (but only as an existing relation on the destination cluster) but you can’t modify it. The type is automatically “Continuous” and the associated snapmirror label is : “-”.

I think a similar ticket issue is this one: NetApp Ontap Monitoring via special Agent Fails on qtree discovery - Troubleshooting - Checkmk Community

Is it possible to treat this corner case where policy_name is empty?

Error message:

/omd/sites/example/share/check_mk/agents/special/agent_netapp_ontap --pwstore=6@0@/omd/sites/example/var/check_mk/passwords_merged@uuid0ac2cd63-2a61-410f-b50d-76451cc68246 --hostname 1.2.3.4 --username mon --password '*********' --no-cert-check --no-counters volumes
[removed output]
<<<netapp_ontap_snapvault:sep(0)>>>
Agent failed - please submit a crash report! (Crash-ID: 631da0c2-00b1-11f0-952e-005056a8a09e)

Traceback (most recent call last):
  File "/omd/sites/scic/lib/python3/cmk/special_agents/v0_unstable/agent_common.py", line 149, in _special_agent_main_core
    return main_fn(args)
           ^^^^^^^^^^^^^
  File "/omd/sites/scic/lib/python3/cmk/special_agents/agent_netapp_ontap.py", line 929, in agent_netapp_main
    write_sections(connection, logger, args)
  File "/omd/sites/scic/lib/python3/cmk/special_agents/agent_netapp_ontap.py", line 857, in write_sections
    write_section("snapvault", fetch_snapmirror(connection), logger)
  File "/omd/sites/scic/lib/python3/cmk/special_agents/agent_netapp_ontap.py", line 45, in write_section
    for element in generator:
  File "/omd/sites/scic/lib/python3/cmk/special_agents/agent_netapp_ontap.py", line 793, in fetch_snapmirror
    policy_name=element_data["policy"]["name"],
                ~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'policy'

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.