linux下cacti的搭建之詳細過程!
cacti 安裝流程
#配置環境CentOS release 6.4 (Final) 2.6.32-358.el6.i686
yum -y wget install rpm-build crontabs httpd* mysql* php* libart_lgpl* net-snmp* libtool gcc gcc-c++ –skip-broken
在安裝期間,發現連線斷開了,ssh也允許了,發現,虛擬機器中動態獲取的ip,發生了變化!重連.
mkdir -p /data0/soft/cacti
cd /data0/soft/cacti
yum install rrdtool ntpdate -y
ntpdate asia.pool.ntp.org
#因為cactid 與spine功能一樣,先不安裝cactid
wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8a.tar.gz
tar zxvf cacti-spine-0.8.8a.tar.gz
cd cacti-spine-0.8.8a
./configure
make && make install
cp /usr/local/spine/etc/spine.conf.dist /etc/spine.conf
在這裡將原來的snmpd.conf檔案,備份下!
echo “com2sec notConfigUser default 000123a” > /etc/snmp/snmpd.conf
echo “group notConfigGroup v1 notConfigUser” >> /etc/snmp/snmpd.conf
echo “group notConfigGroup v2c notConfigUser” >> /etc/snmp/snmpd.conf
echo “view systemview included .1.3.6.1.2.1.1” >> /etc/snmp/snmpd.conf
echo “view systemview included .1.3.6.1.2.1.25.1.1” >> /etc/snmp/snmpd.conf
echo “access notConfigGroup “” any noauth exact all none none” >> /etc/snmp/snmpd.conf
echo “view all included .1 80” >> /etc/snmp/snmpd.conf
echo “syslocation Unknown (edit /etc/snmp/snmpd.conf)” >> /etc/snmp/snmpd.conf
echo “syscontact Root (configure /etc/snmp/snmp.local.conf)” >> /etc/snmp/snmpd.conf
service snmpd restart
chkconfig –level 2345 snmpd on
chkconfig –level 2345 httpd on
chkconfig –level 2345 mysqld on
/etc/init.d/httpd restart
/etc/init.d/mysqld restart
cd /data0/soft
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar xvf cacti-0.8.8a.tar.gz
mkdir -p /var/www/cacti
mv -f cacti-0.8.8a/* /var/www/cacti
cd /var/www/cacti
#編輯include/global.php 第47行 修改$url_path = “/cacti/”; 為$url_path = “/”;
cacti_Dir=/var/www/cacti
[root@gjp cacti]# scp -P 2121 bj04.lonlife.net:/var/www/cacti/graphs_new_batch.php ./
sed -i `s#Cacti#`$HOSTNAME`#` $cacti_Dir/include/top_header.php
sed -i `s#Cacti#`$HOSTNAME`#` $cacti_Dir/graphs_new_batch.php
sed -i `s#Cacti#`$HOSTNAME`#` $cacti_Dir/include/auth.php
sed -i `s#Cacti#`$HOSTNAME`#` $cacti_Dir/include/top_graph_header.php
sed -i `s#Cacti#`$HOSTNAME`#` $cacti_Dir/install/index.php
sed -i `s#Cacti#`$HOSTNAME`#` $cacti_Dir/lib/graph_export.php
[root@gjp cacti]# scp -P 2121 bj04.lonlife.net:/home/testbj03/www/cacti/graph_xport2.php ./
root@bj04.lonlife.net`s password:
graph_xport2.php 100% 3554 3.5KB/s 00:00
echo “10 0 * * * /usr/bin/php /var/www/html/graph_xport2.php” >> /var/spool/cron/root
#編輯/etc/php.ini 檔案 設定date.timezone = `Asia/Shanghai`
echo `create database cacti;
grant all on cacti.* to cactiuser@localhost identified by “cactiuser”;
use cacti
source /var/www/cacti/cacti.sql` | mysql
cacti_dir=/var/www/cacti
useradd -d $cacti_dir cacti
chown cacti:cacti -R $cacti_dir
chmod 755 -R $cacti_dir
chmod 777 -R $cacti_dir/rra
sed -i `s#Listen 443##` /etc/httpd/conf.d/ssl.conf
sed -i `s#Listen 80#Listen 1080#` /etc/httpd/conf/httpd.conf
sed -i `s#AddDefaultCharset UTF-8#AddDefaultCharset off#` /etc/httpd/conf/httpd.conf
sed -i `s#/var/www/html#/var/www/cacti#g` /etc/httpd/conf/httpd.conf
sed -i `s#128M#1024M#` /etc/php.ini
sed -i “s#{#{
size=10M
rotate 4#g” /etc/logrotate.d/httpd
sed -i “s#/var/www/html#/var/www/cacti#g” /etc/httpd/conf/httpd.conf
[root@gjp cacti]# vim /etc/httpd/conf/httpd.conf
echo “*/5 * * * * /usr/bin/php $cacti_dir/poller.php > /dev/null 2>&1” >> /var/spool/cron/cacti
注意php.ini裡時區要跟系統時區一直(系統時區在/etc/sysconfig/clock)
rra資料夾下檔案要是cacti使用者許可權
與上面是一個圖,只要出現FILE FOUND 就ok
預設使用者名稱和密碼:admin
這裡修改為123456
在這裡,進行如下修改:
settings > Paths > Spine Poller File Path > /usr/local/spine/bin/spine
Poller > Poller Type > spine
Import/Export > Import Templates > adv-ping見附件
匯入成功:
Management > Devices > Host Template 選擇 ucd/net SNMP Host > SNMP Options > Version2 > SNMP Community 000123a > save
Management > Devices > 選擇伺服器 > Create Graphs for this Host > 勾上啟用的網路卡號 如 eth0/eth1 > create
建立ping監控
http://xxxx.lonlife.net:1080/graphs_new_batch.php > 建立到要求ip的監控
例如:
cacti 每5分鐘抓取下資料,現在資料已經呈現:
本文轉自 gjp0731 51CTO部落格,原文連結:http://blog.51cto.com/guojiping/1289379
相關文章
- MySQL MHA詳細搭建過程MySql
- cacti+nagios 之cacti的搭建(-)iOS
- 新手搭建雲伺服器詳細過程伺服器
- MySQL MGR單主模式詳細搭建過程MySql模式
- linux下cacti監控平臺的搭建Linux
- 深入理解Fabric環境搭建的詳細過程
- linux下安裝zsh和p10k的詳細過程Linux
- Hexo的詳細搭建過程——小白的血淚經歷QAQHexo
- 搭建yarn(hadoop-2.2.0)環境詳細過程YarnHadoop
- 泊松過程的詳細理解
- SecureCRT的下載、安裝( 過程非常詳細!!值得檢視)Securecrt
- linux之cacti使用Linux
- Oracle 11g在RHEL 6.4下的詳細安裝過程Oracle
- 搭建cacti
- (馬世龍)Linux下CACTI完全搭建技術文件二Linux
- Linux下MySQL/MariaDB Galera叢集搭建過程LinuxMySql
- nginx配置https詳細過程NginxHTTP
- centos7安裝的詳細過程CentOS
- 原創:oracle 授權的詳細過程Oracle
- oracle 的DML命令的詳細處理過程Oracle
- CentOS6下Cacti搭建文件CentOS
- cacti+nagios之nagios的搭建(三)iOS
- Linux系統CentOS6.2版本下安裝JDK7詳細過程LinuxCentOSJDK
- mac系統下nginx的詳細安裝過程及使用(適合新手)MacNginx
- Windows下OpenCV4.3.0+MinGW64+Cmake具體過程【詳細】WindowsOpenCV
- 入門 | Tensorflow實戰講解神經網路搭建詳細過程神經網路
- 超詳細的ArrayList擴容過程(配合原始碼詳解)原始碼
- 常見下載方式之BT下載實現過程詳解
- 詳細說明搜尋引擎優化的過程優化
- MySQL主從複製的詳細過程介紹MySql
- Spring BeanFactory例項化Bean的詳細過程SpringBean
- ESXI 6.7 系統安裝詳細過程
- mysql5.7.23安裝詳細過程MySql
- Webpack安裝配置及打包詳細過程Web
- 詳細瞭解 synchronized 鎖升級過程synchronized
- oracle 11G RAC 建立詳細過程Oracle
- Oracle->Mysql dblink 建立詳細過程OracleMySql
- Hadoop2.3.0詳細安裝過程Hadoop