[Monit± Protocol test on high port returns 404 even if website is present

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Monit± Protocol test on high port returns 404 even if website is present

shadow
Hello Monit community,

I ran into a monit error, which I can't solve by documentation or bymyself.

I try to monitor a website on a high port with monit. The site is up and
running, but monit says it's not reachable.

Monit Config
>   check host jabber-register-website with address website.com
>     if failed
>        port 5281
>        protocol https
>        request "/register_web"
>        for 2 times within 3 cycles
>     then alert


Error Message:
> 'jabber-register-website' failed protocol test [HTTP] at [website.com]:5281/register_web [TCP/IP TLS] -- HTTP error: Server returned status 404


When I curl the website:

> [14:43:45] foo@monitoring:~ $ curl https://website.com:5281/register_web           
> <!DOCTYPE html>
> <html>
> <head>
>     <meta charset="utf-8">
>     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
>     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>

What am I doing wrong?

Thanks for your help?


--
best regards | viele Gruesse, [hidden email]

receive my key:
gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

Tino Hendricks
Hi,

knowing fairly nothing about jabber and register I remember a similar case where we had to add the type like

if failed port 8443 type tcpSSL protocol http with timeout 20 seconds…

Maybe you’d give it a try?

Best,

Tino


> Am 31.05.2017 um 15:00 schrieb shadow <[hidden email]>:
>
> Hello Monit community,
>
> I ran into a monit error, which I can't solve by documentation or bymyself.
>
> I try to monitor a website on a high port with monit. The site is up and
> running, but monit says it's not reachable.
>
> Monit Config
>>  check host jabber-register-website with address website.com
>>    if failed
>>       port 5281
>>       protocol https
>>       request "/register_web"
>>       for 2 times within 3 cycles
>>    then alert
>
>
> Error Message:
>> 'jabber-register-website' failed protocol test [HTTP] at [website.com]:5281/register_web [TCP/IP TLS] -- HTTP error: Server returned status 404
>
>
> When I curl the website:
>
>> [14:43:45] foo@monitoring:~ $ curl https://website.com:5281/register_web
>> <!DOCTYPE html>
>> <html>
>> <head>
>>    <meta charset="utf-8">
>>    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
>>    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>
>
> What am I doing wrong?
>
> Thanks for your help?
>
>
> --
> best regards | viele Gruesse, [hidden email]
>
> receive my key:
> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

signature.asc (506 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

martinp@tildeslash.com
In reply to this post by shadow
Hello,

which Monit version it is? (CLI: monit -V)

If you use hostname-based virtual server with SSL, Monit >= 5.13.0 is required for SSL SNI support.

The host in the "address" show match the name of the virtual server - you can also override it by adding the "host" option explicitly to the test:

   if failed
      port 5281
      protocol https
      host "website.com"   # <---- sets the host header
      request "/register_web"
      for 2 times within 3 cycles
   then alert

Best regards,
Martin


> On 31 May 2017, at 15:00, shadow <[hidden email]> wrote:
>
> Hello Monit community,
>
> I ran into a monit error, which I can't solve by documentation or bymyself.
>
> I try to monitor a website on a high port with monit. The site is up and
> running, but monit says it's not reachable.
>
> Monit Config
>>  check host jabber-register-website with address website.com
>>    if failed
>>       port 5281
>>       protocol https
>>       request "/register_web"
>>       for 2 times within 3 cycles
>>    then alert
>
>
> Error Message:
>> 'jabber-register-website' failed protocol test [HTTP] at [website.com]:5281/register_web [TCP/IP TLS] -- HTTP error: Server returned status 404
>
>
> When I curl the website:
>
>> [14:43:45] foo@monitoring:~ $ curl https://website.com:5281/register_web           
>> <!DOCTYPE html>
>> <html>
>> <head>
>>    <meta charset="utf-8">
>>    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
>>    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>
>
> What am I doing wrong?
>
> Thanks for your help?
>
>
> --
> best regards | viele Gruesse, [hidden email]
>
> receive my key:
> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

shadow
In reply to this post by Tino Hendricks
Hello Tino,

>   check host jabber-register-website with address jabber.systemli.org
>     if failed
>        port 5281
>        type tcpSSL
>        protocol http
>        request "/register_web"
>        for 2 times within 3 cycles
>     then alert

or this


>   check host jabber-register-website with address jabber.systemli.org
>     if failed
>        port 5281
>        type tcpSSL
>        protocol https
>        request "/register_web"
>        for 2 times within 3 cycles
>     then alert

ends up in the same error. But thanks for the hint



On 31.05.2017 15:07, Tino Hendricks wrote:

> Hi,
>
> knowing fairly nothing about jabber and register I remember a similar case where we had to add the type like
>
> if failed port 8443 type tcpSSL protocol http with timeout 20 seconds…
>
> Maybe you’d give it a try?
>
> Best,
>
> Tino
>
>
>> Am 31.05.2017 um 15:00 schrieb shadow <[hidden email]>:
>>
>> Hello Monit community,
>>
>> I ran into a monit error, which I can't solve by documentation or bymyself.
>>
>> I try to monitor a website on a high port with monit. The site is up and
>> running, but monit says it's not reachable.
>>
>> Monit Config
>>>  check host jabber-register-website with address website.com
>>>    if failed
>>>       port 5281
>>>       protocol https
>>>       request "/register_web"
>>>       for 2 times within 3 cycles
>>>    then alert
>>
>>
>> Error Message:
>>> 'jabber-register-website' failed protocol test [HTTP] at [website.com]:5281/register_web [TCP/IP TLS] -- HTTP error: Server returned status 404
>>
>>
>> When I curl the website:
>>
>>> [14:43:45] foo@monitoring:~ $ curl https://website.com:5281/register_web
>>> <!DOCTYPE html>
>>> <html>
>>> <head>
>>>    <meta charset="utf-8">
>>>    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
>>>    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>
>>
>> What am I doing wrong?
>>
>> Thanks for your help?
>>
>>
>> --
>> best regards | viele Gruesse, [hidden email]
>>
>> receive my key:
>> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>>
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
best regards | viele Gruesse, [hidden email]

receive my key:
gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

shadow
In reply to this post by martinp@tildeslash.com
Hello Martin,

I'm running on

>  monit -V
> This is Monit version 5.22.0
As far as I know, the hostname matches the virtual server name.

It is possible to curl it such as:

> curl https://jabber.systemli.org:5281/register_web

cheers shadow

On 31.05.2017 15:13, Martin Pala wrote:

> Hello,
>
> which Monit version it is? (CLI: monit -V)
>
> If you use hostname-based virtual server with SSL, Monit >= 5.13.0 is required for SSL SNI support.
>
> The host in the "address" show match the name of the virtual server - you can also override it by adding the "host" option explicitly to the test:
>
>    if failed
>       port 5281
>       protocol https
>       host "website.com"   # <---- sets the host header
>       request "/register_web"
>       for 2 times within 3 cycles
>    then alert
>
> Best regards,
> Martin
>
>
>> On 31 May 2017, at 15:00, shadow <[hidden email]> wrote:
>>
>> Hello Monit community,
>>
>> I ran into a monit error, which I can't solve by documentation or bymyself.
>>
>> I try to monitor a website on a high port with monit. The site is up and
>> running, but monit says it's not reachable.
>>
>> Monit Config
>>>  check host jabber-register-website with address website.com
>>>    if failed
>>>       port 5281
>>>       protocol https
>>>       request "/register_web"
>>>       for 2 times within 3 cycles
>>>    then alert
>>
>>
>> Error Message:
>>> 'jabber-register-website' failed protocol test [HTTP] at [website.com]:5281/register_web [TCP/IP TLS] -- HTTP error: Server returned status 404
>>
>>
>> When I curl the website:
>>
>>> [14:43:45] foo@monitoring:~ $ curl https://website.com:5281/register_web           
>>> <!DOCTYPE html>
>>> <html>
>>> <head>
>>>    <meta charset="utf-8">
>>>    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
>>>    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>
>>
>> What am I doing wrong?
>>
>> Thanks for your help?
>>
>>
>> --
>> best regards | viele Gruesse, [hidden email]
>>
>> receive my key:
>> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>>
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
best regards | viele Gruesse, [hidden email]

receive my key:
gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

martinp@tildeslash.com
The server jabber.systemli.org rejects HEAD method requests for the given URL with 404 (monit uses HEAD by default to reduce traffic).

The following configuration works fine (switching method to GET):

check host jabber-register-website with address jabber.systemli.org
   if failed
      port 5281
      protocol https
      method GET
      request "/register_web"
      for 2 times within 3 cycles
   then alert

Best regards,
martin


> On 31 May 2017, at 15:32, shadow <[hidden email]> wrote:
>
> Hello Martin,
>
> I'm running on
>
>> monit -V
>> This is Monit version 5.22.0
> As far as I know, the hostname matches the virtual server name.
>
> It is possible to curl it such as:
>
>> curl https://jabber.systemli.org:5281/register_web
>
> cheers shadow
>
> On 31.05.2017 15:13, Martin Pala wrote:
>> Hello,
>>
>> which Monit version it is? (CLI: monit -V)
>>
>> If you use hostname-based virtual server with SSL, Monit >= 5.13.0 is required for SSL SNI support.
>>
>> The host in the "address" show match the name of the virtual server - you can also override it by adding the "host" option explicitly to the test:
>>
>>   if failed
>>      port 5281
>>      protocol https
>>      host "website.com"   # <---- sets the host header
>>      request "/register_web"
>>      for 2 times within 3 cycles
>>   then alert
>>
>> Best regards,
>> Martin
>>
>>
>>> On 31 May 2017, at 15:00, shadow <[hidden email]> wrote:
>>>
>>> Hello Monit community,
>>>
>>> I ran into a monit error, which I can't solve by documentation or bymyself.
>>>
>>> I try to monitor a website on a high port with monit. The site is up and
>>> running, but monit says it's not reachable.
>>>
>>> Monit Config
>>>> check host jabber-register-website with address website.com
>>>>   if failed
>>>>      port 5281
>>>>      protocol https
>>>>      request "/register_web"
>>>>      for 2 times within 3 cycles
>>>>   then alert
>>>
>>>
>>> Error Message:
>>>> 'jabber-register-website' failed protocol test [HTTP] at [website.com]:5281/register_web [TCP/IP TLS] -- HTTP error: Server returned status 404
>>>
>>>
>>> When I curl the website:
>>>
>>>> [14:43:45] foo@monitoring:~ $ curl https://website.com:5281/register_web           
>>>> <!DOCTYPE html>
>>>> <html>
>>>> <head>
>>>>   <meta charset="utf-8">
>>>>   <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
>>>>   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>
>>>
>>> What am I doing wrong?
>>>
>>> Thanks for your help?
>>>
>>>
>>> --
>>> best regards | viele Gruesse, [hidden email]
>>>
>>> receive my key:
>>> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>>>
>>>
>>> --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>
>
> --
> best regards | viele Gruesse, [hidden email]
>
> receive my key:
> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

shadow
Thanks Martin,

that's interesting. I see the same behavior with CURL (Get --> Site is
present , HEAD --> 404 ).

I used your example (reloaded and restarted monit), but the check is
still failing. I assume you tested it and the problem is on my side.

On 31.05.2017 16:06, Martin Pala wrote:
> check host jabber-register-website with address jabber.systemli.org
>    if failed
>       port 5281
>       protocol https
>       method GET
>       request "/register_web"
>       for 2 times within 3 cycles
>    then alert

--
best regards | viele Gruesse, [hidden email]

receive my key:
gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

martinp@tildeslash.com
Yes, the configuration works for me, debug mode excerpt:

'jabber-register-website' succeeded testing protocol [HTTP] at [jabber.systemli.org]:5281/register_web [TCP/IP TLS] [response time 181.739 ms]
'jabber-register-website' connection succeeded to [jabber.systemli.org]:5281/register_web [TCP/IP TLS]


> On 31 May 2017, at 16:40, shadow <[hidden email]> wrote:
>
> Thanks Martin,
>
> that's interesting. I see the same behavior with CURL (Get --> Site is
> present , HEAD --> 404 ).
>
> I used your example (reloaded and restarted monit), but the check is
> still failing. I assume you tested it and the problem is on my side.
>
> On 31.05.2017 16:06, Martin Pala wrote:
>> check host jabber-register-website with address jabber.systemli.org
>>   if failed
>>      port 5281
>>      protocol https
>>      method GET
>>      request "/register_web"
>>      for 2 times within 3 cycles
>>   then alert
>
> --
> best regards | viele Gruesse, [hidden email]
>
> receive my key:
> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Monit± Protocol test on high port returns 404 even if website is present

shadow
Thanks Martin,

for that awesome support. It's working now. Had to do a full monit
reload not only a service monit reload .

Thanks a ton

On 31.05.2017 16:47, Martin Pala wrote:

> Yes, the configuration works for me, debug mode excerpt:
>
> 'jabber-register-website' succeeded testing protocol [HTTP] at [jabber.systemli.org]:5281/register_web [TCP/IP TLS] [response time 181.739 ms]
> 'jabber-register-website' connection succeeded to [jabber.systemli.org]:5281/register_web [TCP/IP TLS]
>
>
>> On 31 May 2017, at 16:40, shadow <[hidden email]> wrote:
>>
>> Thanks Martin,
>>
>> that's interesting. I see the same behavior with CURL (Get --> Site is
>> present , HEAD --> 404 ).
>>
>> I used your example (reloaded and restarted monit), but the check is
>> still failing. I assume you tested it and the problem is on my side.
>>
>> On 31.05.2017 16:06, Martin Pala wrote:
>>> check host jabber-register-website with address jabber.systemli.org
>>>   if failed
>>>      port 5281
>>>      protocol https
>>>      method GET
>>>      request "/register_web"
>>>      for 2 times within 3 cycles
>>>   then alert
>>
>> --
>> best regards | viele Gruesse, [hidden email]
>>
>> receive my key:
>> gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32
>>
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
best regards | viele Gruesse, [hidden email]

receive my key:
gpg --keyserver zimmermann.mayfirst.org --recv-keys 0x5C6B6ED4248C1F32



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

signature.asc (817 bytes) Download Attachment