| 
 | 
 
 
套件說明: Imspector 是一套 IM Proxy ,支援 MSN ICQ YAHOO IRC 的通訊協定, 通常安裝於NAT主機上 
官方網址: http://www.imspector.org/ 
 
我的測試平台: 
OS: CentOS 4.4 
 
1. 先下載 http://www.imspector.org/downloads/imspector-0.3.tar.gz 
2. 解壓縮  tar zxf imspector-0.3.tar.gz ; cd imspector-0.3/ 
3. 若要支援 MYSQL 或 SQLITE請依需求自行修改 Makefile 的這一行 (我只有使用 mysql ) 所以我改成 ADD_PLUGINS = mysqlloggingplugin.so 
4. make && make install 
5. 設定檔在 /usr/etc/imspector/imspector.conf 請依需求自行修改要監控的協定和 MySQL 的設定 
6. 建立一個 database ,名稱同設定檔內的名稱, 內容如下:-  
 
 - CREATE TABLE `messages` (
 
 -    `id` int(11) NOT NULL auto_increment,
 
 -    `timestamp` int(11) NOT NULL default '0',
 
 -    `protocolname` text NOT NULL,
 
 -    `type` int(11) NOT NULL default '0',
 
 -    `localid` text NOT NULL,
 
 -    `remoteid` text NOT NULL,
 
 -    `eventdata` blob NOT NULL,
 
 -    PRIMARY KEY  (`id`)
 
 - ) ENGINE=MyISAM AUTO_INCREMENT=1929 DEFAULT CHARSET=utf8;
 
 
  複製代碼 
7. shell> imspector -c /usr/etc/imspector/imspector.conf 執行 
8. 將 IM 的連線導到 imspector ( 預設 tcp 16667 ) 
   MSN: iptables -t nat -A PREROUTING -p tcp --destination-port 1863 -j REDIRECT --to-ports 16667  
   ICQ/AIM: iptables -t nat -A PREROUTING -p tcp --destination-port 5190 -j REDIRECT --to-ports 16667  
   Yahoo: iptables -t nat -A PREROUTING -p tcp --destination-port 5050 -j REDIRECT --to-ports 16667  
   IRC: iptables -t nat -A PREROUTING -p tcp --destination-port 6667 -j REDIRECT --to-ports 16667 
9. 到 /var/log/imspector 下可以看到 IM 的對話 LOG 
10. 官方並未提供web的介面來查詢觀看對話, 這部分要自己寫程式去資料庫裡面撈資料 
 
我實測過 MSN 及 Yahoo即時通確定都可以正常, ICQ 和 IRC 我沒用過, 但應該也OK 
 
附件 imspector_eric.tgz 為朋友 eric 幫寫的簡單 web 查詢介面, 連結在下面 
 
http://www.badongo.com/file/3325015 
 
FROM:酷學園 |   
 
 
 
 |