Cacti安裝教程

CentOS 6.0
架設流量監控及集中日志系統

第一章、cacti的安裝

1、 系統的基本設置
2、 設置主機名
3、 [root@localhost ~]# vi /etc/sysconfig/network
4、 [root@localhost ~]# exit
5、 重新登陸
6、 [root@GZ-Cacti ~]#
7、 安裝screen后臺運行程序
yum -y install screen
8、 安裝優秀的編輯器vim
yum -y install vim
9、 執行screen -S cacti進程進行安裝程序防止斷開遠程導致安裝中斷


10、 cacti所需組件
http
Mysql
mysql-server
Php
Php-mysql
Php-snmp
php-cli
php-common
Perl-DBD-MySQL
Php-pdo
rrdtool
Net-snmp
Net-snmp-libs
Net-snmp-utils
rrdtool
yum安裝這些組件
yum -y install httpd php php-mysql php-snmp php-cli php-common mysql mysql-server net-snmp net-snmp-libs net-snmp-utils php-pdo perl-DBD-MySQL rrdtool

#下載cacti
[root@GZ-cacti ~]# cd /home/
[root@GZ-cacti home]# wget?http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz

#解壓cacti
[root@GZ-cacti home]# tar xvf cacti-0.8.7g.tar.gz
#進入cacti文件夾,將里面的文件移動到/var/www/html/
[root@GZ-cacti home]# cd cacti-0.8.7g
[root@GZ-cacti cacti-0.8.7g]#
[root@GZ-cacti cacti-0.8.7g]# mv * /var/www/html/
#啟動apache及mysql服務
[root@GZ-cacti cacti-0.8.7g]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 61.140.3.66 for ServerName
[ OK ]
[root@GZ-cacti cacti-0.8.7g]# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[root@GZ-cacti cacti-0.8.7g]#

#并將apache、mysql及network加入自啟動

# chkconfig --level 35 httpd on
# chkconfig --level 35 mysqld on
#chkconfig network on

建立數據庫
mysql> create database cacti;
mysql> grant all privileges on cacti.* to?cactiuser@localhost?identified by 'cacti' with grant option;
mysql>flush privileges;

導入cacti數據庫
[root@GZ-cacti cacti-0.8.7g]# mysql -h localhost -u cactiuser -p cacti </var/www/html/cacti.sql
Enter password:
[root@GZ-cacti cacti-0.8.7g]#

修改cacti配置文件

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
$database_port = "3306";


#$cacti_session_name = "Cacti";

暫時關閉防火墻
/etc/init.d/iptables stop

檢查SELinux現時況態

要知到你現在是否使用 SELinux:

# getenforce
enforcing


關閉selinux
修改檔案/etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing

# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted.NETwork daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

把 SELINUX設定為disable, 下次啟動系統后將會停止SElinux。

# getenforce
disable



進入安裝界面
http://(cacti-ip)/install/index.php
確保每個路徑都正確點擊下一步完成安裝

安裝較高版本的cacti,在打開這里的時候可能會提示
ERROR: Your Cacti database login account does not have access to the MySQL TimeZone database. Please provide the Cacti database account "select" access to the "time_zone_name" table in the "mysql" database, and populate MySQL's TimeZone information before proceeding.

解決方法:
首先在bash環境下執行
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p 密碼 mysql

然后登陸mysql環境下
mysql> use mysql;
mysql> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
mysql> flush privileges;**


配置snmp
vi /etc/snmp/snmp.conf
(7)配置snmp
vi /etc/snmp/snmp.conf
#將下邊這行中的default
com2secnotConfigUser default public

#改為127.0.0.1
com2secnotConfigUser 127.0.0.1 Cacti

#將下邊這行中的systemview
access notConfigGroup "" any noauth exact systemview none none

#改為all
access notConfigGroup "" any noauth exact all none none

#將下邊這行的注釋“#”號去掉
#view all included .1 80

#重啟snmpd服務
service snmpd restart

用這個命令進行測試能抓取信息為配置正確
snmpwalk -v 1 localhost -c Cacti

安裝ntpdate并且停用自動更新
yum -y install ntpdate
/etc/init.d/ntpdate stop
chkconfig ntpdate off

以cacituser用戶增加入一個計劃任務,使得 cacti 每五分鐘生成一個監控圖表。
crontab -e

#加入如下內容。注意poller.php的路徑
*/5 * * * * php /var/www/html/poller.php > /dev/null 2>&1

時間同步命令,每十分鐘跟因特網同步時鐘
*/10 * * * * ntpdate 210.72.145.44 > /dev/null 2>&1
并將rra和log文件夾賦予cactiuser以讀寫權限,poller.php文件賦予cactiuser用戶運行權限
[cactiuser@localhost html]$ chmod 777 rra
[cactiuser@localhost html]$ chmod 777 log
[cactiuser@localhost html]$ chmod 755 poller.php

至此cacti安裝完成,稍等五分鐘刷新一下就可以出圖

?

本文出自 “明日靈感” 博客,請務必保留此出處http://coolner.blog.51cto.com/957576/688164

轉載于:https://www.cnblogs.com/fjping0606/p/4428958.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/375145.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/375145.shtml
英文地址,請注明出處:http://en.pswp.cn/news/375145.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

8086條件轉移指令JE,JZ

JZ/JE 指令格式 轉移條件 說明 JZ/JE 標號 ZF1 等于0或相等轉移code segment assume cs:codemov ax,2mov bx,2cmp ax,bxje ok ;如果axbx 進行轉移(其實是檢測ZF的值進行轉移操作);根據ZF1 得出axbx ,所以才有axbx 相等則轉移 iout: mov ax,4c00Hint 21H ok: add a…

單片機C語言下LCD多級菜單的一種實現方法

摘要: 介紹了在C 語言環境下,在LCD 液晶顯示屏上實現多級嵌套菜單的一種簡便方法,提出了一個結構緊湊、實用的程序模型。 關鍵詞: 液晶顯示屏; 多級菜單; 單片機; C 語言; LCD  中圖分類號:TP311. 1    文獻標識碼:B 收稿日期:2005 - 11 - 210  引言 由于C 語…

fortran語法筆記

1&#xff0c;數據類型&#xff0c;fortran支持整形&#xff0c;real型&#xff0c;logical型&#xff0c;char型&#xff0c;復數型。整形分為為長整形和短整形定義長整形的方法 同時聲明多個變量的話可以用逗號隔開。 加兩個冒號的話可以直接在聲明的時候賦值。 fortran是唯一…

8086條件轉移指令JNE,JNZ

JNZ/JNE 指令格式 轉移條件 說明 JNZ/JNE 標號 ZF0 不等于0或不相等轉移code segment assume cs:codemov ax,5mov bx,2cmp ax,bx ;兩數比較 不相等則轉移 jne ok iout: mov ax,4c00Hint 21H ok: add ax,bxjmp iout code ends endAX0005 BX0002 CX0013 DX0000 SP00…

8086條件轉移指令JE/JZ,JNE/JNZ

JE/JZ,JNE,JNZ檢測的只是ZF的值,只要ZF滿足則進行轉移 JE的邏輯含義是相等則轉移 但是JE進行操作的是ZF1才執行所有相等則轉移是通過CMP指令來配合使用體現出的CMP AX,BX ;ax-bx 結果是否為0 {true ,ZF1} {false ,ZF0} JE OK (ZF1說明兩數相等) (ZF…

git 使用手冊

git 作為開源項目首選版本管理軟件&#xff0c;必然其優勢不容小覷&#xff0c;下面總結一下初次解除用到的一些技能 1. 基本命令介紹 git help branch 查看branch幫助文檔 git branch -a 列出當前所有分支 git branch good_proj 創建分支good_proj git checkout good_p…

WZY社區

WZY社區是我自己做的一個網站&#xff0c;后面會詳細更新&#xff0c;敬請關注&#xff01;轉載于:https://www.cnblogs.com/jxldjsn/p/5146682.html

條件轉移指令和無條件轉移指令練習

無條件轉移指令 JMP條件轉移指令 JE JNE JB 低于轉移(小于) JNB 不低于轉移(大于等于) JA 高于轉移(大于) JNA不高于轉移(小于等于)查找出數據中0&#xff5e;9的無符號數寫到itable單元中 0&#xff5e;9 大于等于0 小于等于9 用JNB和JNA最合適不過了 貼代碼~assume cs:code,d…

UISearchBar控件

搜索&#xff0c;無疑可以使用UISearchBar控件&#xff01; 那就先了解一下UISearchBar控件吧&#xff01; UISearchBar控件就是要為你完成搜索功能的一個專用控件。它集成了很多你意想不到的功能和特點&#xff01; 首先&#xff0c;還是來普及一下UISearchBar控件API相關的屬…

BSA基礎數據維護

平臺 BSA基礎數據維護 。扇區五個字段的內容 本來值為0&#xff0c;經過107上計算解析&#xff0c;得出正常的數值。然后106上報&#xff08;200050&#xff09;&#xff0c;得到回復&#xff08;200051&#xff09;。 查看回復數據&#xff0c;是否有錯誤。比如提示104 基站拼…

事務 mysql redis

mysql 事務 start transaction; update ... insert ... create table的不行 rollback;//回滾 commit;//提交 redis 事務 multi incrby age 1 //age1 decrby age 2 //age-2 discard //取消執行 (discard 丟棄) exec //執行 ----------------------- watch keyName1 keyName2 ke…

繼續說invoke偽指令

.data ;數據段 titleS db helloworld,0 messageS db hello,welcome to win32,0.code ;代碼段 start: invoke MessageBox,NULL,offset messageS,offset titleS,MB_OK invoke ExitProcess,NULL end startMASM編譯下邊invoke 會把參數從右向左入棧并調用CALLinvoke MessageBox,NU…

織夢CMS AJAX分頁,可自定義typeid,調取任意內容

第一步&#xff1a; 把下面這段代碼放在html的 head之間 <script language"javascript" type"text/javascript" src"{dede:global.cfg_cmsurl/}/include/dedeajax2.js"></script> <script language"javascript"> &…

voa 2015 / 4 / 19

potentially – adv. capable of becoming real, a possibility tackle – v. to deal with a difficult problem; in sports, to bring someone down to the ground gap – n., the space between two people or things; a space from which something is missing轉載于:https…

API函數MessageBox的參數與返回值

Win32匯編函數的參數,參數類型,返回值都是一個dword類型(4字節) 返回值永遠放在EAX中,如超過4個字節則返回一個數據的指針(指向返回值存放的緩沖區地址).data titleS db helloworld,0 messageS db hello,welcome to win32,0.code start:invoke MessageBox,NULL,offset message…

新的征程

2015年4月2日&#xff0c;我來到了我新的東家。 來到這邊之后才發現我還真的是山里的農民來到了大城市。發現自己什么都不懂。而且 和 葉小釵 有一段時間一樣&#xff0c;工作和生活真的是擰到了一起&#xff0c;成了一段亂麻。周六周末一邊在找房租房搬家&#xff0c;但是新同…

Win32高級語法 條件測試語句與分支語句

.if 表達式1 .elseif 表達式2 .else 所以表達式為否 .endf ;if語句結束下面兩段程序分別使用匯編語法與高級語法對程序進行條件測試和分支, 彈出對話框當點擊"是"彈出對話框提示"click YES",點擊"否"彈出對話框提示"click No" 程序的…

Ubuntu 安裝php mcrypt

1 sudo apt-get install php5-mcrypt libmcrypt4 libmcrypt-dev 2 sudo php5enmod mcrypt 3 sudo /etc/init.d/apache2 restart 轉載于:https://www.cnblogs.com/fsong/p/5150415.html

The initialize list of C++ Class

性能問題之外&#xff0c;有些時場合初始化列表是不可或缺的&#xff0c;以下幾種情況時必須使用初始化列表 常量成員&#xff0c;因為常量只能初始化不能賦值&#xff0c;所以必須放在初始化列表里面 Error1(constchar* constmsg) :data(msg) { //data msg; } 引用類型&…

用 W32DASM看IF高級語法

W32DASM一個靜態調試工具 代碼段&#xff1a;.code start:invoke MessageBox,NULL,offset messageS,offset titleS,MB_YESNO.if eax 6invoke MessageBox,NULL,offset msgOk,offset tipS,MB_OK.elseinvoke MessageBox,NULL,offset msgNo,offset tipS,MB_OK.endifinvoke ExitPr…