check_http for certificate expiry, with apache vhosts

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

check_http for certificate expiry, with apache vhosts

Post by kernow5000 »

Hi all,

This isn't a major one, but I imagine it's possibly due to the default virtual host on the webserver I'm checking.

I can run:

Code: Select all

./check_http -4 --ssl -H www.domain1.co.uk -C 70
WARNING - Certificate '*.domain1.co.uk' expires in 60 day(s) (2017-04-10 09:30 +0100/BST).
Ok, cool, that's fine. Now to check domain2 which is another SSL name based virtual host on the same box.

Code: Select all

./check_http -4 -S -H www.domain2.co.uk -C 60,30 -t 30
WARNING - Certificate '*.domain1.co.uk' expires in 60 day(s) (2017-04-10 09:30 +0100/BST).

See my issue?

:)


Cheers.
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: check_http for certificate expiry, with apache vhosts

Post by kernow5000 »

Just realised the command line arguments are actually different in that code block above. But either does the same thing.
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: check_http for certificate expiry, with apache vhosts

Post by kernow5000 »

External SSL scanners are able to identify the domain2.co.uk certificate fine.
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: check_http for certificate expiry, with apache vhosts

Post by kernow5000 »

Never mind! sorted, just needed to add --sni to the check and it returns fine.

Found here: https://support.nagios.com/forum/viewto ... 1486395689

Thanks anyway!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_http for certificate expiry, with apache vhosts

Post by rkennedy »

Our day just started and finally getting to the bottom of the queue, just saw this. Glad to hear you got it working with --sni already! :)

Are we good to close this one up?
Former Nagios Employee
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: check_http for certificate expiry, with apache vhosts

Post by kernow5000 »

Sure , go for it.

Many thanks
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_http for certificate expiry, with apache vhosts

Post by rkennedy »

NP.

/closed
Former Nagios Employee
Locked