Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check a URL with valid HTTPS certificate in monit?

I have the following configuration -

check host qbox_logstash_1
  with address blah.mysite.com
  group qbox
  if failed
    host blah.mysite.com
    port 443
    type TCPSSL
    protocol https
    http headers [ Authorization: Basic dXJiYW5sYWiYW5sBlaHToHideThisAuthMjM= ]
  then alert

It just connects and never checks that the domain has wrong certificate. Why is monit not checking the certificate?

like image 379
Shrinath Avatar asked Jul 10 '15 06:07

Shrinath


People also ask

How do I know if a website has a SSL certificate?

To check an SSL certificate on any website, all you need to do is follow two simple steps. First, check if the URL of the website begins with HTTPS, where S indicates it has an SSL certificate. Second, click on the padlock icon on the address bar to check all the detailed information related to the certificate.

How do I get https certificate?

To obtain an HTTPS certificate, perform the following steps: Create a private and public key pair, and prepare a Certificate Signing Request (CSR), including information about the organization and the public key. Contact a certification authority and request an HTTPS certificate, based on the CSR.

How do I find the SSL certificate for an IP address?

Open the tool: SSL Checker. Enter the URL in the space provided for that purpose and click on the "Check SSL Certificate" button. The tool will process your query and provide the results, including common name, server type, issuer, validity, certificate chaining, and additional certificate details.


1 Answers

You need to include the certificate valid directive:

if failed
  ...
  certificate valid > 10 days
then alert

See the documentation here: https://mmonit.com/monit/documentation/monit.html#CONNECTION-TESTING

like image 169
xtian Avatar answered Sep 30 '22 14:09

xtian