溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

cacti安裝

發(fā)布時(shí)間:2020-04-08 23:26:13 來(lái)源:網(wǎng)絡(luò) 閱讀:289 作者:單成剛 欄目:移動(dòng)開發(fā)

安裝環(huán)境centos5.4 32位系統(tǒng)
安裝gcc庫(kù)

(1)apache
[root@localhost install]# rpm -e httpd --nodeps
[root@localhost install]# rpm -qa | grep openssl-devel
openssl-devel-0.9.8e-12.el5
[root@localhost install]# tar -zxvf httpd-2.2.15.tar.gz -C /usr/src/
[root@localhost install]# cd /usr/src/httpd-2.2.15/
[root@localhost httpd-2.2.15]# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-auth-digest --enable-cgi --with-ssl=/usr/lib --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/usr/local/apache/htdocs
[root@localhost httpd-2.2.15]#make
[root@localhost httpd-2.2.15]#make install
[root@localhost httpd-2.2.15]#cd /usr/local/apache/bin/
[root@localhost bin]# vim apachectl 
#!/bin/sh
# chkconfig: 35 85 15
# description: Apache is a Web Server
[root@localhost bin]# cp apachectl /etc/init.d/httpd
[root@localhost bin]# chmod +x /etc/init.d/httpd
[root@localhost bin]# chkconfig --add httpd
[root@localhost bin]# service httpd start
測(cè)試:
http://192.168.1.121
It works!


數(shù)據(jù)庫(kù)改成rpm mysql軟件
________________________________________________________________________________________________________________________________________________________
(2)mysql
2:安裝mysql
[root@localhost install]#rpm -qa | grep libtermcap-devel
libtermcap-devel-2.0.8-46.1
[root@localhost install]#rpm -e mysql --nodeps
[root@localhost install]# userdel -r mysql
[root@localhost install]# useradd -M -s /sbin/nologin mysql
[root@localhost install]# tar -zxvf mysql-5.1.47.tar.gz -C /usr/src/
[root@localhost install]# cd /usr/src/mysql-5.1.47/
[root@localhost mysql-5.1.47]# ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql
[root@localhost mysql-5.1.47]#make
[root@localhost mysql-5.1.47]#make install
[root@localhost mysql-5.1.47]#cp support-files/my-medium.cnf /etc/my.cnf
[root@localhost mysql-5.1.47]#/usr/local/mysql/bin/mysql_install_db --user=mysql
[root@localhost mysql-5.1.47]#chown -R root:mysql /usr/local/mysql/
[root@localhost mysql-5.1.47]#chown -R mysql /usr/local/mysql/var/
[root@localhost mysql-5.1.47]#echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
[root@localhost mysql-5.1.47]#ldconfig
[root@localhost mysql-5.1.47]#cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.1.47]#chmod +x /etc/init.d/mysqld
[root@localhost mysql-5.1.47]#chkconfig --add mysqld
[root@localhost mysql-5.1.47]#chkconfig mysqld on
[root@localhost mysql-5.1.47]#service mysqld start
[root@localhost mysql-5.1.47]#ps -e | grep mysqld
 3241 pts/0    00:00:00 mysqld_safe
 3344 pts/0    00:00:00 mysqld
[root@localhost mysql-5.1.47]#export PATH=$PATH:/usr/local/mysql/bin
[root@localhost mysql-5.1.47]#echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
[root@localhost mysql-5.1.47]#mysqladmin -u root password 123456
[root@localhost mysql-5.1.47]#mysql -u root -p
________________________________________________________________________________________________________________________________________________________



(3)php
安裝php
[root@localhost install]# yum -y install gd*
[root@localhost install]# yum -y install libpng*
[root@localhost install]# yum -y install libjpeg*
[root@localhost install]# yum -y install freetype*
[root@localhost install]# yum -y install libxml2*
[root@localhost install]# yum -y install libart_lgpl
[root@localhost install]# yum -y install fontconfig
[root@localhost install]# yum -y install jpeg
[root@localhost install]# yum -y install gettext
[root@localhost install]# yum -y install curl
[root@localhost install]# yum -y install zlib
[root@localhost install]# yum -y install glib
[root@localhost install]# yum -y install pixman
[root@localhost bin]# yum -y install pango

[root@localhost install]# tar -zxvf php-5.2.13.tar.gz -C /usr/src/
[root@localhost install]# cd /usr/src/php-5.2.13/
[root@localhost php-5.2.13]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-freetype-dir --with-jpeg-dir --with-png-dir --enable-sockets --with-zlib

[root@localhost php-5.2.13]#make
[root@localhost php-5.2.13]#make install
[root@localhost php-5.2.13]#cp php.ini-dist /usr/local/php/php.ini
[root@localhost php-5.2.13]#vim /usr/local/apache/conf/httpd.conf
 53 LoadModule php5_module        modules/libphp5.so
 54 AddType application/x-httpd-php .php
 167 <IfModule dir_module>
 168     DirectoryIndex index.php index.html
 169 </IfModule>

[root@localhost php-5.2.13]vim /usr/local/apache/htdocs/index.php
<?php
   echo phpinfo();
?>

[root@localhost php-5.2.13]service httpd stop
[root@localhost php-5.2.13]service httpd start

測(cè)試
http://192.168.1.124
PHP頁(yè)面


rrdtool
___________________________________________________________________________________________________________________________________________________
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
[root@localhost install]# rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
[root@localhost install]# yum -y install rrdtool*
(1/6): perl-rrdtool-1.4.7-1.el5.rf.i386.rpm                                                          
(2/6): lua-5.1.4-2.el5.rf.i386.rpm                                                                 
(3/6): ruby-1.8.5-24.el5.i386.rpm                                                                  
(4/6): rrdtool-devel-1.4.7-1.el5.rf.i386.rpm                                                        
(5/6): rrdtool-1.4.7-1.el5.rf.i386.rpm                                                                
(6/6): ruby-libs-1.8.5-24.el5.i386.rpm
___________________________________________________________________________________________________________________________________________________

(4)rrdtool
[root@localhost install]# tar -zxvf rrdtool-1.2.27.tar.gz -C /usr/src/
[root@localhost install]# cd /usr/src/rrdtool-1.2.27/
[root@localhost rrdtool-1.2.27]# ./configure --prefix=/usr/local --disable-python --disable-tcl
[root@localhost rrdtool-1.2.27]#make
[root@localhost rrdtool-1.2.27]#make install


(5)net-snmp
[root@localhost install]# tar -zxvf net-snmp-5.5.tar.gz -C /usr/src/
[root@localhost install]# cd /usr/src/net-snmp-5.5/
[root@localhost net-snmp-5.5]# ./configure --prefix=/usr/local/net-snmp --enable-developer
編譯過程中會(huì)回答幾個(gè)問題,由于目前大部分設(shè)備支持 SNMPV2,所以此處建設(shè)選擇 v2
Default version of SNMP to use (3): 2
System Contact Information (root@): scglinux@163.com
System Location (Unknown): beijing
Location to write logfile (/var/log/snmpd.log):
Location to write persistent information (/var/net-snmp):
[root@localhost net-snmp-5.5]# make
[root@localhost net-snmp-5.5]# make install
[root@localhost net-snmp-5.5]# cp python/netsnmp/tests/snmpd.conf /etc/
[root@localhost net-snmp-5.5]# ln -s /usr/local/net-snmp/sbin/* /usr/local/sbin
[root@localhost net-snmp-5.5]# ln -s /usr/local/net-snmp/bin/* /usr/local/bin
[root@localhost net-snmp-5.5]# /usr/local/sbin/snmpd -c /etc/snmpd.conf
[root@localhost net-snmp-5.5]# echo "/usr/local/sbin/snmpd -c /etc/snmpd.conf" >> /etc/rc.local
[root@localhost net-snmp-5.5]#
[root@localhost net-snmp-5.5]# netstat -lnput | grep snmp
udp        0      0 0.0.0.0:161                 0.0.0.0:*                               5855/snmpd

 
注明:如果不安裝net-snmp可能導(dǎo)致圖片不出來(lái)
[root@localhost net-snmp-5.5]# yum -y install net-snmp
[root@localhost net-snmp-5.5]# rpm -ivh net-snmp-utils-5.3.2.2-7.el5.i386.rpm
[root@localhost net-snmp-5.5]# chkconfig snmpd off

    
[root@localhost net-snmp-5.5]# snmpwalk -v 1 -c public localhost SNMPv2-MIB::system
SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::org
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (10436) 0:01:44.36
SNMPv2-MIB::sysContact.0 = STRING: G. S. Marzot <gmarzot@marzot.net>
SNMPv2-MIB::sysName.0 = STRING: localhost
SNMPv2-MIB::sysLocation.0 = STRING: beijing
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (2) 0:00:00.02
SNMPv2-MIB::sysORID.1 = OID: SNMP-MPD-MIB::snmpMPDMIBObjects.3.1.1
SNMPv2-MIB::sysORID.2 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB




----------------------------------------------------------------------------------------------------------------------------------------------------------
(6)cacti
[root@localhost install]# tar -zxvf cacti-0.8.7b-cn-utf8.tar.gz -C /usr/local/apache/htdocs/
[root@localhost install]# mv /usr/local/apache/htdocs/cacti-0.8.7b-cn-utf8 /usr/local/apache/htdocs/cacti
[root@localhost install]# cd /usr/local/apache/htdocs/
[root@localhost htdocs]# useradd cacti
[root@localhost htdocs]# chown cacti:cacti cacti/log cacti/rra
[root@localhost htdocs]# mysql -u root -p
mysql> create database cacti default character set utf8;
mysql> grant all on cacti.* to cacti@localhost identified by "cacti";
mysql>  flush privileges;
[root@localhost htdocs]# mysql -u cacti -p cacti < cacti/cacti.sql

[root@localhost htdocs]# vim cacti/include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";

cacti用戶設(shè)置任務(wù)計(jì)劃:
root@localhost htdocs]# su - cacti
[cacti@localhost ~]$ crontab -e
*/5 * * * * /usr/local/php/bin/php /usr/local/apache/htdocs/cacti/poller.php &> /dev/null
[root@localhost htdocs]# service crond restart
[root@localhost htdocs]# chkconfig crond on

tar -zxvf cacti-cactid-0.8.6k.tar.gz -C /usr/src/
cd /usr/src/cacti-cactid-0.8.6k
./configure --prefix=/usr/local/cactid --with-mysql=/usr/local/mysql --with-snmp=/usr/local/net-snmp
make
make install
cd /usr/local/cactid/etc/
vim cactid.conf
DB_Host         localhost
DB_Database     cacti
DB_User         cacti
DB_Pass         cacti
DB_Port         3306



http://192.168.1.151/cacti

/usr/local/cactid/bin/cactid
/usr/local/php/bin/php
/install/zysong.ttf



[root@localhost install]# tar -zxvf cacti-plugin-arch.tar.gz -C /usr/local/apache/htdocs/cacti/
[root@localhost install]# cd /usr/local/apache/htdocs/cacti/
[root@localhost cacti]# mysql -u cacti -p cacti < cacti-plugin-arch/pa.sql
[root@localhost cacti]# gunzip -c /install/cacti-plugin-0.8.7b-PA-v2.1-cn-utf8.diff.gz > PA-utf8.diff
[root@localhost cacti]# patch -p1 -N < PA-utf8.diff

[root@localhost cacti]# cd /usr/local/apache/htdocs/cacti/plugins
[root@localhost plugins]# tar -zxvf /install/monitor-0.8.2.tar.gz
[root@localhost plugins]# tar -zxvf /install/settings-0.5.tar.gz
[root@localhost plugins]# tar -zxvf /install/thold-0.3.9.tar.gz
[root@localhost plugins]# tar -zxvf /install/clog-1.21.tar.gz
[root@localhost plugins]# tar -zxvf /install/reportit_v061.tar.gz
[root@localhost plugins]# tar -zxvf /install/discovery-0.8.5.tar.gz

[root@localhost plugins]# mysql -u cacti -p cacti < thold/thold.sql
Enter password:cacti
[root@localhost plugins]# mysql -u cacti -p cacti < monitor/monitor.sql
Enter password: cacti
[root@localhost plugins]# mysql -u cacti -p cacti < discovery/discover.sql

[root@localhost plugins]# vim ../include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
$plugins = array ();
$plugins[] = "settings";
$plugins[] = "thold";
$plugins[] = "monitor";
$plugins[] = "clog";
$plugins[] = "discovery";
$plugins[] = "reportit";


測(cè)試:
http://192.168.1.120/cacti

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI