API results based on IP address

Issue #746 resolved
Prem Kumar created an issue

we are trying to retrieve the results from following Mmonit APIs.

GET POST    /status/hosts/list  Status overview
GET POST    /status/hosts/get   Details for a specific host
GET POST    /status/hosts/summary   Status summary

we are getting the results like below.

{
    "records": [
        {
            "id": 185,
            "led": 1,
          **  "hostname": "myhost",**
            "events": 17,
            "cpu": 5.6,
            "mem": 46.1,
            "status": "6 out of 10 services are available",
            "statusid": 0,
            "heartbeat": 1
        }
    ],
    "totalRecords": 1
}

we are having common hostname for some servers hence this results doesn't help us to differentiate the results based on server. we would like to update our IP address instead of hostname in the results. Let us know how to get this results via API.

Further if we need to update the additional details like Product Name, Location for the server how can we add??

Comments (6)

  1. Tildeslash repo owner

    For IP-address etc, lookup the host-id via the admin/hosts method. You can use the description field for extra data. Fields for location based data etc will be added in a later version

  2. Prem Kumar reporter
    • changed status to open

    Thanks for the information.

    Is there any way to set hostname in "/etc/monitrc" file. so that we can update the hostname what we need.

    If you don't have such option. Please let me know from where hostname will be referred at monit.

  3. Tildeslash repo owner

    you can set custom hostname in the /etc/monitrc via the "check system <name>" statement.

  4. Log in to comment