[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Program status testing - alert contains stdout and not stderr
From: |
Jan-Henrik Haukeland |
Subject: |
Re: Program status testing - alert contains stdout and not stderr |
Date: |
Sat, 13 Jul 2013 15:02:37 +0200 |
On 13 Jul 2013, at 13:39, Nestor Urquiza <address@hidden> wrote:
> check program myscript with path "/usr/local/bin/myscript.sh" with timeout
> 1000 seconds if status != 0 then alert
> When it fails I get the stdout in the alert instead of stderr. There is a lot
> of logging in the script and monit is collecting only the first few lines so
> tge real cause of the issue is not coming up. This is happening in solaris
> running 5.5.1.
Monit first reads from the script's stderr, if there is nothing there _then_ it
reads from stdout. Please make sure that your script really write to stderr if
needed. The output (if any) is part of the alert message and to avoid too long
messages only 255 chars are read. Maybe your script could do some processing of
the error and only write the relevant part to stderr?