View Single Post
  #21 (permalink)  
Old 02-01-2009, 12:07 AM
maumar maumar is offline
Elite Member
 
Posts: 296
Default monitor and unmonitor into logrotate script

reficeja, your scipt is a great starting point, i am using iwth with a very slighly change.
what can be interesting is to integrate your script in to logrotate script to avoid receing alert during log rotation

this is the snippet:

Code:
/var/log/zimbra.log {                                                                                                                                                              
    daily                                                                                                                                                                          
    rotate 365
    dateext                                                                                                                                                           
    missingok                                                                                                                                                                      
    notifempty
    create 0644 zimbra zimbra
    prerotate
      /usr/bin/monit -g zimbra unmonitor all
    endscript
    postrotate
      killall -HUP syslogd 2> /dev/null || true
      kill -HUP `cat /opt/zimbra/log/swatch.pid 2> /dev/null` 2> /dev/null || true
      kill -HUP `cat /opt/zimbra/log/logswatch.pid 2> /dev/null` 2> /dev/null || true
      /usr/bin/monit -g zimbra monitor all
    endscript
    compress
}
For John:
i use monit principally to monit ldap, ldap process sometimes die without letting any reason on logs; i have to open a ticket to allow tech ppl to investigate the issue; in the meantime ldap start is the only way to get zimbra alive and monit does this task; there is no zimbra watchdog on ldap process.

Last edited by maumar; 02-01-2009 at 12:21 AM..
Reply With Quote