<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><style style="display:none">/*<![CDATA[*/Swatc *#aqm-original P {
margin-top: 0;
margin-bottom: 0;
}
/*]]>*/</style></div><div>Hi Mark!, you can do it installing "monit" service.</div><div>* Install monit server</div><div>* Create /etc/monit.d/mailbox_log file:</div><div><br data-mce-bogus="1"></div><div><div><span style="font-family: "courier new", courier, monaco, monospace, sans-serif; font-size: 9pt;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif; font-size: 9pt;">check file mailbox_log with path /opt/zimbra/log/mailbox.log</span></div><div><span style="font-family: "courier new", courier, monaco, monospace, sans-serif; font-size: 9pt;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif; font-size: 9pt;"> if match "Connection pool shut down" then exec "/opt/zimbra/bin/zmmailboxdctl restart" as uid zimbra and gid zimbra</span></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>* Restart and enable monit service</div><div><br data-mce-bogus="1"></div><div>And that's all!</div><div><br data-mce-bogus="1"></div><div>You will see on /var/log/monit.log</div><div><span style="font-family: "courier new", courier, monaco, monospace, sans-serif; font-size: 9pt;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif; font-size: 9pt;">[-03 Nov 3 12:50:48] info : 'mailbox_log' exec: '/opt/zimbra/bin/zmmailboxdctl restart'</span><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div><div><br></div><div>There are some ansible roles for install and configure monit server too.... if you need some help dm me ;)</div><div><br data-mce-bogus="1"></div><div>Refs: <a href="https://mmonit.com/wiki/Monit/ConfigurationExamples" data-mce-href="https://mmonit.com/wiki/Monit/ConfigurationExamples">https://mmonit.com/wiki/Monit/ConfigurationExamples</a></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div data-marker="__SIG_PRE__">Regards<br>---------------------------------<br>Daniel Eugenin M.<br><span style="color:rgb( 0 , 128 , 0 )"><strong>IT </strong></span><strong>Linux</strong><br><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"L Mark Stone" <lmstone@lmstone.com><br><b>Para: </b>"Mark Nichols" <mnichols@missioncriticalis.com><br><b>CC: </b>users@lists.zetalliance.org<br><b>Enviados: </b>Sábado, 2 de Noviembre 2019 12:54:18<br><b>Asunto: </b>Re: [Users] Help With Zimbra Script Please<br></div><div><br></div><div data-marker="__QUOTED_TEXT__">
Hi Mark and Aaron,
<div><br>
</div>
<div>Thanks for your replies. </div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>Based on my and one of my customer’s experiences, the bug remains elsewhere. </div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>And ideally I’d not like to modify any of the existing Zimbra configs. <br>
<br>
How does my proposed hack script look to you?</div>
<div><br>
</div>
<div>Thanks!</div>
<div>Mark<br>
<div dir="ltr">___________________________
<div>L. Mark Stone</div>
<div>Sent from my iPhone</div>
</div>
<div dir="ltr"><br>
<blockquote>On Nov 2, 2019, at 11:42 AM, Mark Nichols <mnichols@missioncriticalis.com> wrote:<br>
<br>
</blockquote>
</div>
<blockquote>
<div dir="ltr">
<div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:#000000">
<div></div>
<div>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.<br>
</div>
<div><br>
</div>
<div>
<div>Mark Nichols<br>
Mission Critical Information Services<br>
303-997-1327<br>
<a href="http://www.missioncriticalis.com" rel="nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">www.missioncriticalis.com</a><br>
</div>
</div>
<div><br>
</div>
<hr id="zwchr">
<div><b>From: </b>"Aaron Cayard-Roberts" <cayaraa@earlham.edu><br>
<b>To: </b>"L Mark Stone" <lmstone@lmstone.com>, users@lists.zetalliance.org<br>
<b>Sent: </b>Saturday, November 2, 2019 4:31:15 PM<br>
<b>Subject: </b>Re: [Users] Help With Zimbra Script Please<br>
</div>
<div><br>
</div>
<div>
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">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.</div>
<div dir="auto"><br>
</div>
<div dir="auto">-Aaron</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div style="color:black">
<div dir="ltr">
<div style="color:black">
<p style="color:black;font-size:10pt;font-family:sans-serif;margin:8pt 0">On November 2, 2019 9:54:07 AM L Mark Stone <lmstone@lmstone.com> wrote:</p>
<blockquote class="gmail_quote" style="margin:0 0 0 0.75ex;border-left:1px solid #808080;padding-left:0.75ex">
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
Scripting is not my forte, but I know a little, so asking for help please.</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
<br>
</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
I'd like to watch mailbox.log for a certain string as the zimbra user and then take an action. Something like:</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
<br>
</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
tail -F /opt/zimbra/log/mailbox.log | grep --line-buffered 'Connection pool shut down' | while read ; do 'zmmailboxdctl restart' ; done<br>
</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
<br>
</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
I'd run this in a detached screen session.</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
<br>
</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
Any help/suggestions appreciated!</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
<br>
</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
Thanks,</div>
<div style="font-family:'calibri' , 'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
Mark</div>
<div>
<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:'calibri' , 'arial' , 'helvetica' , sans-serif">
<p style="margin-top:0px;margin-bottom:0px"><strong>_________________________________________________</strong></p>
<p style="margin-top:0px;margin-bottom:0px"><strong>L. Mark Stone</strong></p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto" style="color:black">
<div dir="auto"><br>
</div>
<div dir="auto">--</div>
<div dir="auto">Aaron Cayard-Roberts</div>
<div dir="auto">System and Security Administrator</div>
<div dir="auto">Information Technology Services</div>
<div dir="auto">Earlham College</div>
<div dir="auto">801 National Road West</div>
<div dir="auto">Richmond, IN 47374</div>
<div dir="auto">Phone: 765-983-1851</div>
<div dir="auto"><br>
</div>
</div>
<div dir="auto"><br>
</div>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div><br></div></div></body></html>