Results 1 to 3 of 3

Thread: For anyone using Graphite

  1. #1
    Join Date
    Jan 2009
    Posts
    6
    Rep Power
    6

    Default For anyone using Graphite

    For anyone else that has Graphite set up in their environment, attached is a script that takes the daily mail report, parses it, and pumps daily and hourly metrics into Graphite.

    We run the following cron job to generate the report, create a file, and run the script. We generate a file so we can look and see what was parsed, as opposed to redirecting the output directly into the script:

    00 00 * * * /opt/zimbra/libexec/zmdailyreport > /root/scripts/mailreport.txt && /root/scripts/zimbra2graphite.py /root/scripts/mailreport.txt | nc -q0 graphite.mydomain.com 2003

    (You may want to run the zmdailyreport report at 23:55. The shipped version parses the logs looking for the current day. We modified ours to look for the previous 24 hours).

    Before running zimbra2graphite for the first time, you should setup the retention for the metrics. Our test mail server is "zimbra-hollis". Here is ours:

    [zimbra-hollis-perhour]
    pattern = ^zimbra-hollis.perhour
    retentions = 1h:90d

    [zimbra-hollis]
    pattern = ^zimbra-hollis
    retentions = 1d:90d

    I wanted to attach a Grafana dashboard screenshot of the metrics from Graphite, but the forum would not allow png or jpg file uploads. However, you can view it here: http://www.oaktreepeak.com/grafana.png . There are only 24 hours of per hour metrics in the screenshot.

    Hope someone finds this useful.
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2009
    Location
    Michigan
    Posts
    454
    Rep Power
    6

    Default

    Very cool! I'll review both Graphite and your script this weekend. Thanks!

    Doug
    Ben Franklin quote:

    "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

  3. #3
    Join Date
    Jan 2009
    Posts
    6
    Rep Power
    6

    Default Fixes - there were some bugs

    Quote Originally Posted by lytledd View Post
    Very cool! I'll review both Graphite and your script this weekend. Thanks!

    Doug
    Here is a script with some parsing fixes. Also included is a bash script that counts blocked spams and those delivered to junk folders.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •