[Users] Help With Zimbra Script Please

Daniel Eugenin deugenin at itlinux.cl
Mon Nov 4 03:00:25 CET 2019


Hi Mark!, you can do it installing "monit" service. 
* Install monit server 
* Create /etc/monit.d/mailbox_log file: 

check file mailbox_log with path /opt/zimbra/log/mailbox.log 
if match "Connection pool shut down" then exec "/opt/zimbra/bin/zmmailboxdctl restart" as uid zimbra and gid zimbra 


* Restart and enable monit service 

And that's all! 

You will see on /var/log/monit.log 
[-03 Nov 3 12:50:48] info : 'mailbox_log' exec: '/opt/zimbra/bin/zmmailboxdctl restart' 


There are some ansible roles for install and configure monit server too.... if you need some help dm me ;) 

Refs: [ https://mmonit.com/wiki/Monit/ConfigurationExamples | https://mmonit.com/wiki/Monit/ConfigurationExamples ] 


Regards 
--------------------------------- 
Daniel Eugenin M. 
IT Linux 



De: "L Mark Stone" <lmstone at lmstone.com> 
Para: "Mark Nichols" <mnichols at missioncriticalis.com> 
CC: users at lists.zetalliance.org 
Enviados: Sábado, 2 de Noviembre 2019 12:54:18 
Asunto: Re: [Users] Help With Zimbra Script Please 

Hi Mark and Aaron, 

Thanks for your replies. 

The action that needs to be taken is to restart mailboxd; I don’t care about an email notification because there is separate monitoring that takes care of notifications. 

8.8.15 Patch 3 contains a fix for a bug that causes the httpclient connection pool to shut down, causing the web client to display a Error 500 message. 

Based on my and one of my customer’s experiences, the bug remains elsewhere. 

So, I’m really just looking for a way to watch mailbox.log for the connection pool shut down message and restart mailboxd automatically thereafter. 

And ideally I’d not like to modify any of the existing Zimbra configs. 

How does my proposed hack script look to you? 

Thanks! 
Mark 
___________________________ 
L. Mark Stone 
Sent from my iPhone 



On Nov 2, 2019, at 11:42 AM, Mark Nichols <mnichols at missioncriticalis.com> wrote: 





BQ_BEGIN

Swatch does have the ability to send emails, however, if you are monitoring the email system and it's down, that won't work. For one customer, I configured a sendmail (that came with the OS) service to relay the swatch results and it worked OK. 

Mark Nichols 
Mission Critical Information Services 
303-997-1327 
[ http://www.missioncriticalis.com/ | www.missioncriticalis.com ] 


From: "Aaron Cayard-Roberts" <cayaraa at earlham.edu> 
To: "L Mark Stone" <lmstone at lmstone.com>, users at lists.zetalliance.org 
Sent: Saturday, November 2, 2019 4:31:15 PM 
Subject: Re: [Users] Help With Zimbra Script Please 


I'm pretty sure you could use a tool called swatchdog/swatch that is bundled with Zimbra to do this (we were just walking about it on irc this week so it must be stuck in my head). It's what's used to watch the zimbra logs and send email notifications but if memory serves you can have it run other commands when a match is made instead of sending an email. 

-Aaron 





On November 2, 2019 9:54:07 AM L Mark Stone <lmstone at lmstone.com> wrote: 
BQ_BEGIN

Scripting is not my forte, but I know a little, so asking for help please. 

I'd like to watch mailbox.log for a certain string as the zimbra user and then take an action. Something like: 

tail -F /opt/zimbra/log/mailbox.log | grep --line-buffered 'Connection pool shut down' | while read ; do 'zmmailboxdctl restart' ; done 

I'd run this in a detached screen session. 

Any help/suggestions appreciated! 

Thanks, 
Mark 


_________________________________________________ 

L. Mark Stone 



BQ_END



-- 
Aaron Cayard-Roberts 
System and Security Administrator 
Information Technology Services 
Earlham College 
801 National Road West 
Richmond, IN 47374 
Phone: 765-983-1851 




BQ_END


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zetalliance.org/pipermail/users_lists.zetalliance.org/attachments/20191103/22a17d2c/attachment.html>


More information about the Users mailing list