TheHolm / meraki-dashboard-promethus-exporter

Promethus exporter to collect data from Meraki dashboard via API
GNU General Public License v3.0
3 stars 7 forks source link

00 Bad Request, {'errors': ['Site-to-site VPN not enabled in your organization']} when trying to get VPN info from org without VPNs. #4

Open TheHolm opened 1 month ago

TheHolm commented 1 month ago
2024-06-01 23:13:33       meraki:    ERROR > appliance, getOrganizationApplianceVpnStatuses - 400 Bad Request, {'errors': ['Site-to-site VPN not enabled in your organization']}
Exception in thread Thread-5 (get_vpn_statuses):
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File /meraki-dashboard-promethus-exporter/meraki-api-exporter.py", line 25, in get_vpn_statuses
    vpnstatuses.extend(dashboard.appliance.getOrganizationApplianceVpnStatuses(organizationId=organizationId, total_pages="all"))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/meraki-dashboard-promethus-exporter/venv/lib/python3.11/site-packages/meraki/api/appliance.py", line 2635, in getOrganizationApplianceVpnStatuses
    return self._session.get_pages(metadata, resource, params, total_pages, direction)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/meraki-dashboard-promethus-exporter/venv/lib/python3.11/site-packages/meraki/rest_session.py", line 401, in _get_pages_legacy
    response = self.request(metadata, 'GET', url, params=params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/meraki-dashboard-promethus-exporter/venv/lib/python3.11/site-packages/meraki/rest_session.py", line 300, in request
    raise APIError(metadata, response)
meraki.exceptions.APIError: appliance, getOrganizationApplianceVpnStatuses - 400 Bad Request, {'errors': ['Site-to-site VPN not enabled in your organization']}
brngates98 commented 1 month ago

i can resolve this error in the exporter. wish this was commented on the main PR could of resolved then. i am looking at the ability to add some arguments to enable/disable certain metrics(like the vpn information)

TheHolm commented 1 month ago

If you can create another pull request you are most welcome.