Hi folks,
I’ve configured several Juniper routers in CheckMK and BGP peer services are discovered nicely. Unfortunately though, the descriptions are not available since this information isn’t available through SNMP. I’ve decided a simple service label like peer-description:SomeDescription would be enough so that the peer would be correctly identified in a notification using $SERVICELABEL_peer-description.
I’m trying to think of a way to automate the population of this label using the checkmk API and (probably) Ansible. I imagine the process running periodically (say once a day) and working as follows:
- Get a list of hosts (generate an Ansible inventory)
- For each host get a list of services
- For each service that is a BGP peering, get the neighbor IP address from the service name
- Lookup the description for the IP address on the host with the following command
show configuration | display set | grep neighbor | grep description | grep 1.1.1.1
- Parse the Description from the result
set protocols bgp group Customers neighbor 1.1.1.1 description “Customer X primary internet transit peering”
- Apply service label to the service:
peer-description:Customer X primary internet transit peering
Thoughts?
I suspect this would be valuable to most checkmk users that have Juniper equipment.
Cheers,
Curtis