Monit HTTPD Documentation seems to be outdated

Issue #713 invalid
James Stocker created an issue

I was trying to understand the HTTP API so I could do some monit control in a Python script (I want to start stop and check status for example), I found the docs to be misleading:

https://mmonit.com/documentation/http-api/Methods/Status

An example snippet says this should work:

curl -b ~/.mmonit/cookie \
 http://127.0.0.1:8080/status/hosts/list

In my case my server is using port 2812, but when I make a request I just get an error (there is no auth):

$ curl http://localhost:2812/status
<html><head><title>404 Not Found</title></head><body bgcolor=#FFFFFF><h2>Not Found</h2>There is no service by that name<p><hr><a href='http://mmonit.com/monit/'><font size=-1>monit 5.6</font></a></body></html>

I managed to find a python script which did (most) of what I wanted (monitor/unmonitor doesn't appear to work):

https://github.com/polymeris/python-monit

$ curl http://localhost:2812/_status

Works fine and returns the expected status output, but I don't see this documented anywhere

I checked the man file and I see notes on how to enable the HTTPD API, but I don't see any usage examples there. Is there anywhere I can go to get this information? I couldn't turn anything else up in my investigation.

Thanks

Comments (6)

  1. Tildeslash repo owner

    The HTTP-API is for M/Monit, which is optional Monit extension (independent application).

    Monit has different API.

  2. James Stocker Account Deactivated reporter

    Thanks, that explains the confusion, can you advise where to find the correct docs?

  3. Tildeslash repo owner

    Monit does not have an official HTTP API yet. It has an internal HTTP API, which is accessible, but not documented other than in the source code. A proper JSON REST API is planned for the next major release of Monit sometime later this year.

  4. Dhananjay Joshi

    Is this document is released as per the above comment ?

    A proper JSON REST API is planned for the next major release of Monit sometime later this year.

  5. Log in to comment