I got a requirement to monitor URL for example http://testabc.com:8080/dcf .
In general the url requires username and password to go through.
But is there any way to get status code=200 without passing username and password in heartbeat.yml for this URL
@ksunil, I understand not wanting to include the user and pass information. We have the same requirements for several URLs that we monitor with Heartbeat.
You will want to look at configuring the check.response.status option for the URL you need to monitor. This will tell Heartbeat what the expected HTTP status code returned by the endpoint should be when things are "good".
For example, a URL that is secured with a username and password will respond with an HTTP status code of 401 Unauthorized if correct credentials are not provided. 401 would be an expected response for your use case. Thus, using Heartbeat you can define an HTTP monitor that looks something like this:
Using this example, if the URL returns the HTTP status code of 401 then Heartbeat will output the monitor.status of "UP" and all will be well with the world
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.