Monitoring Postfix Via Browser

Discussion in 'Installation/Configuration' started by pinguingilo, Jun 17, 2006.

  1. pinguingilo

    pinguingilo New Member

    I Want monitoring my mailserver trafic such as log analyzer and else...How To Monitoring That mailserver...Can do it ?? I use Postfix + Clamav + Clamsmtp..Please Tell me !!! :confused: :confused: :confused:
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. davekeogh

    davekeogh New Member

    pflogsumm can monitor postfix logs pretty well. Google it and you'll find it!
     
  4. my5660

    my5660 New Member

  5. AngelDrago

    AngelDrago Member

  6. falko

    falko Super Moderator Howtoforge Staff

    There's a file mailgraph.cgi that you must put in the cgi-bin directory of a website and make it executable. Afterwards you can access it like that: www.example.com/cgi-bin/mailgraph.cgi
     
  7. AngelDrago

    AngelDrago Member

    i'm getting a 500 error - Internal Server Error! after copying the mailgraph.cgi... how do i make it executable???... Thank you falko Peace AngelDrago
     
  8. lorello

    lorello New Member

    I'v ubuntu breeze and I've done a simple

    Code:
    apt-get install mailgraph
    then

    Code:
    chmod a+x /usr/lib/cgi-bin/mailgraph.cgi
    and then... nothing was functioning properly :mad:
    I've made it running, editing some files, as described in this trac ticket
    (in italian, sorry).

    You can now see my mail statistics at:

    vandana.altranet.it/cgi-bin/mailgraph.cgi

    :D

    I'm now trying to make couriergraph running... but I'm not very lucky...
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Code:
    chmod 755 /path/to/mailgraph.cgi
    If you use suExec, you must also chown the file.
     
  10. nenad

    nenad Member

    Last edited: Sep 17, 2006
  11. falko

    falko Super Moderator Howtoforge Staff

    Are the settings in your mailgraph.cgi correct? Maybe the folder for image creation doesn't exist or something like that.
     
  12. nenad

    nenad Member

    Exactly like that.

    I overseen this line in mailgraph.cgi

    my $tmp_dir = '/var/lib/mailgraph'; # temporary directory where to store the images

    so, I created that directory

    (and cmod and chown it change to the user the suexec of that virtualhost was running)

    but there is still no graphs

    there is only ,cgi-bin directory created inside /var/lib/mailgraph
     
    Last edited: Sep 19, 2006
  13. nenad

    nenad Member

    OK, I found what was happening.

    /var/lib/mailgraph

    directory MUST be created BEFORE installation of rrdtool and mailgraph.

    If it is not created then those two files:

    mailgraph.rrd
    mailgraph_virus.rrd

    are not written in this directory, and when you try to see your graphs, you will not see them.

    and it must be chmod to 755 and chown to the suexec user of that virtualhost

    --------------------------------------------------------------------------

    So this is revised falko's tutorial.
    This one is "mailgraph for dummies on Debian Sarge 3.1" (dummies as I am :) ). And of course this will help me few months later when I reinstall server to set up mailraph once again :)

    In this example virtual host is www.example.com
    Web user is web1_user


    Step 1:

    mkdir /var/lib/mailgraph
    chmod 755 /var/lib/mailgraph
    chown web1_user:web1 /var/lib/mailgraph

    Step 2:

    apt-get install rrdtool mailgraph

    Note: If you allready installed this, but you find your self in trouble making it work, and you find this tutorial try this instead:

    apt-get --reinstall install rrdtool mailgraph

    Step 3:

    Should Mailgraph start on boot? <-- Yes
    Which logfile should be used by mailgraph? <-- /var/log/mail.log
    Remove RRD files on purge? <-- No If this is selected as 'Yes' then /var/lib/mailgraph directory will be deleted

    Step 4:
    Copy mailgraph.cgi to cgi of our website's cgi directory

    cp -p /usr/lib/cgi-bin/mailgraph.cgi /var/www/www.example.com/cgi-bin

    Step 5:
    Change ownership:

    chown web1_user:web1 /var/www/www.example.com/cgi-bin/mailgraph.cgi

    Step 6:
    Point your browser to:

    http://www.example.com/cgi-bin/mailgraph.cgi

    ---------------------------------------------------------------------
    Note: I do hope that this will work for you as it works for me:
    http://www.web-hosting.co.yu/cgi-bin/mailgraph.cgi
     

Share This Page