Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| centos:mail_c6:mta_11 [15.05.2014 13:58. ] – [Installation] django | centos:mail_c6:mta_11 [18.11.2024 19:12. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 3: | Zeile 3: | ||
| Im Detail wollen wir uns nun drei der Varianten genauer ansehen. | Im Detail wollen wir uns nun drei der Varianten genauer ansehen. | ||
| - | - **pflogsumm** Logfilezusammenfassung generieren und via eMail dem postmaster zur Verfügung stellen. | + | - **[[centos: |
| - WEB-GUIs Graphisch sehr ansprechende Logfilezusammenfassung generieren und zum Abrufen via Browser anbieten | - WEB-GUIs Graphisch sehr ansprechende Logfilezusammenfassung generieren und zum Abrufen via Browser anbieten | ||
| - | - **mailgraph** | + | - **[[centos: |
| - | - **queuegraph** | + | - **[[centos: |
| - | - **greygraph** | + | - **[[centos: |
| - | - **mxgraphs** | + | - **[[centos: |
| - | - **AWStats** Logfilezusammenfassung generieren und zum Abrufen via Browser anbieten | + | - **[[centos: |
| + | - **[[centos: | ||
| ===== pflogsumm ===== | ===== pflogsumm ===== | ||
| Zeile 851: | Zeile 852: | ||
| Möchte man einen graphischen Überblick über die Queues haben, so greifen wir auf das Programm [[http:// | Möchte man einen graphischen Überblick über die Queues haben, so greifen wir auf das Programm [[http:// | ||
| - | Das aktuelle Programmpaket**queuegraph** installieren am einfachsten aus dem [[centos: | + | Das aktuelle Programmpaket **queuegraph** installieren am einfachsten aus dem [[centos: |
| ==== Installation ==== | ==== Installation ==== | ||
| Zeile 2087: | Zeile 2088: | ||
| # cd /tmp | # cd /tmp | ||
| - | Und laden uns den Patch zum Ändern der vorhandenen Datei auf unseren Rechner. | + | Und laden uns den oben aufgeführten |
| - | # wget --output-document=mailgraph-1.14-8_mxgraphs_patch https:// | + | |
| Anschließend wenden wir den Patch mit nachfolgendem Aufruf an. | Anschließend wenden wir den Patch mit nachfolgendem Aufruf an. | ||
| Zeile 2319: | Zeile 2319: | ||
| <a href=" | <a href=" | ||
| - <a href=" | - <a href=" | ||
| - | + <a href=" | + | + <a href=" |
| </ | </ | ||
| < | < | ||
| Zeile 2374: | Zeile 2374: | ||
| # cp / | # cp / | ||
| - | Anschließend | + | Dann laden wir den obigen Patch auf unseren Rechner und legen diesen im Verzeichnis // |
| - | {{ : | + | Anschließend wenden wir den Patch an. |
| + | # patch -p0 < mxgraphs_spf_dkim_dmarc.patch | ||
| + | |||
| + | Und kopieren zu guter Letzt das geänderte Script an Ort und Stelle. | ||
| + | # mv / | ||
| + | |||
| + | Alternativ können wir auch nachfolgendes CGI-sript, bei dem der Patch schon angewandt wurde, auf unseren Rechner laden und ins Verzeichnis // | ||
| + | |||
| + | <file perl / | ||
| + | |||
| + | # mxgraphs -- detailed postfix mail traffic statistics | ||
| + | # copyright (c) 2000-2007 ETH Zurich | ||
| + | # copyright (c) 2000-2007 David Schweikert < | ||
| + | # modifed 2011 for grey Markus Neubauer < | ||
| + | # modified 2013 for mxgraphs by Django < | ||
| + | # released under the GNU General Public License | ||
| + | |||
| + | use RRDs; | ||
| + | use POSIX qw(uname); | ||
| + | |||
| + | my $VERSION = " | ||
| + | |||
| + | my $host = (POSIX:: | ||
| + | my $scriptname = ' | ||
| + | my $xpoints = 800; | ||
| + | my $points_per_sample = 3; | ||
| + | my $ypoints = 160; | ||
| + | my $ypoints_err = 160; | ||
| + | my $ypoints_grey = 160; | ||
| + | my $ypoints_greydetail = 160; | ||
| + | my $ypoints_queue = 160; | ||
| + | my $rrd = '/ | ||
| + | my $rrd_virus = '/ | ||
| + | my $rrd_queue = '/ | ||
| + | my $rrd_grey = '/ | ||
| + | my $rrd_spam = '/ | ||
| + | my $tmp_dir = '/ | ||
| + | |||
| + | my @graphs = ( | ||
| + | { title => ' | ||
| + | { title => ' | ||
| + | { title => ' | ||
| + | { title => ' | ||
| + | ); | ||
| + | |||
| + | my %color = ( | ||
| + | sent => ' | ||
| + | received | ||
| + | whitelist | ||
| + | new => ' | ||
| + | early => ' | ||
| + | qspam => ' | ||
| + | awl => ' | ||
| + | reconnectok => ' | ||
| + | rejected | ||
| + | bounced | ||
| + | virus => ' | ||
| + | spam => ' | ||
| + | active | ||
| + | deferred | ||
| + | ); | ||
| + | |||
| + | sub rrd_graph(@) | ||
| + | { | ||
| + | my ($range, $file, $ypoints, @rrdargs) = @_; | ||
| + | my $step = $range*$points_per_sample/ | ||
| + | my $end = time; $end -= $end % $step; | ||
| + | my $date = localtime(time); | ||
| + | $date =~ s|:|\\:|g unless $RRDs:: | ||
| + | |||
| + | my ($graphret, | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | $RRDs:: | ||
| + | |||
| + | @rrdargs, | ||
| + | |||
| + | ' | ||
| + | ); | ||
| + | my $ERR=RRDs:: | ||
| + | die " | ||
| + | } | ||
| + | |||
| + | |||
| + | sub graph($$) | ||
| + | { | ||
| + | my ($range, $file) = @_; | ||
| + | my $step = $range*$points_per_sample/ | ||
| + | rrd_graph($range, | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ); | ||
| + | } | ||
| + | |||
| + | |||
| + | sub graph_err($$) | ||
| + | { | ||
| + | my ($range, $file) = @_; | ||
| + | my $step = $range*$points_per_sample/ | ||
| + | rrd_graph($range, | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | ); | ||
| + | } | ||
| + | |||
| + | |||
| + | sub graph_queue($$) | ||
| + | { | ||
| + | my ($range, $file) = @_; | ||
| + | my $step = $range*$points_per_sample/ | ||
| + | rrd_graph($range, | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ); | ||
| + | } | ||
| + | |||
| + | |||
| + | sub graph_grey($$) | ||
| + | { | ||
| + | my ($range, $file) = @_; | ||
| + | my $step = $range*$points_per_sample/ | ||
| + | rrd_graph($range, | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | ); | ||
| + | } | ||
| + | |||
| + | |||
| + | sub graph_greydetail($$) | ||
| + | { | ||
| + | my ($range, $file) = @_; | ||
| + | my $step = $range*$points_per_sample/ | ||
| + | rrd_graph($range, | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | ); | ||
| + | } | ||
| + | |||
| + | |||
| + | sub print_html() | ||
| + | { | ||
| + | print " | ||
| + | |||
| + | print << | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <meta http-equiv=" | ||
| + | < | ||
| + | <meta http-equiv=" | ||
| + | <meta http-equiv=" | ||
| + | <link rel=" | ||
| + | </ | ||
| + | < | ||
| + | HEADER | ||
| + | |||
| + | print "< | ||
| + | |||
| + | print "< | ||
| + | for my $n (0..$# | ||
| + | print " | ||
| + | } | ||
| + | print "</ | ||
| + | |||
| + | for my $n (0..$# | ||
| + | print "< | ||
| + | print "< | ||
| + | print "< | ||
| + | print "< | ||
| + | print "< | ||
| + | print "< | ||
| + | } | ||
| + | |||
| + | print << | ||
| + | < | ||
| + | <table border=" | ||
| + | < | ||
| + | <col width=" | ||
| + | <col width=" | ||
| + | <col width=" | ||
| + | </ | ||
| + | < | ||
| + | <td class=" | ||
| + | <a href=" | ||
| + | <a href=" | ||
| + | </ | ||
| + | < | ||
| + | <a href=" | ||
| + | </ | ||
| + | <td class=" | ||
| + | <a href=" | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | <td class=" | ||
| + | </ | ||
| + | <td class=" | ||
| + | <a href=" | ||
| + | <a href=" | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | <td class=" | ||
| + | </ | ||
| + | <td class=" | ||
| + | <a href=" | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | FOOTER | ||
| + | } | ||
| + | |||
| + | sub send_image($) | ||
| + | { | ||
| + | my ($file)= @_; | ||
| + | |||
| + | -r $file or do { | ||
| + | print " | ||
| + | exit 1; | ||
| + | }; | ||
| + | |||
| + | print " | ||
| + | print " | ||
| + | print " | ||
| + | open(IMG, $file) or die; | ||
| + | my $data; | ||
| + | print $data while read(IMG, $data, 16384)> | ||
| + | } | ||
| + | |||
| + | sub main() | ||
| + | { | ||
| + | my $uri = $ENV{REQUEST_URI} || ''; | ||
| + | $uri =~ s/ | ||
| + | $uri =~ s/\//,/g; | ||
| + | $uri =~ s/ | ||
| + | mkdir $tmp_dir, 0777 unless -d $tmp_dir; | ||
| + | mkdir " | ||
| + | |||
| + | my $img = $ENV{QUERY_STRING}; | ||
| + | if(defined $img and $img =~ /\S/) { | ||
| + | if($img =~ / | ||
| + | my $file = " | ||
| + | graph($graphs[$1]{seconds}, | ||
| + | send_image($file); | ||
| + | } | ||
| + | elsif($img =~ / | ||
| + | my $file = " | ||
| + | graph_err($graphs[$1]{seconds}, | ||
| + | send_image($file); | ||
| + | } | ||
| + | elsif($img =~ / | ||
| + | my $file = " | ||
| + | graph_grey($graphs[$1]{seconds}, | ||
| + | send_image($file); | ||
| + | } | ||
| + | elsif($img =~ / | ||
| + | my $file = " | ||
| + | graph_greydetail($graphs[$1]{seconds}, | ||
| + | send_image($file); | ||
| + | } | ||
| + | elsif($img =~ / | ||
| + | my $file = " | ||
| + | graph_queue($graphs[$1]{seconds}, | ||
| + | send_image($file); | ||
| + | } | ||
| + | else { | ||
| + | die " | ||
| + | } | ||
| + | } | ||
| + | else { | ||
| + | print_html; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | main; | ||
| + | </ | ||
| + | |||
| + | ==== Webaufruf ==== | ||
| + | Über unseren [[https:// | ||
| + | |||
| + | {{ : | ||
| ===== AWStats ===== | ===== AWStats ===== | ||
| Mit Hilfe zweier Perlscripte erstellen wir nun täglich einen Statusbericht über das was unserem MX widerfahren ist, und rufen später diese Information via Firefox/ | Mit Hilfe zweier Perlscripte erstellen wir nun täglich einen Statusbericht über das was unserem MX widerfahren ist, und rufen später diese Information via Firefox/ | ||
| Zeile 4234: | Zeile 4663: | ||
| * **[[http:// | * **[[http:// | ||
| - | ~~DISCUSSION~~ | + | |
| + | |||