사전작업이 필요함
php 에서 내부함수 snmp 를 이용하는 것이 아니고 ,
net-snmp 를 이용해서 사용하기 때문에,
/usr/ports/net-mgmt/net-snmp 에서
net-snmp 설치 후
php설치시 --with-snmp 옵션을 넣고 설치
php도 포트로 설치시에는 php5-extension 에서 snmp 체크하고 설치
RRDtool
http://oss.oetiker.ch/rrdtool/
# /usr/ports/databases/rrdtool12
# make config
[ ] PYTHON_MODULE
[ ] RUBY_MODULE
[x] PERL_MODULE
# make install clean
# rehash
# cd /usr/local/share/snmp/
# cp snmpd.conf.exmple snmpd.conf
# vi snmpd.conf
.... 중략
# sec.name source community
#com2sec local localhost COMMUNITY
#com2sec mynetwork NETWORK/24 COMMUNITY
com2sec public default public
####
# Second, map the security names into group names:
# sec.model sec.name
group public v1 public
group public v2c public
####
# Third, create a view for us to let the groups have rights to:
# incl/excl subtree mask
view all included .1
####
# Finally, grant the 2 groups access to the 1 view with different
# write permissions:
# context sec.model sec.level match read write notif
access public "" any noauth exact all none none
:wq!
Cacti
http://www.cacti.net
# mkdir -p /home/down/
# cd /home/down/
# fetch /www.cacti.net/downloads/cacti-0.8.7b.tar.gz
# tar -xvf cacti-0.8.7b.tar.gz
# cd cacti-0.8.7b
# ls
.... php file들 잔뜩 .... cacti.sql 파일하나가 있다.
cacti.sql 을 mysql에 임포트하기
# mysqladmin create cacti -uroot -p
Enter password:
// cacti 라는 디비 생성
# mysql cacti < cacti.sql -u root -p
Enter password:
// cacti DB 에 cacti 테이블 집어 넣기
# mysql mysql -u root -p
Enter password:
mysql> GRANT ALL ON cacti.* TO 유저@localhost IDENTIFIED BY '유저 패스워드';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
mysql> quit
# vi /home/down/cacti-0.8.7b/include/config.php
...
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "유저";
$database_password = "유저 패스워드";
$database_port = "3306";
...
// 데이터파일과 로그파일이 저장될 디렉토리인 rra 디렉토리와 log디렉토리의 퍼미션을 777로 설정
# chmod 777 rra log
// 다음으로 기본웹서버 디렉토리 아래에 cacti 혹은 원하는 디렉토리명으로 심볼릭링크를 걸어 둔다.
# ln -s /home/down/cacti-0.8.7b
/usr/local/server/apache/htdocs/cacti
// 웹브라우저를 이용 심볼링링크를 걸우둔 URL 접속
http://웹브라우저경로/cacti/
// 아니면 직접 url 밑으로 카피해서 경로 만들고 http로 접속
인스톨 화면 으로 >>

댓글목록
등록된 댓글이 없습니다.