linux下cacti安装与配置

linux下cacti安装与配置

ID:8820496

大小:57.50 KB

页数:7页

时间:2018-04-08

上传者:U-5734
linux下cacti安装与配置_第1页
linux下cacti安装与配置_第2页
linux下cacti安装与配置_第3页
linux下cacti安装与配置_第4页
linux下cacti安装与配置_第5页
资源描述:

《linux下cacti安装与配置》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

Linux下Cacti安装与配置原文链接:http://www.linuxidc.com/Linux/2011-11/46712.htm这个是linux下安装配置Nagios和Cacti的第一个步骤,即配置一个web的环境,这里采用的是lamp的架构!这里采用的linux平台是RHEL5.4的版本首先是mysql的编译安装(GCC和MAKE都要安装上,其他的套件按需安装)免费下载地址在http://linux.linuxidc.com/用户名与密码都是www.linuxidc.com[root@localhosthttpd]#useraddmysql[root@localhost~]#llmysql-5.1.59.tar.gz-rw-r--r--1rootroot24325443Oct1422:38mysql-5.1.59.tar.gz[root@localhost~]#tarzxvfmysql-5.1.59.tar.gz[root@localhostmysql-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-client[root@localhostmysql-5.1.59]#make&&makeinstall[root@localhostmysql-5.1.59]#cd/usr/local/mysql/[root@localhostmysql]#chown-Rmysql.mysql.[root@localhostmysql]#./bin/mysql_install_db--user=mysql[root@localhostmysql]#chown-Rroot.[root@localhostmysql]#chown-Rmysql/var/[root@localhostmysql]#./bin/mysqld_safe--user=mysql&[root@localhostmysql]#netstat-tulnp|grep3306tcp000.0.0.0:33060.0.0.0:*LISTEN20438/mysqld[root@localhostmysql]#cd~(这部分是制作mysql的开机启动项)[root@localhost~]#echo"/usr/local/mysql/lib/mysql">>/etc/ld.so.conf[root@localhost~]#ldconfig-v[root@localhost~]#ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql[root@localhost~]#cpmysql-5.1.59/support-files/mysql.server/etc/init.d/mysqld[root@localhost~]#chmod775/etc/init.d/mysqld[root@localhost~]#cpmysql-5.1.59/support-files/my-medium.cnf/etc/my-cnf[root@localhost~]#chkconfig--addmysqld[root@localhost~]#chkconfigmysqldon[root@localhost~]#chkconfig--list|grepmysqldmysqld0:off1:off2:on3:on4:on5:on6:of接着是apache的编译安装 [root@localhost~]#llhttpd-2.2.6.tar.gz-rw-r--r--1rootroot6028951Sep62007httpd-2.2.6.tar.gz[root@localhost~]#tarzxvfhttpd-2.2.6.tar.gz[root@localhost~]#cdhttpd-2.2.6[root@localhosthttpd-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/mysql[root@localhosthttpd-2.2.6]#make&&makeinstall[root@localhosthttpd-2.2.6]#echo"/usr/local/httpd/bin/apachectlstart">>/etc/rc.local[root@localhosthttpd-2.2.6]#/usr/local/httpd/bin/apachectlstart[root@localhosthttpd-2.2.6]#netstat-tulnp|grep80tcp00:::80:::*LISTEN19055/httpd接着添加php的支持[root@localhost~]#cd/usr/local/httpd/conf/[root@localhostconf]#cphttpd.confhttpd.conf.bak[root@localhostconf]#vihttpd.conf(红色字体为修改部分)DocumentRoot"/var/www"OptionsFollowSymLinksAllowOverrideNoneOrderdeny,allowAllowfromallAddTypeapplication/x-httpd-php.phpAddTypeapplication/x-httpd-php-source.phps最后是php的编译安装[root@localhost~]#llphp-5.2.5.tar.gz-rw-r--r--1rootroot9972372Jan32008php-5.2.5.tar.gz[root@localhost~]#tarzxvfphp-5.2.5.tar.gz[root@localhostphp-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-sockets[root@localhostphp-5.2.5]#make&&makeinstall如果本机已经rpm方式安装php,那么进行下边红色字体的动作[root@localhostphp-5.2.5]#yum-yremovephp*[root@localhostphp-5.2.5]#cpphp.ini-dist/etc/php.ini最后测试的部分[root@localhost~]#cd/var/www/[root@localhostwww]#viinfo.php[root@localhostwww]#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首先套件安装和设置的具体步骤[root@localhost~]#llrrdtool-1.4.5.tar.gz-rw-r--r--1rootroot1348713Oct152011rrdtool-1.4.5.tar.gz[root@localhost~]#tarzxvfrrdtool-1.4.5.tar.gz[root@localhostrrdtool-1.4.5]#./configure--prefix=/usr/local/rrdtool[root@localhostrrdtool-1.4.5]#make&&makeinstall[root@localhost~]#llnet-snmp-5.6.1.1.tar.gz-rw-r--r--1rootroot5937279Oct152011net-snmp-5.6.1.1.tar.gz[root@localhost~]#tarzxvfnet-snmp-5.6.1.1.tar.gz[root@localhostnet-snmp-5.6.1.1]#./configure//写以下两项,其他的采用系统默认的即可 SystemContactInformation():cactiuserSystemLocation(Unknown):office_7f[root@localhostnet-snmp-5.6.1.1]#make&&makeinstall[root@localhost~]#llcacti-spine-0.8.7h.tar.gz//cacti的一个加速器-rw-r--r--1rootroot623334Oct152011cacti-spine-0.8.7h.tar.gz[root@localhost~]#tarzxvfcacti-spine-0.8.7h.tar.gz[root@localhostcacti-spine-0.8.7h]#./configure--prefix=/usr/local/spine[root@localhostcacti-spine-0.8.7h]#make&&makeinstall[root@localhostcacti-spine-0.8.7h]#cd/usr/local/spine/etc/[root@localhostetc]#cpspine.conf.distspine.conf[root@localhostetc]#vispine.confDB_HostlocalhostDB_DatabasecactiDB_UsercactiuserDB_Pass721wyzj//修改密码DB_Port3306DB_PreG0[root@localhost~]#llcacti-0.8.7h.tar.gz-rw-r--r--1rootroot2249323Oct152011cacti-0.8.7h.tar.gz[root@localhost~]#tarzxvfcacti-0.8.7h.tar.gz[root@localhost~]#mvcacti-0.8.7h/var/www/cacti接下来进行数据库和用户的设置[root@localhost~]#useraddcactiuser[root@localhost~]#vi/etc/crontab//添加下边的计划任务*/5****cactiuser/usr/local/php/bin/php/var/www/cacti/poller.php>/dev/null2>&1[root@localhost~]#mysql//添加必须的cacti这个数据库mysql>createdatabasecacti;mysql>grantallprivilegesoncacti.*toidentifiedby"721wyzj";mysql>flushprivileges;mysql>qBye[root@localhostcacti]#mysql-pcactishowtables;+---------------------------+|Tables_in_cacti |+---------------------------+|cdef |..............................................................................................................||user_log||version|+---------------------------+48rowsinset(0.01sec)[root@localhostcacti]#cd..[root@localhostwww]#chown-Rroot.rootcacti/[root@localhostcacti]#chown-Rcactiuserlog/rra///这个是cacti数据交互的地方,cactiuer必须保有写入的权限[root@localhostcacti]#cdinclude/[root@localhostinclude]#cpconfig.phpconfig.php.bak[root@localhostinclude]#viconfig.php$database_type="mysql";$database_default="cacti";$database_hostname="localhost";$database_username="cactiuser";$database_password="721wyzj";//修改的部分$database_port="3306";$database_ssl=false;最后是windows下操作的部分,在IE地址栏里输入以下内容,安装cactihttp://192.168.1.192/cacti/install/index.php安装成功之后,通过账号,密码admin:admin登入进行相关的设置即可总结,这是Nagios和Cacti安装与配置的第二个步骤,主要进行Cacti安装与配置,然而对设备的管理仍需辅以相关的插件来进行,接下来进一步的探索这个是Nagios和Cacti安装与配置的第三个步骤,就是给cacti打补丁和安装weathermap插件,建立在之前的实验平台上,此文章主要介绍安装。第一部分:装cati-plugin的解决方案需要的套件cacti-plugin-0.8.7h-PA-v3.0.tar.gz [root@localhost~]#tarzxvfcacti-plugin-0.8.7h-PA-v3.0.tar.gz[root@localhost~]#cdcacti-plugin-arch/[root@localhostcacti-plugin-arch]#cp-rffiles/*/var/www/cacti/[root@localhostcacti-plugin-arch]#cd/var/www/cacti/[root@localhostcacti]#mysql-urootcacti<~/cacti-plugin-arch/pa.sql[root@localhostcacti]#cdinclude/[root@localhostinclude]#viglobal.php//修改以下的字段即可$database_username="cactiuser";$database_password="721wyzj";if(!isset($url_path)){$url_path="/cacti/";}之后登陆http://192.168.1.192/cacti/index.phpUserManagement-->admin-->PluginManagement(添加上这个即可)实验总结之前一直采用类似以下的方式补丁步骤patch-p1-N

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
关闭