monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monit version 4.1.1


From: Martin Pala
Subject: Re: Monit version 4.1.1
Date: Mon, 15 Mar 2004 19:15:23 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040310 Debian/1.6-2

The "alert" statement in the test rule defines *action*. The action is choice of "alert", "restart", "stop", "exec" and "unmonitor" - see Monit manual (http://www.tildeslash.com/monit/monit.html#service%20tests).

The alert's recipient however, is defined in standalone statement (see manual for complete syntax - http://www.tildeslash.com/monit/monit.html#alert%20messages):

  ALERT mail-address [{events}] [MAIL-FORMAT {mail-format}]

... where you can optionaly define (in addition to the recipient) events and mail-format.


=> following syntax should solve the problem:

 check host vega address 172.16.0.19
  if failed host vega port 80
    send "GET /imagenes/desk2.jpg"
    expect "OK"
    then alert
  alert address@hidden mail-format { subject: Desk2.jpg }


Cheers,
Martin


Ma. Isabel Reolon wrote:
Thank you for your help. Your previous suggestion worked OK!
Now I have another question.
When I try to use mail format for an alert a syntax error is reported!!
The code I am using is:

check host vega address 172.16.0.19
if failed host vega port 80
   send "GET /imagenes/desk2.jpg"
expect "OK" then alert address@hidden mail-format { subject: Desk2.jpg }

I also tried the example:

if failed port 80 protocol http and request "/monit/dist/monit-4.0.tar.gz"
              with checksum f9d26b8393736b5dfad837bb13780786
       then alert with mail-format { subject: Aaaalarm! }


Any ideas?
Thanks again.
Best wishes,


Isabel Reolón Álvarez
Soporte Basis y DB
Área Informática Conaprole
Montevideo
Uruguay


-----Mensaje original-----
De: Martin Pala [mailto:address@hidden Enviado el: jueves, 11 de marzo de 2004 15:05
Para: Ma. Isabel Reolon
CC: address@hidden; address@hidden
Asunto: Re: Monit version 4.1.1

Hi,

you can use send/expect statements - you only need to add authentication to the header:

Authorization: Basic STRING

... where "STRING" is "user:password" encoded by base64

Example:

  if failed host www.sol.no port 80
     send "GET / HTTP/1.0\r\nAuthorization: Basic STRING\r\n\r\n"
     expect "HTTP/[0-9\.]{3} 200 .*\r\n"
     then alert

You can use multiple send/expect statements, another example (taken from monit documentation):

  if failed host cave.arabia.baz port 4040
     send "Open, Sesame!\r\n"
     expect "Please enter the cave\r\n"
     send "Shut, Sesame!\r\n"
     expect "See you later [A-Za-z ]+\r\n"
     then restart


Cheers,
Martin

Ma. Isabel Reolon wrote:

Hello:



I am making the first tests using this software tool and I was wondering if you could help me answering this question:

I would like to check a web application in order to see if it behaves as expected not just seeing if the service actually responds.

The problem is that I would like to give a user name and a password and see if the service responds authenticating the user...

Any idea of how this could be accomplished ?



Thanks,

Best regards,





Isabel Reolón Álvarez

Soporte Basis y DB

Área Informática

Conaprole

Montevideo, Uruguay






reply via email to

[Prev in Thread] Current Thread [Next in Thread]