2012/11/24

clinet snmp install


CentOS

yum -y install net-snmp
#install tools
#yum -y install net-snmp-utils

# setup secret
echo 'rocommunity  XXXXXX' >> /etc/snmp/snmpd.conf
# setup snmp proxy
# squid sample
# proxy -v 1 -c public 127.0.0.1:3401 .1.3.6.1.4.1.3495

chkconfig snmpd on
service snmpd start



Ubuntu Server


apt-get install snmpd
#mv /etc/snmp/snmpd.conf snmpd.conf.old
#vim /etc/snmp/snmpd.conf
#rocommunity  XXXXXX  "ip address" (from monitor)
echo 'rocommunity  XXXXXX "ip address" (from monitor) ' >> /etc/snmp/snmpd.conf
sudo /etc/init.d/snmpd restart

2012/11/23

Cacti install note

0.
yum install -y httpd php php-mysql php-snmp php-xml mysql mysql-server cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel net-snmp-utils gcc wget man make perl-CPAN perl-ExtUtils-MakeMaker perl-ExtUtils-MakeMaker-Coverage crontabs xorg-x11-fonts-100dpi xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi ntp php-gd rrdtool

1.


fc-cache -vfs
mysqladmin --user=root password mypassword
mysqladmin --user=root --password reload

# Install and Configure Cacti
mkdir -p /var/www/html/cacti
cd /var/www/html/
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar zxvf cacti-0.8.8a.tar.gz
mv cacti-0.8.8a cacti
cd cacti
cd /var/www/html/cacti/cacti-0.8.8a

2.
service mysqld start
chkconfig mysqld on

#import Cacti SQL
mysqladmin -u root -p  mypassword create cacti
mysql -u root -pmypassword cacti < cacti.sql
mysql -u root -pmypassword

# MySQL command
mysql> GRANT ALL ON cacti.* TO admin@localhost IDENTIFIED BY 'adminpassword';
mysql> flush privileges;


3.

更改config.php成我們MySQL的username, password與url path,如下:

vi include/config.php
$database_username = "admin";
$database_password = "adminpassword";
$url_path = "/cacti/";

4.

更改目錄權限
chown -R apache:apache /var/www/html/cacti
chown -R admin /var/www/html/cacti/rra/ /var/www/html/cacti/log/

5.

crontab -e
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1

service crond restart
service httpd start
chkconfig httpd on