Archive for the 'Technology' Category

exim, playing with mail queue in server

there are over thousand emails queue in our mail server, even though I have configured email frozen more than 10 days automatically delete/remove, but it seem like doesn’t work as expected.

here is the work around if you plan to do it manually.

start with listing email queue in the server, by using the command exim -bp, it will list all the email currently queue in the server. but my only concern is frozen email in the server, which I would like to manually clean it from the queue. let try something here,

exim -bp | grep frozen

18d 24K 1JhiI4-00096B-OW <> *** frozen ***
18d 2.3K 1JhiII-00097Y-8s <> *** frozen ***
16d 2.8K 1JhiKM-0009AL-9M <> *** frozen ***
15d 2.3K 1JhiLO-0009Bs-EF <> *** frozen ***
15d 2.5K 1JhiLS-0009Bx-O2 <> *** frozen ***
12d 2.7K 1JhiNm-0009S5-AQ <> *** frozen ***
10d 3.3K 1JhiPv-0009aN-Vu <> *** frozen ***
10d 24K 1JhiQ9-0009as-4R <> *** frozen ***

There are the emails currently queue in the server, and now you might want to check why did the email was queue in the server by exim -Mvl

2008-04-02 15:58:52 Received from <> H=(xxx.xxx.net) [202.76.234.132] P=esmtp S=2143 id=20080402075613.8287E22E8BB@xxx.xxx.net
2008-04-02 15:58:52 routing failed for rsvundet_2002@xxxx.com.my: User account not exist
*** Frozen (delivery error message)

If you want to remove all the email from queue more than 18 days, try this command;

exim -bp | grep 18d | awk ‘{ print $3 }’ | xargs exim -Mrm

Message 1JhiI4-00096B-OW has been removed
Message 1JhiII-00097Y-8s has been removed
Message 1JhiKM-0009AL-9M has been removed
Message 1JhiLO-0009Bs-EF has been removed
Message 1JhiLS-0009Bx-O2 has been removed
Message 1JhiNm-0009S5-AQ has been removed

some usefull queue commands:

-bp : Queue email in Server
-bpc : Count Queue email in Server
-M : Force delivery
-Mar : Add recipient
-Meb : Edit message body
-Mes : Edit sender
-Mf : Freeze message
-Mg : Give up (and bounce message)
-Mmad : Mark all recipients as delivered
-Mmd : Mark recipient as delivered
-Mrm : Remove message (no bounce)
-Mt : Thaw message
-Mvb : View message body
-Mvh : View message header
-Mvl : View message log

enjoy and happy cleaning queue email!

Links

Exim Cheat Sheet by bratthemad
Last update: 20080721

How to Use Wget to Download Manual from Website

Problem:

Download online manual from web pages for offline reading.

Solution:

wget –no-parent –mirror -p –convert-links -P ~/Documents/local-browsing http://www.some-website.com/howto/

OURMON Installation and Configuration on FreeBSD 7 with Multi-threading Support

OURMON is popular known as open source Network Monitoring and Anomaly Detection System. It’s very useful for a web hosting provider or Internet Service Provider to study their network behavior and detection for any network attack such as DoS or DDoS.

Beside study your network behavior, it also can analyze your network protocols activities, tcp w0rm activity, p2p activity and etc.

Here is the step by step OURMON installation and configuration on FreeBSD with multi-threading support.

OUR source package can be downloaded on official sourceforget download page. I strongly suggest that do not install OURMON from port (due to the update on the package is quite slow), but before proceed on OURMON source install, there are several dependencies need to be installed;

PCRE

cd /usr/ports/devel/pcre && make install clean distclean

libpcap

cd /usr/ports/net/libpcap && make install clean distclean

RRDTool

cd /usr/ports/databases/rrdtool && make install clean distclean

Apache Web Server

cd /usr/ports/www/apache20 && make install clean distclean

OURMON Installation and Configuration

After above dependencies has been installed, now we proceed with OURMON installation and configuration;

untar yor ourmon package and your will see a folder name mrourmon. Copy the folder to /usr/local;

cp -rf mrourmon /usr/local/

In order to enable multi-threading support, there are some changes need to be made on your OURMON’s Makefile.

cd /usr/local/mrourmon/src/ourmon
vi Makefile.bsd

On line 27 and 30, uncomment the line which look like below;

CFLAGS=-O4 -DBSD -DTHREAD
LFLAGS=-O4 -static -DTHREAD

Also on line 18, change the BINDDIR to the directory that we are going to install ourmon;

BINDIR=/usr/local/mrourmon/bin

After that, save the file and we are ready to roll, go to OURMON root directory and run configure.pl for installation;

cd /usr/local/mrourmon
./configure

Follow the on screen guide to go through the installation, after ourmon is install, we are ready to fire it up… But there are minor changes need to be made in order to support multi-threading. Open up ourmon start up file and make the below changes;

vi /usr/local/etc/rc.d/ourmon.sh

On line 11, add extra argument (-T 2 ) into OURMON launch command and it will look like this;

/usr/local/mrourmon/bin/ourmon -T 2 -a 30 -s 256 -f /usr/local/mrourmon/etc/ourmon.conf -i bce1 -D /usr/local/mrourmon/tmp &

the argument -T 2 is to spawn 2 ourmon processes, if you have more processor on your server, you might want to add more; after that monitor on your server load, see whether it will crash your server or not ;)

Run top command and monitor on your server load.

.

Apache Configuration

By default, OURMON web html files are located at /usr/local/www/data/ourmon, we suggest that you setup virtualhost to access to OURMON from your web browser;

NameVirtualHost *:80

ServerAdmin sysadm@systems.takizo.com
ServerName ourmon.systems.takizo.com

DocumentRoot /usr/local/mrourmon/web.pages


AllowOverride All
Order Deny,Allow
Deny from all
Allow from 202.188.1.5 # only allow authorized IP Address to access your OURMON.

ErrorLog /var/log/ourmon-error_log
CustomLog /var/log/ourmon-access_log common

You might also interest to change the viewing of OURMON site at your own convenience at /usr/local/www/data/ourmon/index.html, remember to make a copy before you make any changes.

Below are some graph that shown on our OURMON page;

AIMS Data Centre joins Asia’s Leading Data Centres in forming Data Centre Alliance

This morning we got a memo or enlighten announcement from Marketing & Communications; Which is one of the good news for AIMS Data Centre, below is the quote from the memo;

Kuala Lumpur, 18 June 2008 - Four of South East Asia’s leading data centres namely Malaysia’s The AIMS Asia Group, Singapore’s 1-Net Singapore, Vietnam’s CMC Telecom and Thailand’s TCC Technology (TCCT) announced today the signing of a Memorandum of Understanding (MOU) to form a Data Centre Alliance to meet acute data centre requirements in the region. Together, the data centres within the Alliance will form a one-stop Hub that provides a full suite of services and connectivity.

With a combined space of more than 500,000 square feet and a projected annual turnover of approximately RM240 million by 2009, the Alliance will become one of the biggest data centre operators in the region catered for first-tier telcos, government agencies, banks and other businesses.

After Unity Consortium, this is another great move for our Data Centre to go further in international Data Centre business. Looking forward for more good news this year.

MOU Signing Ceremony

ssh dynamic port tunnelling

useful when using insecure links with a ssh server you can access :

ssh -ND<port on localhost> username@remote-ssh-server

e.g. ssh -ND8080 myusername@192.168.1.1

*** when using firefox, only specify “localhost” in SOCKS Host, port “8080″ & choose “SOCKS 5″ in “connection settings” and leave the other settings blank.

Next Page »