Fwd: monit alert -- Status failed network_resolv

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: monit alert -- Status failed network_resolv

Szépe Viktor
Hello!

I may seem a rookie but why am I getting an email on the execution of  
a Slack script?

  check program network_resolv
     with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'"  
every 33 cycles
    group integrity
    if status != 0 then alert
    if status != 0 then exec "/usr/local/sbin/monit-slack.sh  
'https://hooks.slack.com/services...'"

All sources are available on GitHub:  
https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit

I've received a separate email with "Action: alert"
Please advise.
Thank you.

----- Forwarded message from [hidden email] -----
    Date: Tue, 17 Oct 2017 21:04:31 GMT
    From: [hidden email]
Subject: monit alert --  Status failed network_resolv
      To: [hidden email]

Status failed Service network_resolv

        Date:        Tue, 17 Oct 2017 21:04:31
        Action:      exec
        Host:        www.example.com
        Description: status failed (1) -- R:2001:4860:4860::8888 2

Your faithful employee,
Monit

----- End forwarded message -----


SZÉPE Viktor, honlap üzemeltetés
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
--
+36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület





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

Re: monit alert -- Status failed network_resolv

Juergen Nickelsen
On 2017-10-17, at 23:13, SZÉPE Viktor <[hidden email]> wrote:

> I may seem a rookie but why am I getting an email on the execution of a Slack script?
>
> check program network_resolv
>    with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
>   group integrity
>   if status != 0 then alert
>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"

Being relatively new to monit, too, I'd say because there are two "if status != 0 then" clauses: (a) alert (meaning the email message), and (b) exec the slack script.

So, I'd remove the first one, "if status != 0 then alert", to try to get rid of the email message, if that is what you want.

Regards, Juergen.


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

Re: monit alert -- Status failed network_resolv

Szépe Viktor
Idézem/Quoting Juergen Nickelsen <[hidden email]>:

> On 2017-10-17, at 23:13, SZÉPE Viktor <[hidden email]> wrote:
>
>> I may seem a rookie but why am I getting an email on the execution  
>> of a Slack script?
>>
>> check program network_resolv
>>    with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'"  
>> every 33 cycles
>>   group integrity
>>   if status != 0 then alert
>>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh  
>> 'https://hooks.slack.com/services...'"
>
> Being relatively new to monit, too, I'd say because there are two  
> "if status != 0 then" clauses: (a) alert (meaning the email  
> message), and (b) exec the slack script.
>
> So, I'd remove the first one, "if status != 0 then alert", to try to  
> get rid of the email message, if that is what you want.

Thank you.
I receive 2 emails.


SZÉPE Viktor, honlap üzemeltetés
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
--
+36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület





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

Re: monit alert -- Status failed network_resolv

martinp@tildeslash.com
In reply to this post by Szépe Viktor
Hello Viktor,

the 'alert' action is implicit, the alert is send too even if you have 'exec' action => you can simplify the configuration:

original:
  if status != 0 then alert
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"

simplified (exec sends alert as well):
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"

If you need to suppress the alert completely, you can do it in the service context this way:

  check program network_resolv with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
                if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"
                noalert myuser@mydomain


(we will clean the alert handling in the future - multiple coma separated actions will be possible and custom alert channels will be supported)


Best regards,
Martin



> On 17 Oct 2017, at 23:13, SZÉPE Viktor <[hidden email]> wrote:
>
> Hello!
>
> I may seem a rookie but why am I getting an email on the execution of a Slack script?
>
> check program network_resolv
>    with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
>   group integrity
>   if status != 0 then alert
>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"
>
> All sources are available on GitHub: https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit
>
> I've received a separate email with "Action: alert"
> Please advise.
> Thank you.
>
> ----- Forwarded message from [hidden email] -----
>   Date: Tue, 17 Oct 2017 21:04:31 GMT
>   From: [hidden email]
> Subject: monit alert --  Status failed network_resolv
>     To: [hidden email]
>
> Status failed Service network_resolv
>
> Date:        Tue, 17 Oct 2017 21:04:31
> Action:      exec
> Host:        www.example.com
> Description: status failed (1) -- R:2001:4860:4860::8888 2
>
> Your faithful employee,
> Monit
>
> ----- End forwarded message -----
>
>
> SZÉPE Viktor, honlap üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> --
> +36-20-4242498  [hidden email]  skype: szepe.viktor
> Budapest, III. kerület
>
>
>
>
>
> --
> 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 alert -- Status failed network_resolv

Shakil Shaikh
Hi Martin,

Like the OP I am getting an email as well as the script action (which I now understand is as designed).

Is it possible to set up email as a backup/monit error alert?

Usage: I want to suppress emails in lieu of scripts, but if monit fails in executing (script path is not available etc) then an email should be sent with this error.

Or would this require a separate "file" check?

Thank you,

Shak


From: monit-general <monit-general-bounces+sshaikh=[hidden email]> on behalf of [hidden email] <[hidden email]>
Sent: 18 October 2017 08:25
To: This is the general mailing list for monit
Subject: Re: monit alert -- Status failed network_resolv
 
Hello Viktor,

the 'alert' action is implicit, the alert is send too even if you have 'exec' action => you can simplify the configuration:

original:
  if status != 0 then alert
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"

simplified (exec sends alert as well):
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"

If you need to suppress the alert completely, you can do it in the service context this way:

         check program network_resolv with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
                if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"
                noalert myuser@mydomain


(we will clean the alert handling in the future - multiple coma separated actions will be possible and custom alert channels will be supported)


Best regards,
Martin



> On 17 Oct 2017, at 23:13, SZÉPE Viktor <[hidden email]> wrote:
>
> Hello!
>
> I may seem a rookie but why am I getting an email on the execution of a Slack script?
>
> check program network_resolv
>    with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
>   group integrity
>   if status != 0 then alert
>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"
>
> All sources are available on GitHub: https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit
>
> I've received a separate email with "Action: alert"
> Please advise.
> Thank you.
>
> ----- Forwarded message from [hidden email] -----
>   Date: Tue, 17 Oct 2017 21:04:31 GMT
>   From: [hidden email]
> Subject: monit alert --  Status failed network_resolv
>     To: [hidden email]
>
> Status failed Service network_resolv
>
>        Date:        Tue, 17 Oct 2017 21:04:31
>        Action:      exec
>        Host:        www.example.com
>        Description: status failed (1) -- R:2001:4860:4860::8888 2
>
> Your faithful employee,
> Monit
>
> ----- End forwarded message -----
>
>
> SZÉPE Viktor, honlap üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> --
> +36-20-4242498  [hidden email]  skype: szepe.viktor
> Budapest, III. kerület
>
>
>
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
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 alert -- Status failed network_resolv

martinp@tildeslash.com
Monit doesn't support such fallback currently, you can implement this in the exec action script (it would require the script to always exist).

Best regards,
Martin


On 18 Oct 2017, at 11:02, Shakil Shaikh <[hidden email]> wrote:

Hi Martin,

Like the OP I am getting an email as well as the script action (which I now understand is as designed).

Is it possible to set up email as a backup/monit error alert?

Usage: I want to suppress emails in lieu of scripts, but if monit fails in executing (script path is not available etc) then an email should be sent with this error.

Or would this require a separate "file" check?

Thank you,

Shak


From: monit-general <[hidden email]> on behalf of [hidden email] <[hidden email]>
Sent: 18 October 2017 08:25
To: This is the general mailing list for monit
Subject: Re: monit alert -- Status failed network_resolv
 
Hello Viktor,

the 'alert' action is implicit, the alert is send too even if you have 'exec' action => you can simplify the configuration:

original:
  if status != 0 then alert
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"

simplified (exec sends alert as well):
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"

If you need to suppress the alert completely, you can do it in the service context this way:

         check program network_resolv with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
                if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"
                noalert myuser@mydomain


(we will clean the alert handling in the future - multiple coma separated actions will be possible and custom alert channels will be supported)


Best regards,
Martin



> On 17 Oct 2017, at 23:13, SZÉPE Viktor <[hidden email]> wrote:
> 
> Hello!
> 
> I may seem a rookie but why am I getting an email on the execution of a Slack script?
> 
> check program network_resolv
>    with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
>   group integrity
>   if status != 0 then alert
>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 'https://hooks.slack.com/services...'"
> 
> All sources are available on GitHub: https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit
> 
> I've received a separate email with "Action: alert"
> Please advise.
> Thank you.
> 
> ----- Forwarded message from [hidden email] -----
>   Date: Tue, 17 Oct 2017 21:04:31 GMT
>   From: [hidden email]
> Subject: monit alert --  Status failed network_resolv
>     To: [hidden email]
> 
> Status failed Service network_resolv
> 
>        Date:        Tue, 17 Oct 2017 21:04:31
>        Action:      exec
>        Host:        www.example.com
>        Description: status failed (1) -- R:2001:4860:4860::8888 2
> 
> Your faithful employee,
> Monit
> 
> ----- End forwarded message -----
> 
> 
> SZÉPE Viktor, honlap üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> +36-20-4242498  [hidden email]  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


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