MMonit url monitoring with authentication
Hello,
I would like to monitor the main mmonit page https://mmonit.mydomain.com:8443/index.csp once authenticated with user/pass.
I tried the following:
check host url_mmonit with address mmonit.mydomain.com
if failed port 8443 type tcp protocol https
username "monit" password "mmonit"
request "/index.csp"
content = "Latest status"
with ssl options {selfsigned: allow} then alert
I get the following error:
error : 'url_mmonit' failed protocol test [HTTP] at [slp-mon01.ajrubi.intern]:8443/index.csp [TCP/IP TLS] -- HTTP error: Regular expression doesn't match: No match
which has no much sense, because “Latest Status” exists in the main page.
Could you help me?
How to debug this in an easy way to find the correct monit syntax ? I mean that trial and error in the host section is a bit slower and I have no clues what is wrong.
Thanks a lot.
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
reporter Thanks a lot!!!
We will take a look at it.
- Log in to comment
Hello,
M/Monit uses Form authentication for the GUI access: https://mmonit.com/documentation/http-api/Authentication
The monit http protocol test username+password can be used for Basic authentication (different method), which can be used for example to test the M/Monit collector, but not the GUI access.
You can test M/Monit GUI login using custom “check program”, see here for more details: https://mmonit.com/documentation/http-api/Examples/cURL