Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Postfix

Installing Sendmail Analyzer on RHEL/CentOS

Submitted by on March 11, 2013 – 11:35 pm One Comment

The Sendmail Analyzer can be useful for visualizing your Sendmail/Postfix log. The commands below can be copy-pasted as root on default installations of RHEL and CentOS 5/6 with default Postfix and httpd. If your configuration is customized, just use these commands as a guide and make adjustments as needed.

Take note of the “Allow from all” directive in the httpd.conf configuration. Depending on your network security configuration, you may restrict this to specific subnets (i.e. “Allow from 198.162.1.0/24”.

sendmail_report

cd /tmp
yum -y install perl-GD
yum -y install perl-GD-Graph3d
wget "http://downloads.sourceforge.net/project/sa-report/sa-report/8.7/sendmailanalyzer-8.7.tar.gz"
tar xvfz sendmailanalyzer-8.7.tar.gz
cd sendmailanalyzer-8.7/
perl Makefile.PL
make && make install
/usr/local/sendmailanalyzer/sendmailanalyzer -f
/usr/local/sendmailanalyzer/sa_cache
cat << EOF >> /etc/httpd/conf/httpd.conf
Alias /sareport /usr/local/sendmailanalyzer/www
        <Directory /usr/local/sendmailanalyzer/www>
            Options ExecCGI
            AddHandler cgi-script .cgi
            DirectoryIndex sa_report.cgi
            Order deny,allow
            Deny from all
            Allow from all
        </Directory>
EOF
service httpd restart
cd /tmp/sendmailanalyzer-8.7/start_scripts
chown root:root *
chmod 755 *
cp -p sendmailanalyzer /etc/init.d/sendmailanalyzer
chkconfig --add sendmailanalyzer
service sendmailanalyzer restart
echo << EOF >> /var/spool/cron/root
#
# SendmailAnalyzer log reporting daily cache
0 */1 * * * /usr/local/sendmailanalyzer/sa_cache > /dev/null 2>&1
#
EOF
service crond restart

 

Print Friendly, PDF & Email

One Comment »

  • Aas says:

    I would like to add a 2nd way to install sendmailanalyzer on

    RHEL/CentOS via RPM package.

    yum install rpm-build
    wget “http://downloads.sourceforge.net/project/sa-report/sa-report/8.7/sendmailanalyzer-8.7.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsa-report%2F&ts=1363055890&use_mirror=iweb”
    mkdir -p ~/rpmbuild/{SOURCES,SPECS}
    tar xf sendmailanalyzer-8.7.tar.gz -C ~/rpmbuild/SPECS –strip-components=3 sendmailanalyzer-8.7/packaging/RPM/sendmailanalyzer.spec
    cd ~/rpmbuild/SPECS/
    rpmbuild -bb sendmailanalyzer.spec
    yum localinstall ../RPMS/noarch/sendmailanalyzer-8.7-1.el6.noarch.rpm

    Uncomment the following line in /etc/cron.d/sendmailanalyzer
    0 1 * * * root /usr/bin/sa_cache > /dev/null 2>&1

    Uncomment /etc/httpd/conf.d/sendmailanalyzer.conf and add place from where you wish to acces the reports
    Allow from

    service httpd reload
    service sendmailanalyzer start
    chkconfig sendmailanalyzer on

    Ihope this helps someone, like your recipe helped me.
    Regards,
    Aas.

1 Pingbacks »

Leave a Reply to Analiza Sendmail logova – SendmailAnalyzer | Linux, Kuhinja i još mnogo toga Cancel reply

%d bloggers like this: