歡迎你
各類文章如有侵犯智慧財產權請來信告知--------607@dlps.tp.edu.tw
設定snmpd.conf
作者:tseng 日期:2009-03-31
# Here is a commented out example configuration that allows less
# restrictive access.
# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
## sec.name source community
com2sec local localhost public
com2sec mynetwork 192.168.100.0/24 public
# 註﹕請將 192.168.100.0/24 改為您機器目前所在的 network 範圍。
## group.name sec.model sec.name
group MyRWGroup v1 local
group MyROGroup v2c mynetwork
#
#group MyRWGroup any otherv3user
#...
## incl/excl subtree mask
view all included .1 80
## -or just the mib2 tree-
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
## context sec.model sec.level prefix read write notif
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none
cacti install centos5.2
作者:tseng 日期:2009-03-30
httpd-2.2.3-11、php-5.1.6-15、mysql-5.0.22-2.2
cacti-0.8.7b-2、net-snmp-5.3.1-19、rrdtool-1.2.23-1
rpm -ivh cacti-0.8.7b-2.el5.rf.noarch.rpm
rpm -ivh cacti-docs-0.8.7b-2.el5.rf.noarch.rpm
以上套件用rpm或yum安裝
2.安裝與設定 Cacti
mysqladmin -u root -p create cacti
mysql -u root -p -A cacti < /var/www/html/cacti/cacti.sql
編輯 cacti 設定檔
vi /var/www/cacti/include/config.php
修改以下四行
$database_default = "cacti"; //資料庫名稱
$database_hostname = "localhost"; //資料庫位置
$database_username = "cactiuser"; //資料庫使用者名稱
$database_password = "cactiuser"; //資料庫使用者密碼
設定資料庫
mysql> grant all privileges on cacti.* to cactiuser@localhost identified by ‘cactiuser’;
mysql> flush privileges;
mysql> exit
設定apache
vi /etc/httpd/conf.d/cacti.conf
vi /etc/httpd/conf/http.conf
Alias /cacti/ /var/www/cacti/
<Directory /var/www/cacti/>
DirectoryIndex index.php
Options -Indexes
AllowOverride all
order deny,allow
deny from all
allow from 127.0.0.1
allow from 192.168 <= 追加
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
</Directory>
cacti定期執行
/etc/cron.d/cacti
*/5 * * * * cacti php /var/www/cacti/poller.ph...
錯誤訊息
作者:tseng 日期:2009-03-28
1.
checking for pcap_lookupdev in -lpcap... no
*** FATAL ERROR ***
It looks that you don't have the libpcap distribution installed.
Download, compile and, optionally, install it.
When finished please re-run this program.
You can download the latest source tarball at http://www.tcpdump.org/
configure: error: The LBL Packet Capture Library, libpcap, was not found!
error: Bad exit status from /var/tmp/rpm-tmp.85176 (%build)
ntop安裝用rpm較為簡單,或用YUM
rrdtool
ntop
作者:tseng 日期:2009-03-27
1. yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-deve libpcap-devel
2.install RRDtool
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.5.tar.gz
3.Install Ntop
cd /usr/local/src/
tar -zxvf ntop-3.3.9.tar.gz
cd ntop-3.3.9
./autogen.sh --prefix=/usr/local/ntop-3.3.9
make
make installuseradd -M -s /sbin/nologin -r ntop
chown -R ntop.ntop /usr/local/ntop-3.3.9/share/ntop
cd /usr/local/
ln -s ntop-3.3.9 ntop
4.Start Ntop
簡易版本
samba
作者:tseng 日期:2009-03-13
[global]
dos charset = cp950
unix charset = utf8
display charset = utf8
workgroup = CC1
server string = Samba %v
passdb backend = tdbsam
log file = /var/log/samba/%m.log
max log size = 50
cups options = raw
[homes]
comment = Home Directories
valid users = %S
read only = No
create mask = 0664
directory mask = 0775
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[public]
comment = Public Stuff
path = /home/public
valid users = @users
read only = No
guest ok = Yes
exif
作者:tseng 日期:2009-03-11
"exiftool(-all).exe" *.jpg
exiftool官方網站網址: http://www.sno.phy.queensu.ca/~phil/exiftool/
php.ini
register_long_arrays = On
Tags: exif
停電
作者:tseng 日期:2009-03-05
使用 PHP
作者:tseng 日期:2009-03-05
~/.bashrc
作者:tseng 日期:2009-03-02
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
PATH="/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
PATH="$PATH":/usr/X11R6/bin:/home/dmtsai/bin
LANG=zh_TW.big5
LC_TIME=C
export PATH LC_TIME LANG
umask 022
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'