binarybear-de / cmk_check_unifi-controller

Local Check for Check_MK to get information about UniFi devices from Controller
21 stars 2 forks source link

Resolution of site descriptions #4

Open binarybear-de opened 3 years ago

binarybear-de commented 3 years ago

Currently the script is online showing the site's "name". Despite being a pretty short name on the demo controller - usually this is some generated id like 5wd3gs so so.

The "real name" of the site is the "description"

Current I haven't found a way to resolve a "name" into the "description".

this site's list looks like this:

{
   "meta":{
      "rc":"ok"
   },
   "data":[
      {
         "_id":"5ff872b4c9e77c00fb57e624",
         "name":"default",
         "desc":"FedExForum",
         "attr_hidden_id":"default",
         "attr_no_delete":true,
         "role":"admin"
      },
      {
         "_id":"5ff872c0c9e77c00fb57e6dc",
         "name":"outlets",
         "desc":"Outlets at Castle Rock",
         "role":"admin"
      },
   ]
}

It's only available in here - not in the json output of all devices if Site $SITE. So some mapping has to be done before jumping in the device-parsing for loop...