On 22.06.17 13:50, Umar Draz wrote:
I think something bad with Icinga look at that my configuration for https monitor

object Host "mysite <http://mysite.com/>" {
     address = "umardraz.com <http://mysite.com/>"
     check_command = "http"
vars.http_vhosts["wwwumardraz.com:443 <http://www.mysite.com:443/>"] = {
         http_uri = "/"
         http_ssl = "1"
     }
  }

Again: that's a Host object. The service object for http would be generated by the an apply block if you haven't modified it from the original. Without knowing this it's impossible to tell.

That's why I wrote before you should first check with the icinga2 object list command what is really generated from your config.

So please run the list command and post the output to see what's the object is really like.

And also post the service definition which generates the http service objects from the http_vhosts variable...

-Gerald


But in host problems I saw this

connect to address umardraz.com <http://umardraz.com> and port 80: connection refused.
HTTP CRITICAL - Unable to open TCP socket

Why icinga still hitting http?




Regards

On Wed, Jun 21, 2017 at 9:43 AM, Gerald Vogt <v...@spamcop.net <mailto:v...@spamcop.net>> wrote:

    On 21.06.17 03:42, Umar Draz wrote:

        Hello


    Please don't use html to post on public lists. It can get really
    ugly... Use text mode only.

        I want to monitor my website which is basically running with
        only https

        I have tried this

        object Host "mysite.com <http://mysite.com> <http://mysite.com>" {
              address = "mysite.com <http://mysite.com> <http://mysite.com>"
              check_command = "http"
              vars.http_vhosts["www.mysite.com <http://www.mysite.com>
        <http://www.mysite.com>"] = {
              http_uri = "/"
              }
              vars.http_ssl="1"
        }


    Always verify the runtime object generated from your config.

    # icinga2 object list -n 'mysite.com
    <http://mysite.com>!www.mysite.com <http://www.mysite.com>'

    will show you the service object generated from the above config.
    Then you'll see that the service does not have the http_ssl.

    Your "vars.http_ssl" is part of the host object. It does not have
    any meaning there. The host object does not use that variable. So
    put the http_ssl into the http_vhosts object. Each http_vhosts
    generates a separate service, i.e. you can also check https and http
    like this:

    object Host "mysite.com <http://mysite.com>" {
         address = "mysite.com <http://mysite.com>"
         check_command = "http"
         vars.http_vhosts["www.mysite.com:443
    <http://www.mysite.com:443>"] = {
             http_uri = "/"
             http_ssl = "1"
         }
         vars.http_vhosts["www.mysite.com:80
    <http://www.mysite.com:80>"] = {
             http_uri = "/"
         }
    }

        Here is the service warning message

        HTTP WARNING: HTTP/1.1 404 Not Found - 5825 bytes in 0.012
        second response time


    That's what

    # curl -v http://www.mysite.com/

    would show, if you place the http_ssl in the wrong place.

    -Gerald

        If I switch my site to http instead of https then it is working
        fine.

        Would you please help me how I can monitor https url

        Regards


        _______________________________________________
        icinga-users mailing list
        icinga-users@lists.icinga.org <mailto:icinga-users@lists.icinga.org>
        https://lists.icinga.org/mailman/listinfo/icinga-users
        <https://lists.icinga.org/mailman/listinfo/icinga-users>


    _______________________________________________
    icinga-users mailing list
    icinga-users@lists.icinga.org <mailto:icinga-users@lists.icinga.org>
    https://lists.icinga.org/mailman/listinfo/icinga-users
    <https://lists.icinga.org/mailman/listinfo/icinga-users>




_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users


_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to