monit-general
[Top][All Lists]
Advanced

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

Re: local alert statement not working


From: Adam Wolfe
Subject: Re: local alert statement not working
Date: Tue, 10 Jul 2012 12:21:56 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1


On 07/10/2012 12:00 PM, address@hidden wrote:
Send monit-general mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.nongnu.org/mailman/listinfo/monit-general
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of monit-general digest..."


Today's Topics:

    1. local alert statement not working (Adam Wolfe)
    2. Re: local alert statement not working (Callum Macdonald)
    3. Re: local alert statement not working (Wayne Lawrence)


----------------------------------------------------------------------

Message: 1
Date: Mon, 09 Jul 2012 12:37:08 -0400
From: Adam Wolfe <address@hidden>
To: address@hidden
Subject: local alert statement not working
Message-ID: <address@hidden>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

I'm having trouble setting up a local alert statement in monit and was
hoping someone could explain where I'm failing.

I have monit set up to monitor a directory for any files, then sync them
to another box when any our found.  We also want to email our client
when these files are found, so they can pick them up.

My statement goes like so:

/check filesystem order-error with path /path/to/error/dir/
       if space usage > 0 B then alert address@hidden
       if space usage > 0 B then exec "my-rsync-statement"
           as uid foo and gid bar/


All seems to be working well enough, except the /if space usage > 0 B
then alert address@hidden/ part.  When I start monit it simply states
"/Error: syntax error 'address@hidden'"/.

I'm following the instructions here
http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement
but I'm not sure if something has changed and this how-to is outdated or
if I'm simply over-looking something.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.nongnu.org/archive/html/monit-general/attachments/20120709/e1b73198/attachment.html>

------------------------------

Message: 2
Date: Mon, 09 Jul 2012 20:29:32 +0200
From: Callum Macdonald <address@hidden>
To: address@hidden
Subject: Re: local alert statement not working
Message-ID: <address@hidden(null)>
Content-Type: text/plain; charset="UTF-8"

On Mon, 2012-07-09 at 12:37 -0400, Adam Wolfe wrote:
check filesystem order-error with path /path/to/error/dir/
      if space usage > 0 B then alert address@hidden
      if space usage > 0 B then exec "my-rsync-statement"
          as uid foo and gid bar
The alert is part of the whole check, not part of the individual test,
so I think you want something like (untested, off the top of my head):

check filesystem order-error with path /path/to/error/dir/
      alert address@hidden
      if space usage > 0 B then exec "my-rsync-statement"
           as uid foo and gid bar

Cheers - Callum.

Thanks, Callum. The above is correct. local alerts need to be their own statement/line.



------------------------------

Message: 3
Date: Mon, 9 Jul 2012 19:32:40 +0100
From: Wayne Lawrence <address@hidden>
To: This is the general mailing list for monit
        <address@hidden>
Subject: Re: local alert statement not working
Message-ID: <address@hidden>
Content-Type: text/plain; charset="iso-8859-1"

I am sure Martin will correct me if I am wrong but I don't think you can do
a size check on a directory as I did ask this question previously.

Regards

Wayne

Sent from my iPhone
This is correct as well. Using "check directory" there doesn't appear to be a way to monitor size / disk usage. Using "check filesystem" seems to be working quite well, though. Just looks like a bit of a kludge on my part, but I could find no other way of doing it.

On 9 Jul 2012, at 17:37, Adam Wolfe <address@hidden> wrote:

  I'm having trouble setting up a local alert statement in monit and was
hoping someone could explain where I'm failing.

I have monit set up to monitor a directory for any files, then sync them to
another box when any our found.  We also want to email our client when
these files are found, so they can pick them up.

My statement goes like so:

*check filesystem order-error with path /path/to/error/dir/
      if space usage > 0 B then alert address@hidden
      if space usage > 0 B then exec "my-rsync-statement"
          as uid foo and gid bar*


All seems to be working well enough, except the *if space usage > 0 B then
alert address@hidden part.  When I start monit it simply states "*Error:
syntax error 'address@hidden'"*.

I'm following the instructions here
http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statementbut
I'm not sure if something has changed and this how-to is outdated or
if
I'm simply over-looking something.

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.nongnu.org/archive/html/monit-general/attachments/20120709/1f98d59c/attachment.html>

------------------------------

_______________________________________________
monit-general mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/monit-general


End of monit-general Digest, Vol 114, Issue 5
*********************************************





reply via email to

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