11月 15

Step 1 檢查各種必須的套件有無安裝:

rpm -qa | grep perl
rpm -qa | grep zlib
rpm -qa | grep gd
rpm -qa | grep libpng
rpm -qa | grep net-snmp
rpm -qa | grep mrtg

Step 2 修改snmp的設定檔 /etc/snmp/snmpd.conf

用vi 將 /etc/snmp/snmpd.conf檔打開.

找到
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1

在中間加上一行 變成以下這樣
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.2
view systemview included .1.3.6.1.2.1.25.1.1

Step 3 在視窗環境中的” 服務 “中啟動snmp.
chkconfig –add snmpd
chkconfig –level 35 snmpd on

Step 4 產生 /etc/mrtg/mrtg.cfg

這一點是在 Fedora Core 5中最大不同的地方,不可用 cfgmaker public@70.66.38.252 〉 /etc/mrtg/mrtg.cfg 這個指令了,會發生錯誤訊息,所以要改用下列這一個指令才行。

cfgmaker 70.66.38.252 〉 /etc/mrtg/mrtg.cfg

70.66.38.252為自己的網站 I.P

Step 5 修改mrtg.cfg檔內容

用vi 將 /etc/mrtg/mrtg.cfg檔打開.

在檔案的尾端加上列文字:

Workdir: /var/www/html/mrtg
Refresh: 300
Interval: 5
Language: big5
Options[_]: growright

Step 6 在視窗環境中的” 終端機”中執行下列指令

env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

若無錯誤訊息就是成功了.

Step 7 修改vi /etc/httpd/conf.d/mrtg.conf如下

#Alias /mrtg /var/www/mrtg
Alias /mrtg /var/www/html/mrtg

〈Location /mrtg〉
Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# Allow from ::1
# Allow from .example.com
〈/Location〉

在視窗環境中的” 服務 “中重新啟動httpd

Step 8 用網頁瀏覽器看MRTG的統計圖表

打開瀏覽器 連到http://70.66.38.252/mrtg/70.66.38.252_2.html
就可以看到成果了.

Step 9 產生MRTG索引頁

若有多個機器要監控,可以用索引頁來放置多個機器的圖表

在視窗環境中的” 終端機”中執行下列指令

cd /var/www/html/mrtg

indexmaker /etc/mrtg/mrtg.cfg 〉 index.html

打開瀏覽器 連到 http://70.66.38.252/mrtg 就可以看到成果了

11月 12
sendMsg: Sending messages using PHP
icon1 ken666 | icon2 未分類 | icon4 11 12th, 2007 @ 07:11 pm| icon3沒有留言 »

http://downloads.fanatic.net.nz/dev/php/sendMsg.zip

sendMsg is a class which allows you to send a message to a contact from a specified account. It logs in, changes status to online, creates a new IM session with the target user, sends the message and ends both connections.

$sendMsg = new sendMsg();

$sendMsg->login(’sender@hotmail.com’, ‘password’);

$sendMsg->createSession(’recipient@hotmail.com’);

$sendMsg->sendMessage(’message’, ‘Times New Roman’, ‘FF0000′);

$sendMsg = new sendMsg();

$sendMsg->login(’sender@hotmail.com’, ‘password’);

$sendMsg->createSession(’recipient@hotmail.com’);

$sendMsg->sendMessage(’this is the first message’);
$sendMsg->sendMessage(’this is the second message’);
$sendMsg->sendMessage(’this is the third message’);

11月 8
Color Game !
icon1 ken666 | icon2 未分類 | icon4 11 8th, 2007 @ 07:11 am| icon3沒有留言 »

Play color game with someone far away in the world
http://paintpoker.net