◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
cacti+rrdtool+netsnmp系统监控系统的安装方法
Post by mrchen, 2011-9-5, Views:本文链接地址:http://www.guanwei.org/post/applicationsecurity/09/cacti-rrdtool-netsnmp.html
一,安装rrdtool 官网: http://oss.oetiker.ch/rrdtool/
/usr/bin/wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.2.
tar.gz/bin/tarxzf rrdtool-1.4.2.tar.gzcdrrdtool-1.4.2./configure --prefix=/home/rrdtool
示以下warning信息:提
configure: WARNING:
—————————————————————————-
* I found a copy of pkgconfig, but there is no pangocairo.pc file around.
You may want to set the PKG_CONFIG_PATH variable to point to its
location.
—————————————————————————-configure: WARNING:
—————————————————————————-
* I could not find a working copy of pangocairo. Check config.log for hints on why
this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
so that compiler and the linker can find libpango-1.0 and its header files. If
you have not installed pangocairo, you can get it either from its original home onhttp://ftp.gnome.org/pub/GNOME/sources/pango/1.17
You can find also find an archive copy on
http://oss.oetiker.ch/rrdtool/pub/libs
The last tested version of pangocairo is 1.17.
LIBS=-lm -lglib-2.0
LDFLAGS= -L/lib64
CPPFLAGS= -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include—————————————————————————-
checking for xmlParseFile in -lxml2… yes
checking libxml/parser.h usability… yes
checking libxml/parser.h presence… yes
checking for libxml/parser.h… yes
configure: error: Please fix the library issues listed above and try again.
信息表明缺了pango的头文件,因此要先安装pango-devel
/usr/bin/yum
installpango-devel
接下来重新编译
./configure --prefix=/home/rrdtool
这次编译通过:
Config is DONE!
make && make install
做一个软连接
/bin/ln -s /home/rrdtool/bin/* /usr/local/bin/
cd ..
样就完成了rrdtool的安装,这
二,安装net-snmp 官网: http://www.net-snmp.org/
先下载net-snmp的最新版本5.5
/usr/bin/wget http://downloads.sourceforge.net/project/net-snmp/net-snmp/5.5/net-snmp-5.5.
tar.gz?use_mirror=nchc
/bin/tarxzf net-snmp-5.5.tar.gz
cdnet-snmp-5.5
./configure#一切按照默认值来编译(默认安装到/usr/loca/)
make&&makeinstall
行以下snmpget,检查是否安装成功运
/usr/loca/bin/snmpget
我这里就遇到了问题,提示信息是:
/usr/local/bin/snmpget: error while loading shared libraries: libnetsnmp.so.20: cannot open shared object file: No such file or directory
先通过ldd查看snmpget需要加载哪些库
[root@test_server net-snmp-5.5]# /usr/bin/ldd /usr/local/bin/snmpget
libnetsnmp.so.20 => not found
libcrypto.so.6 => /lib64/libcrypto.so.6 (0x0000003c1fc00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003c1d000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003c1d400000)
libz.so.1 => /usr/lib64/libz.so.1 (0x0000003c1ec00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003c1cc00000)
可见需要加载的库文件大都放在/lib64/下的;
再查一下libnetsnmp.so.20是在什么位置
/usr/bin/
whereislibnetsnmp.so.20
libnetsnmp.so: /usr/local/lib/libnetsnmp.so /usr/local/lib/libnetsnmp.so.20
ok, 至此我们就知道怎么解决问题了:
/bin/ln -s /usr/local/lib/libnetsnmp.so.20 /lib64/libnetsnmp.so.20
再执行一次snmpget
/usr/local/bin/snmpget
Created directory: /var/net-snmp
Created directory: /var/net-snmp/mib_indexes
No hostname specified.
USAGE: snmpget [OPTIONS] AGENT OID [OID]...
Version: 5.5
Web:www.guanwei.orgEmail:admin@guanwei.org
一切OK
三, 安装cacti 官网: http://www.cacti.net/
值得注意的是cacti的环境需求:
RRDTool 1.0.49 or 1.2.x or greater
MySQL 4.1.x or 5.x or greater
PHP 4.3.6 or greater, 5.x greater highly recommended for advanced features
A Web Server e.g. Apache or IIS
先确认是否满足,然后:
/usr/bin/wget http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz
/bin/tar xzf cacti-0.8.7e.tar.gz
/bin/mv cacti-0.8.7e cacti
后就可以把cacti转移到web目录下然
/bin/
mvcacti /data/htdocs/cacti
cd/data/htdocs/cacti
/home/mysql/bin/mysql cacti < cacti.sql#导入数据库结构
/bin/chownwww:www -R .
/bin/viinclude/config.php
改数据库连接信息:修
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “root”;
$database_password = “”;
$database_port = “3306″;
增加后台任务,每两分钟搜集一次数据
*/5 * * * * /usr/
local/bin/php /usr/local/apche2/htdocs/cacti/poller.php > /dev/null 2>&1
接下来就从前台访问cacti的安装目录
http://www.guanwei.com/cacti/install/
按照以下图片中的标红提示完成配置

最后通过默认账号密码: admin/admin 登录,然后系统会提示修改密码;
接下来的事情就只是用了
本文未看懂?联系冠威客服,享受手把手服务,远程、现场任您选。优惠期间,免费服务!
有更好的解决方案?联系冠威客服,加入冠威,成为冠威客。发表文章,赚取佣金!
冠威客服:E-mail:Service@GuanWei.Org QQ:1026092
或许你还对下面的文章感兴趣
- DNS系统(服务器)的工作原理及攻击防护方法论 (2011-6-7 22:9:44)
- Linux查看系统信息的一些命令及查看已安装软件包的命令(转) (2011-4-18 9:36:12)
- 玩转Windows系统的账户隐藏 (2010-11-26 13:49:44)
- LINUX系统监视——/proc文件系统(文件夹) (2010-1-2 10:26:2)
- LINUX系统监视——查询系统信息以及top工具命令详解 (2009-12-18 21:53:44)


