The map resource provides mapping between numerical ids and names for various objects in the system. The resource is accessible via the /map URL, which dumps the whole tree. You can also query a particular branch of the tree.

Two large subtrees are available, /map/name (name-to-id mapping) and the reverse, /map/id (id-to-name mapping). You can drill-down on these branches by using a more specific path (see below).

In addition to these maps, there are subtrees which provide more complex object maps, such /map/service, /map/servicegroup, /map/event and /map/user.

Note: This API is mainly for internal use, but you might also find it useful.


Maps overview:

GETPOST /map The whole map tree
GETPOST /map/id The map-id subtree
GETPOST /map/name The map-name subtree
id-to-name maps
GETPOST /map/id/range Range types list
GETPOST /map/id/servicetype Service types list
GETPOST /map/id/statisticstype Statistics type list
GETPOST /map/id/statetype Service state types list
GETPOST /map/id/action Action types list
GETPOST /map/id/host Host list
GETPOST /map/id/hostgroup Hostgroup list
GETPOST /map/id/hoststatus Host status types list
GETPOST /map/id/hostplatform Host platform list
GETPOST /map/id/hostmachine Host machine list
GETPOST /map/id/servicename Servicename list
name-to-id maps
GETPOST /map/name/range Range types list
GETPOST /map/name/servicetype Service types list
GETPOST /map/name/statisticstype Statistics types list
GETPOST /map/name/statetype Service state types list
GETPOST /map/name/action Action types list
GETPOST /map/name/host Host list
GETPOST /map/name/hostgroup Hostgroup list
GETPOST /map/name/hoststatus Host status types list
GETPOST /map/name/hostplatform Host platform list
GETPOST /map/name/hostmachine Host machine list
Misc maps
GETPOST /map/event Event types
GETPOST /map/user User list
GETPOST /map/user/remote Logged in user as remote-user
GETPOST /map/service Service list
GETPOST /map/servicegroup Service group list

Arguments

none


Example1

Query the id-to-name hosts sub-tree and list all registered hosts

curl -b ~/.mmonit/cookie \
 http://127.0.0.1:8080/map/id/host

Output

{
  "map":{
    "id":{
      "host":{
        "1":"solaris11-x64",
        "5":"debian4-x86",
        "6":"debian4-x64",
        "8":"freebsd80-x86",
        "9":"freebsd80-x64",
        "54213":"netbsd6-x64",
        "13":"tildeslash1",
        "49104":"wordpress"
      }
    }
  }
}


Example2

Query the reverse name-to-id hosts sub-tree

curl -b ~/.mmonit/cookie \
 http://127.0.0.1:8080/map/name/host

Output

{
  "map":{
    "name":{
      "host":{
        "solaris11-x64":"1",
        "debian4-x86":"5",
        "debian4-x64":"6",
        "freebsd80-x86":"8",
        "freebsd80-x64":"9",
        "netbsd6-x64":"54213",
        "tildeslash1":"13",
        "wordpress":"49104"
      }
    }
  }
}