Meraki Cloud Monitoring

@TLI finaly I had some time to look at the updated Meraki Agent (cmk2.2.0b6):

  1. the key for the org id is not organizationId but id
    → Fixed.

  2. the key ‘organizationId’ is expected by cisco_meraki_org_licenses_overview.py
    Key changed to id → ok. but still not included in the section. This still crashes cisco_meraki_org_licenses_overview.py (send to feedback-2.2-beta@checkmk.com)

  File "/omd/sites/cmk22/lib/python3/cmk/base/plugins/agent_based/cisco_meraki_org_licenses_overview.py", line 49, in _make_item_name
    return f"{row['id']}"

I have added line 296 to the agent, with line 297 I add the org name so this can at least be shown in the details of the licence overview:

293     def _make_section(
294         self, *, name: str, data: MerakiAPIData, piggyback: str | None = None
295     ) -> Section:
296         data['id'] = self.organisation['id_']
297         data['orgname'] = self.organisation['name']
298         return Section(
299             api_data_source=MerakiAPIDataSource.org,
300             name=_SECTION_NAME_MAP[name],
301             data=data,
302             piggyback=piggyback,
303         )
  1. if there are no section to fetch is configured in the agent rule, the agent does nothing. I think by default the agent should fetch all sections.
    → Fixed

  2. the item for the services should not be the org id but the org name in my opinion
    → Don’t work at the moment (see item 2)

  3. not every device has a lanIP
    → Fixed

  4. piggyback data by IP-address
    → changed to device name, OK for me.

  5. cisco_meraki_org_device_info works, but wrong path
    → Address, Product type, Orgid/Name was added :slight_smile: but still in the wrong path (at least in my opinion) :frowning:

  6. cisco_meraki_org_device_status.py section name don’t match
    → Fixed

4 Likes

@TLI I have tstet the Maraki agent with cmk 2.2.0b8

  1. the key ‘organizationId’ is expected by cisco_meraki_org_licenses_overview.py
    → fixed.

  2. the item for the services should not be the org id but the org name in my opinion
    → item has changed to “org_name/org_id” → OK but should be better configurable (discovery rule).

  3. cisco_meraki_org_device_info works, but wrong path
    → fixed

so far what I could test locks OK.

1 Like

Thanks for your support Thomas :slight_smile:

Okay, possible noob question:

I want to monitor a cisco meraki catalyst 9162l

  1. i installed checkmk-raw 2.2.0 via docker
  2. i configured a host using the lan ip of the catalyst
  3. i configured an api key in the cisco meraki wep portal
  4. i added a “other configuration - cisco meraki”, configured the api key and “Sections: Organisation device statuses, Organisation sensor readings”
  5. i rescaned the host services, but i just get this …

The api key is accessed:

What am i doing wrong? Or do i just get a ping test?

You should use the name as in your Meraki environment. The piggiback data don’t come as ip address anymore as not all devices have a lan ip.

In my environment I have created a Host MerakiCloud and attched the Cisco Meraki special agent to this host. With this you sould be able to discover the Cisco Meraki Licenses services of your Meraki Organisation. In the background the agent will discover your devices as pigiback data. For these data I have a created a Dynamic host management rule.

…hi, i try to get checkmk_infos about our cisco/meraki equipment, but i am a bit lost now.
Can you please explain a bit further how to get more infos?
I just get the licencses from our equippment but nothing more.


I tried your suggestion but it doesn’t work - i think i am missing something general.

thx

Oliver

Basically I have 2 objects and 2 rules for Meraki.

  • one dummy host to atach the agent to, in my case MerakiCloud
  • one folder to dynamically create the devices found by the agent (pigyback) in my case /Meraki
  • one rule for the agent (Cisco Meraki), I have only set the API key, leave everything else in the default, attach this rule to your dummy host

  • one rule to deal with the pigiback data (look for Dynamic host management), this will add all new found hosts to my Meraki folder

after a while you should find your Meraki devices in the /Meraki folder. And the sould have at least the Cisco Meraki Devices Status service

If you have your Devices allready created I think you can skip the Dynamic Host Management part. And just rediscover the services of your Meraki devices.

Thats it :slight_smile:

To check if the agent finds your devices you can run the agent on the cli

first check if the agent is correctly attached to your dummy host

OMD[cmk22]:~$ cmk -D MerakiCloud | grep Program
  Program: /omd/sites/cmk22/share/check_mk/agents/special/agent_cisco_meraki MerakiCloud <api-key-removed>
OMD[cmk22]:~$

then run the agent manually, depending on your environment you sould get at least one cisco_meraki_org_licenses_overview section and for each device one host section as pigiback (4x< ) and in each host section one cisco_meraki_org_device_info section

OMD[cmk22]:~$ /omd/sites/cmk22/share/check_mk/agents/special/agent_cisco_meraki MerakiCloud <api-key-removed>
<<<cisco_meraki_org_licenses_overview:sep(0)>>>
<snip>
<<<<your-hostname-1>>>>
<<<cisco_meraki_org_device_info:sep(0)>>>
[{"address": "", "configurationUpdatedAt": "2023-05-02T15:32:34Z", "firmware": "switch-15-21-1", "lanIp": "xx.x.xx.x", "lat": xxxx, "lng": -1xxx, "mac": "xx:xx:xx:xx:xx:xx", "model": "MS120-8", "name": "hostname", "networkId": "L_xxxxxxxxxxxxxxxxxx", "notes": "", "organisation_id": "xxxxxx", "organisation_name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "productType": "switch_meraki", "serial": "xxxx-xxxx-xxxx", "tags": ["Switch"], "url": "https://n437.meraki.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/manage/nodes/new_list/xxxxxxxxxxxxxxx"}]
<<<<>>>>

cmk -d MerakiCloud should also give you this output with all the rest of the cmk agent data.

1 Like

…thanks for the more detailed info, but i think i know the difference: you have probably a checkmk enterprise edition and sadly i have only the raw edition. So some features are missing… :frowning:
We have planned to buy the CEE but that takes time in our company.
So i have only two options: waiting, or manage everything with custom scripts.

thx,

Olli

yes I have.

You mean the Dynamic Host Management. This sould be not a big issue, depending on the number of devices you can create them manually or via REAT-API and you sould be fine. If you do so use the exact same device names in CMK as in the Meraki Dashboard.

Please don’t tell on me on our sales guys ;D
You can leverage the script mentioned in here to automate everything :slight_smile:

2 Likes

Sales guys can read :stuck_out_tongue_winking_eye:

1 Like