Re: monit alert -- Status failed network_resolv

"[email protected]" <[email protected]>
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <[email protected]>
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 <[email protected]> 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 [email protected] -----
>   Date: Tue, 17 Oct 2017 21:04:31 GMT
>   From: [email protected]
> Subject: monit alert --  Status failed network_resolv
>     To: [email protected]
> 
> 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  [email protected]  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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.