Linux下Cacti安装与配置.doc_第1页
Linux下Cacti安装与配置.doc_第2页
Linux下Cacti安装与配置.doc_第3页
Linux下Cacti安装与配置.doc_第4页
Linux下Cacti安装与配置.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Linux下Cacti安装与配置原文链接:/Linux/2011-11/46712.htm这个是linux下安装配置Nagios和Cacti的第一个步骤,即配置一个web的环境,这里采用的是lamp的架构!这里采用的linux平台是RHEL 5.4的版本首先是mysql的编译安装(GCC和MAKE都要安装上,其他的套件按需安装)免费下载地址在 / 用户名与密码都是rootlocalhost httpd# useradd mysqlrootlocalhost # ll mysql-5.1.59.tar.gz -rw-r-r- 1 root root 24325443 Oct 14 22:38 mysql-5.1.59.tar.gzrootlocalhost # tar zxvf mysql-5.1.59.tar.gzrootlocalhost mysql-5.1.59# ./configure -prefix=/usr/local/mysql -enable-local-infile -with-charset=gbk -with-extra-charsets=all -with-low-memory -with-mysqld-user=mysql -enable-thread-safe-clientrootlocalhost mysql-5.1.59#make & make installrootlocalhost mysql-5.1.59# cd /usr/local/mysql/rootlocalhost mysql# chown -R mysql.mysql .rootlocalhost mysql# ./bin/mysql_install_db -user=mysqlrootlocalhost mysql# chown -R root .rootlocalhost mysql# chown -R mysql /var/rootlocalhost mysql# ./bin/mysqld_safe -user=mysql &rootlocalhost mysql# netstat -tulnp|grep 3306tcp00 :330:* LISTEN20438/mysqldrootlocalhost mysql# cd (这部分是制作mysql的开机启动项)rootlocalhost # echo /usr/local/mysql/lib/mysql /etc/ld.so.confrootlocalhost # ldconfig -vrootlocalhost # ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysqlrootlocalhost # cp mysql-5.1.59/support-files/mysql.server /etc/init.d/mysqldrootlocalhost # chmod 775 /etc/init.d/mysqldrootlocalhost # cp mysql-5.1.59/support-files/f /etc/my-cnfrootlocalhost # chkconfig -add mysqldrootlocalhost # chkconfig mysqld onrootlocalhost # chkconfig -list|grep mysqldmysqld0:off 1:off 2:on3:on4:on5:on6:of接着是apache的编译安装rootlocalhost # ll httpd-2.2.6.tar.gz -rw-r-r- 1 root root 6028951 Sep62007 httpd-2.2.6.tar.gzrootlocalhost # tar zxvf httpd-2.2.6.tar.gz rootlocalhost # cd httpd-2.2.6rootlocalhost httpd-2.2.6# ./configure -prefix=/usr/local/httpd -enable-so-enable-rewrite -enable-ssl -with-ssl=/usr/local/openssl -with-zlib -enable-mods-shared=all -enable-track-vars -with-mysql=/usr/local/mysqlrootlocalhost httpd-2.2.6# make & make installrootlocalhost httpd-2.2.6# echo /usr/local/httpd/bin/apachectl start /etc/rc.local rootlocalhost httpd-2.2.6# /usr/local/httpd/bin/apachectl startrootlocalhost httpd-2.2.6# netstat -tulnp|grep 80tcp00 :80 :*LISTEN19055/httpd接着添加php的支持rootlocalhost # cd /usr/local/httpd/conf/rootlocalhost conf# cp httpd.conf httpd.conf.bak rootlocalhost conf# vi httpd.conf (红色字体为修改部分)DocumentRoot /var/wwwOptions FollowSymLinksAllowOverride NoneOrder deny,allowAllow from allAddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps最后是php的编译安装rootlocalhost # ll php-5.2.5.tar.gz -rw-r-r- 1 root root 9972372 Jan32008 php-5.2.5.tar.gzrootlocalhost # tar zxvf php-5.2.5.tar.gz rootlocalhost php-5.2.5# ./configure -prefix=/usr/local/php -with-config-file-path=/etc -with-apxs2=/usr/local/httpd/bin/apxs -enable-fastcgi -enable-safe-mode -with-zlib -with-bz2 -with-freetype-dir -enable-mbstring -with-mysql=/usr/local/mysql -with-mysqli=/usr/local/mysql/bin/mysql_config -with-gd -with-libxml-dir -with-png-dir -with-jepg-dir -enable-socketsrootlocalhost php-5.2.5# make & make install如果本机已经rpm方式安装php,那么进行下边红色字体的动作rootlocalhost php-5.2.5# yum -y remove php*rootlocalhost php-5.2.5# cp php.ini-dist /etc/php.ini 最后测试的部分rootlocalhost # cd /var/www/rootlocalhost www# vi info.php rootlocalhost www# cp /usr/local/httpd/htdocs/index.html .重启的服务就可以出来php那个经典的页面,表示成功!总结,这个实验是为了搭建Nagios和Cacti需要的web环境,接下来的实验就进入Nagios和Cacti的部分!这个实验是Nagios和Cacti安装与配置的第二个步骤之Cacti安装与配置,采用的实验环境是之前搭建的lamp的环境,这步需要安装很多的辅助套件,Cacti就是通过net-snmp进行数据的采集,通过Mysql进行模板、主机信息、以及rra信息的存储,通过RRdtool进行数据的存储和绘图,Cacti是直接与管理员交互的平台。需要安装的套件为rrdtool、net-snmp、cacti-spine、cacti 首先套件安装和设置的具体步骤rootlocalhost # ll rrdtool-1.4.5.tar.gz-rw-r-r- 1 root root 1348713 Oct 152011 rrdtool-1.4.5.tar.gzrootlocalhost # tar zxvf rrdtool-1.4.5.tar.gz rootlocalhost rrdtool-1.4.5# ./configure-prefix=/usr/local/rrdtoolrootlocalhost rrdtool-1.4.5# make & make installrootlocalhost # ll net-snmp-.tar.gz-rw-r-r- 1 root root 5937279 Oct 152011 net-snmp-.tar.gzrootlocalhost # tar zxvf net-snmp-.tar.gz rootlocalhost net-snmp-# ./configure/写以下两项,其他的采用系统默认的即可System Contact Information ():cactiuserSystem Location (Unknown):office_7frootlocalhost net-snmp-# make & make installrootlocalhost # ll cacti-spine-0.8.7h.tar.gz/cacti的一个加速器-rw-r-r- 1 root root 623334 Oct 152011 cacti-spine-0.8.7h.tar.gzrootlocalhost # tar zxvf cacti-spine-0.8.7h.tar.gz rootlocalhost cacti-spine-0.8.7h# ./configure -prefix=/usr/local/spinerootlocalhost cacti-spine-0.8.7h# make & make installrootlocalhost cacti-spine-0.8.7h# cd /usr/local/spine/etc/rootlocalhost etc# cp spine.conf.dist spine.confrootlocalhost etc# vi spine.confDB_Host localhostDB_Database cactiDB_User cactiuserDB_Pass 721wyzj /修改密码DB_Port 3306DB_PreG 0rootlocalhost # ll cacti-0.8.7h.tar.gz-rw-r-r- 1 root root 2249323 Oct 152011 cacti-0.8.7h.tar.gzrootlocalhost # tar zxvf cacti-0.8.7h.tar.gz rootlocalhost # mv cacti-0.8.7h /var/www/cacti接下来进行数据库和用户的设置rootlocalhost # useradd cactiuserrootlocalhost # vi /etc/crontab/添加下边的计划任务*/5 * * * * cactiuser /usr/local/php/bin/php /var/www/cacti/poller.php /dev/null 2&1rootlocalhost # mysql /添加必须的cacti这个数据库mysql create database cacti;mysql grant all privileges on cacti.* to identified by 721wyzj;mysql flush privileges;mysql qByerootlocalhost cacti# mysql -p cacti show tables;+-+| Tables_in_cacti |+-+| cdef |.| user_log| version |+-+48 rows in set (0.01 sec)rootlocalhost cacti# cd .rootlocalhost www# chown -R root.root cacti/rootlocalhost cacti# chown -R cactiuser log/ rra/这个是cacti数据交互的地方,cactiuer必须保有写入的权限 rootlocalhost cacti# cd include/rootlocalhost include# cp config.php config.php.bak rootlocalhost include# vi config.php$database_type = mysql;$database_default = cacti;$database_hostname = localhost;$database_username = cactiuser;$database_password = 721wyzj; /修改的部分$database_port = 3306;$database_ssl = false;最后是windows下操作的部分,在IE地址栏里输入以下内容,安装cacti92/cacti/install/index.php安装成功之后,通过账号,密码admin:admin登入进行相关的设置即可总结,这是Nagios和Cacti安装与配置的第二个步骤,主要进行Cacti安装与配置,然而对设备的管理仍需辅以相关的插件来进行,接下来进一步的探索这个是Nagios和Cacti安装与配置的第三个步骤,就是给cacti打补丁和安装weathermap插件,建立在之前的实验平台上,此文章主要介绍安装。第一部分:装cati-plugin的解决方案需要的套件 cacti-plugin-0.8.7h-PA-v3.0.tar.gzrootlocalhost # tar zxvf cacti-plugin-0.8.7h-PA-v3.0.tar.gz rootlocalhost # cd cacti-plugin-arch/rootlocalhost cacti-plugin-arch# cp -rf files/* /var/www/cacti/rootlocalhost cacti-plugin-arch# cd /var/www/cacti/rootlocalhost cacti# mysql -u root cacti admin-Plugin Management (添加上这个即可)实验总结之前一直采用类似以下的方式补丁步骤 patch -p1 -N cacti-plugin-0.8.7g-PA-v2.8.diff之后再修改vi /var/www/cacti/include/global.php$database_username = cactiuser;$database_password = 721wyzj;$configurl_path = /cacti/;但是很无奈登陆时一直出现Call to undefined function api_plugin_hook() 的错误提示,谷歌了好多解决方案,都不奏效,后来发现解开压缩包所在的目录下有files的目录,再结合网络的搜索得知,还有另外一种方案-覆盖,于是就尝试的去做也就是以上成功的案例,终于问题解决,深吸一口气啊!第二部分:weathermap插件的安装rootlocalhost # ll php-weathermap-0.97a.zip -rw-r-r- 1 root root 2927302 Oct 162011 php-weathermap-0.97a.ziprootlocalhost # unz

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论