App health check monitoring url on a specfic port

Hello,

I want to add a web monitoring check for an application health check to see if its up and responding ex:
https://pl-bnaaeraap402.dcasolutions.com:8443

Please let me know if following code would be correct in hosts.conf

vars.vhosts[“http pl-bnaaeraap402.dcasolutions.com:8443”] = {
http_vhost = “pl-bnaaeraap402.dcasolutions.com
http_address = “IP address of the host”
port = “8443”
http_ssl = true
http_sni = true

and services.conf:

apply Service for (vhost => config in host.vars.vhosts) {
import “generic-service”

    check_command = "http"

    vars += config

}

Actually the full url which I need to monitor is

pl-bnaaeraap402.dcasolutions.com:8443/workflow-manager

I added following code in hosts.conf:
vars.vhosts[“http pl-bnaaeraap402.dcasolutions.com:8443”] = {
http_vhost = “pl-bnaaeraap402.dcasolutions.com
http_address = “10.162.8.46”
http_uri = “/workflow-manager”
port = “8443”
http_uri = “/workflow-manager”
http_ssl = true
http_sni = true

/usr/lib64/nagios/plugins/check_http -H pl-bnaaeraap402.dcasolutions.com -S -p 8443 -u /workflow-manager
HTTP OK: HTTP/1.1 302 Found - 148 bytes in 0.017 second response time |time=0.016765s;;;0.000000 size=148B;;;0

when I run the check manually, its fine with 302 but when I add the same in icinga, I see it failing with connection refused on 443.

Its looking for default port 443 even when I parse it to 8443. Please advise what I might be missing here.

Hi,

the parameter for the port is http_port so try to change port = "8443" to http_port = 8443.
For all available parameters check the http docs.

PS: Please format your post with markdown to make it better readable (howto).

Greetz

Thanks, works fine now!!!