Cacti流量监控系统安装配置
创始人
2024-07-24 05:31:01
0

  Cacti流量监控系统安装配置

  安装mysql

  1.   # useradd –g mysql mysql  
  2.  
  3.   #./configure –prefix=/usr/local/mysql –with-unix-socket-path=/tmp/mysql.sock –with-big-tables –enable-thread-safe-client –localstatedir=/data/mysql/data –with-named-curses-libs=/usr/lib/libncursesw.so.5  
  4.  
  5.   * 解决编译时configure: error: No curses/termcap library found的错误  
  6.  
  7.   # make && make install  
  8.  
  9.   # /usr/local/mysql/bin/mysql_install_db –user=mysql –datadir=/data/mysql/data  
  10.  
  11.   # cp /data/src/mysql-5.0.40/support-files/my-huge.cnf /etc/my.cnf  
  12.  
  13.   # /usr/local/mysql/bin/mysqld_safe –user=mysql –log-error=/data/mysql/mysql.error.log &  
  14.  

  安装apache

  1.   # ./configure –prefix=/usr/local/apache2 –enable-file-cache –enable-cache –enable-disk-cache –enable-mem-cache –enable-so -with-mpm=worker 
  2.  
  3.   # make && make install  
  4.  

  安装gd库

  1.   # yum -y install yum-fastestmirror  
  2.  
  3.   # yum -y install zlib-devel zlib  
  4.  
  5.   # yum –y install libpng-devel libpng  
  6.  
  7.   # yum –y install freetype-devel freetype  
  8.  
  9.   # yum –y install libjpeg-devel libjpeg  
  10.  
  11.   # yum –y install fontconfig-devel fontconfig  
  12.  
  13.   # yum –y install libxml2-devel libxml2 libxml2-python  
  14.  
  15.   # yum –y install gd-devel gd  
  16.  

  安装php

  1.   # cd /data/src/php-5.2.5  
  2.  
  3.   ./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-config-file-path=/usr/local/php/etc –with-mysql=/usr/local/mysql/ –with-gd –enable-gd-native-ttf –with-jpeg-dir –with-png-dir –with-ttf –with-zlib –with-freetype-dir=/usr/local/freetype/ –enable-mbstring –enable-sockets –with-snmp  
  4.  
  5.   # make && make install  
  6.  
  7.   # cp php.ini-dist /usr/local/php/lib/php.ini  
  8.  
  9.   # vi /usr/local/php/etc/php.ini  
  10.  
  11.   加入include_path = “/usr/local/php/lib/php”  
  12.  

  安装RRDtools

  1.   # yum –y install cairo*  
  2.  
  3.   # yum –y install pango*  
  4.  
  5.   # yum –y install libart_lgpl-devel  
  6.  
  7.   # cd /data/src/rrdtool-1.2.27  
  8.  
  9.   # ./configure –prefix=/usr/local/rrdtool  
  10.  
  11.   # make && make install  
  12.  

  设置cacti用户及安装目录

  1.   # useradd cacti  
  2.  
  3.   # wget http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz  
  4.  
  5.   # tar xvfz cacti-0.8.7b.tar.gz  
  6.  
  7.   # cp -rf /data/src/cacti-0.8.7b/* /data/cacti/  
  8.  

  安装cacti补丁

  1.   # wget http://www.cacti.net/downloads/patches/0.8.7b/upgrade_from_086k_fix.patch  
  2.  
  3.   # wget http://www.cacti.net/downloads/patches/0.8.7b/snmp_auth_none_notice.patch  
  4.  
  5.   # wget http://www.cacti.net/downloads/patches/0.8.7b/reset_each_patch.patch  
  6.  
  7.   # patch -p1 -N < /data/src/upgrade_from_086k_fix.patch  
  8.  
  9.   # patch -p1 -N < /data/src/snmp_auth_none_notice.patch  
  10.  
  11.   # patch -p1 -N < /data/src/reset_each_patch.patch  
  12.  
  13.   # chown -R cacti:cacti /data/cacti  
  14.  
  15.   # chmod 755 /data/cacti  
  16.  

  设置安装cacti数据库环境

  1.   # /usr/local/mysql/bin/mysql  
  2.  
  3.   mysql> create database cacti;  
  4.  
  5.   mysql> grant select, insert, update, delete, index, alter, create, lock tables, create temporary tables, drop, references on cacti.* to ‘cactiuser’@’localhost’ identified by ‘cactiuser’;  
  6.  
  7.   mysql> flush privileges;  
  8.  
  9.   # /usr/local/mysql/bin/mysql -u cactiuser -p cacti < /data/cacti/cacti.sql  
  10.  

  设置自动执行脚本

  1.   # crontab –u cacti –e  
  2.  
  3.   */5 * * * * /usr/local/php/bin/php /data/cacti/poller.php > /dev/null 2>&1  
  4.  

  apache配置文件安装

  1.   # vi /usr/local/apache2/conf/httpd.conf  
  2.  
  3.   ServerName 211.103.188.204  
  4.  
  5.   DirectoryIndex index.html index.php  
  6.  
  7.   Alias /cacti /data/cacti  
  8.  
  9.     
  10.  
  11.   AllowOverride None  
  12.  
  13.   Options None  
  14.  
  15.   Order allow,deny  
  16.  
  17.   Allow from all  
  18.  
  19.     
  20.  
  21.   AddType application/x-httpd-php .php .phtml  
  22.  
  23.   AddType application/x-httpd-php-source .phps  
  24.  
  25.   # /usr/local/apache2/bin/apachectl -k start  
  26.  
  27.   # vi /usr/local/apache2/logs/error_log  
  28.  
  29.   [Tue Jun 03 14:02:31 2008] [notice] caught SIGTERM, shutting down  
  30.  
  31.   [Tue Jun 03 14:04:01 2008] [notice] Apache/2.2.6 (Unix) PHP/5.2.6 configured — resuming normal operations  
  32.  

  安装cacti

  安装cacti程序

  rrdtool与php位置标红,指定php与rrdtool程序的正确路径即可。

  默认用户名admin 默认密码 Vale.com-init

  安装spine

  1.   # wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7a.tar.gz  
  2.  
  3.   # yum –y openssl-devel  
  4.  
  5.   # cd /data/src/cacti-spine-0.8.7a  
  6.  
  7.   # ./configure  
  8.  
  9.   # make && make install  
  10.  
  11.   # mkdir /usr/local/spine  
  12.  
  13.   # cp spine /usr/local/spine  
  14.  
  15.   # cp spine.conf /usr/loca/spine  
  16.  

  修改

  1.   configuration->setting->path->Alternate Poller Path,在Spine Poller File Path中填写/usr/local/spine/spine  
  2.  
  3.   configuration->setting-> Poller ,在Poller Type中选择spine  
  4.  

  设置安装中文字体

  下载微软雅黑字体

  1.   # cp /root/msyh.ttf /data/cacti  
  2.  

  在cacti控制面板上设置Configuration->Settings->Path,将RRDTool Default Font Path的内容设置为/data/cacti/msyh.ttf

  监控服务器snmp设置

  1.   # yum –y install net-snmp-libs net-snmp-devel net-snmp-perl net-snmp-utils net-snmp  
  2.  
  3.   # chkconfig –level 345 snmpd on  
  4.  
  5.   # vi /etc/snmp/snmpd.conf  
  6.  
  7.   #sec.name source community  
  8.  
  9.   com2sec local localhost valeftp  
  10.  
  11.   com2sec mynetwork 0.0.0.0/0 valeftp  
  12.  
  13.   com2sec public default valeftp  
  14.  
  15.   # sec.model sec.name  
  16.  
  17.   group local v1 local  
  18.  
  19.   group local v2c local  
  20.  
  21.   group local usm local  
  22.  
  23.   group mynetwork v1 mynetwork  
  24.  
  25.   group mynetwork v2c mynetwork  
  26.  
  27.   group mynetwork usm mynetwork  
  28.  
  29.   group public v1 local  
  30.  
  31.   group public v2c local  
  32.  
  33.   group public usm local  
  34.  
  35.   # incl/excl subtree mask  
  36.  
  37.   view mib2 included .iso.org.dod.internet.mgmt.mib-2 80  
  38.  
  39.   view all included .1 80  
  40.  
  41.   # context sec.model sec.level match read write notif  
  42.  
  43.   access local “” any noauth exact all all none  
  44.  
  45.   access public “” any noauth exact all none none  
  46.  
  47.   access mynetwork “” any noauth exact mib2 none none  
  48.  
  49.   syslocation Right here, right now.  
  50.  
  51.   syscontact Me   
  52.  
  53.   # service snmpd restart  
  54.  

  测试snmp

  1.   # snmpwalk –v2c –c valeftp 127.0.0.1 system测试本机  
  2.  
  3.   # snmpwalk –v2c –c valeftp RemoteIp system测试远程主机  

【编辑推荐】

使用Cacti监控你的网络-Cacti的监测点的创建(图)

Nagios监控数据库的方法

Cacti介绍(图)

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
Windows恶意软件20年“... 在Windows的早期年代,病毒游走于系统之间,偶尔删除文件(但被删除的文件几乎都是可恢复的),并弹...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...