- 浏览: 2550723 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Linux上简单配置安装cacti(六)snmp再次安装
以前确认过机器上安装了snmp,但是这是redhat自带的,据说里面是没有snmpwalk,snmpget这些命令的,所以我这里要重新
编译安装NET-SNMP
官方网站
http://www.net-snmp.org/
下载文件
wget http://nchc.dl.sourceforge.net/project/net-snmp/net-snmp/5.5/net-snmp-5.5.tar.gz
解开压缩包
tar zxvf net-snmp-5.5.tar.gz
配置
./configure --prefix=/usr/local/net-snmp --enable-developer
中间有提示,一路回车下去
make
报错如下:
grep: /usr/lib/libbeecrypt.la: No such file or directory
/bin/sed: can't read /usr/lib/libbeecrypt.la: No such file or directory
libtool: link: `/usr/lib/libbeecrypt.la' is not a valid libtool archive
make[1]: *** [libnetsnmpmibs.la] 错误 1
make[1]: Leaving directory `/var/tmp/net-snmp-5.5/agent'
make: *** [subdirs] 错误 1
解决办法:
安装beecrypt
wget http://nchc.dl.sourceforge.net/sourceforge/beecrypt/beecrypt-4.1.2.tar.gz
tar zxvf beecrypt-4.1.2.tar.gz
./configure --prefix=/usr
make
make install
重新make,又报错了,报错如下:
/usr/bin/ld: cannot find -lelf
collect2: ld returned 1 exit status
make[1]: *** [libnetsnmpmibs.la] 错误 1
make[1]: Leaving directory `/var/tmp/net-snmp-5.5/agent'
make: *** [subdirs] 错误 1
解决办法:
ln -s libelf.so.1 /usr/lib/libelf.so
继续make,成功了:)
make install
安装成功。
链接过去
ln -s /usr/local/net-snmp/bin/* /usr/local/bin/
cp EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.conf
/usr/local/net-snmp/sbin/snmpd //启动SNMP服务
vi /etc/rc.d/rc.local
//在rc.local上加入一行/usr/local/net-snmp/sbin/snmpd,系统启动时启动SNMP服务
现在再回头看看cacti的错误
错误:/usr/local/bin/snmpwalk
错误:/usr/local/bin/snmpget
错误:/usr/local/bin/snmpbulkwalk
错误:/usr/local/bin/snmpgetnext
再次点开,这次就没有以上的错误啦。点Finish
输入用户名和密码admin/admin
登陆后点击graph图标,图没有出来。继续查找下原因,快要成功了:)
查看后台日志cacti里面的log/cacti.log,日志如下:
POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting
点击控制面板console----->Data Sources
选择列表中的一个Localhost-Load Average
点击右上角的Turn Off Data Source Debug Mode
下面会出现对应的命令Data Source Debug
/usr/local/bin/rrdtool create \
/usr/local/apache2/htdocs/cacti/rra/localhost_load_1min_5.rrd \
--step 300 \
DS:load_1min:GAUGE:600:0:500 \
DS:load_5min:GAUGE:600:0:500 \
DS:load_15min:GAUGE:600:0:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
su cacti,执行该命令,报错如下:
ERROR: creating '/usr/local/apache2/htdocs/cacti/rra/localhost_load_1min_5.rrd': 权限不够
晕,前面不是赋予了权限了嘛,难道搞错了。再赋予一次。
chown -R cacti rra
chown -R cacti log
执行命令,OK了,检查一下目录rra,哈哈,已经有一个文件了。去看看图看。图有了,但是是否有正确的每5分钟采集一次
就要等等,等好几个5分钟再来看看了。等了一会儿,还是没有数据,唉,好事多磨啊,有图像了,又没有数据。。。。
检查snmp
snmpwalk -c public -v 2c 10.206.19.59 if 有很多信息返回
检查数据
rrdtool fetch localhost_mem_swap_4.rrd AVERAGE,返回的都是
1261452300: nan
1261452600: nan
文件更新信息
rrdtool lastupdate localhost_mem_swap_4.rrd --template,返回数据
users
1261535656: U
文件信息
rrdtool info localhost_users_6.rrd,返回信息:
filename = "localhost_users_6.rrd"
rrd_version = "0003"
step = 300
last_update = 1261535656
ds[users].type = "GAUGE"
ds[users].minimal_heartbeat = 600
ds[users].min = 0.0000000000e+00
ds[users].max = 5.0000000000e+02
ds[users].last_ds = "U"
ds[users].value = 0.0000000000e+00
网上搜索资料,可能是SNMP没有配置好
vi /usr/local/net-snmp/share/snmp/snmpd.conf
cp /etc/snmp/snmpd.conf /usr/local/net-snmp/share/snmp/snmpd.conf
重启snmp
/usr/local/net-snmp/sbin/snmpd
修改定时任务
[root@dev1 snmp]# crontab -e -u cacti
*/5 * * * * /usr/local/bin/php -q /usr/local/apache2/htdocs/cacti/poller.php > /var/log/poller.log 2>&1
检查定时任务是否启动了
/etc/init.d/crond status
一切正常
检查log/cacti.log日志
12/23/2009 01:14:16 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 4754 seconds have passed since the last poll!
12/23/2009 01:20:01 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 345 seconds have passed since the last poll!
12/23/2009 01:25:00 PM - POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.
12/23/2009 01:25:00 PM - SYSTEM STATS: Time:298.7072 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:5 RRDsProcessed:0
12/23/2009 01:30:00 PM - POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.
手工执行了几次
php cacti/cmd.php
php cacti/poller.php
PHP Deprecated错误的解决
vi /usr/local/lib/php.ini
加入:
php_flag allow_call_time_pass_reference On
php_value error_reporting "E_ALL & ~E_NOTICE & ~E_DEPRECATED"
终于有数据了,发现好像是执行了php cacti/cmd.php,但是最后还是有些问题。
以前确认过机器上安装了snmp,但是这是redhat自带的,据说里面是没有snmpwalk,snmpget这些命令的,所以我这里要重新
编译安装NET-SNMP
官方网站
http://www.net-snmp.org/
下载文件
wget http://nchc.dl.sourceforge.net/project/net-snmp/net-snmp/5.5/net-snmp-5.5.tar.gz
解开压缩包
tar zxvf net-snmp-5.5.tar.gz
配置
./configure --prefix=/usr/local/net-snmp --enable-developer
中间有提示,一路回车下去
make
报错如下:
grep: /usr/lib/libbeecrypt.la: No such file or directory
/bin/sed: can't read /usr/lib/libbeecrypt.la: No such file or directory
libtool: link: `/usr/lib/libbeecrypt.la' is not a valid libtool archive
make[1]: *** [libnetsnmpmibs.la] 错误 1
make[1]: Leaving directory `/var/tmp/net-snmp-5.5/agent'
make: *** [subdirs] 错误 1
解决办法:
安装beecrypt
wget http://nchc.dl.sourceforge.net/sourceforge/beecrypt/beecrypt-4.1.2.tar.gz
tar zxvf beecrypt-4.1.2.tar.gz
./configure --prefix=/usr
make
make install
重新make,又报错了,报错如下:
/usr/bin/ld: cannot find -lelf
collect2: ld returned 1 exit status
make[1]: *** [libnetsnmpmibs.la] 错误 1
make[1]: Leaving directory `/var/tmp/net-snmp-5.5/agent'
make: *** [subdirs] 错误 1
解决办法:
ln -s libelf.so.1 /usr/lib/libelf.so
继续make,成功了:)
make install
安装成功。
链接过去
ln -s /usr/local/net-snmp/bin/* /usr/local/bin/
cp EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.conf
/usr/local/net-snmp/sbin/snmpd //启动SNMP服务
vi /etc/rc.d/rc.local
//在rc.local上加入一行/usr/local/net-snmp/sbin/snmpd,系统启动时启动SNMP服务
现在再回头看看cacti的错误
错误:/usr/local/bin/snmpwalk
错误:/usr/local/bin/snmpget
错误:/usr/local/bin/snmpbulkwalk
错误:/usr/local/bin/snmpgetnext
再次点开,这次就没有以上的错误啦。点Finish
输入用户名和密码admin/admin
登陆后点击graph图标,图没有出来。继续查找下原因,快要成功了:)
查看后台日志cacti里面的log/cacti.log,日志如下:
POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting
点击控制面板console----->Data Sources
选择列表中的一个Localhost-Load Average
点击右上角的Turn Off Data Source Debug Mode
下面会出现对应的命令Data Source Debug
/usr/local/bin/rrdtool create \
/usr/local/apache2/htdocs/cacti/rra/localhost_load_1min_5.rrd \
--step 300 \
DS:load_1min:GAUGE:600:0:500 \
DS:load_5min:GAUGE:600:0:500 \
DS:load_15min:GAUGE:600:0:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
su cacti,执行该命令,报错如下:
ERROR: creating '/usr/local/apache2/htdocs/cacti/rra/localhost_load_1min_5.rrd': 权限不够
晕,前面不是赋予了权限了嘛,难道搞错了。再赋予一次。
chown -R cacti rra
chown -R cacti log
执行命令,OK了,检查一下目录rra,哈哈,已经有一个文件了。去看看图看。图有了,但是是否有正确的每5分钟采集一次
就要等等,等好几个5分钟再来看看了。等了一会儿,还是没有数据,唉,好事多磨啊,有图像了,又没有数据。。。。
检查snmp
snmpwalk -c public -v 2c 10.206.19.59 if 有很多信息返回
检查数据
rrdtool fetch localhost_mem_swap_4.rrd AVERAGE,返回的都是
1261452300: nan
1261452600: nan
文件更新信息
rrdtool lastupdate localhost_mem_swap_4.rrd --template,返回数据
users
1261535656: U
文件信息
rrdtool info localhost_users_6.rrd,返回信息:
filename = "localhost_users_6.rrd"
rrd_version = "0003"
step = 300
last_update = 1261535656
ds[users].type = "GAUGE"
ds[users].minimal_heartbeat = 600
ds[users].min = 0.0000000000e+00
ds[users].max = 5.0000000000e+02
ds[users].last_ds = "U"
ds[users].value = 0.0000000000e+00
网上搜索资料,可能是SNMP没有配置好
vi /usr/local/net-snmp/share/snmp/snmpd.conf
cp /etc/snmp/snmpd.conf /usr/local/net-snmp/share/snmp/snmpd.conf
重启snmp
/usr/local/net-snmp/sbin/snmpd
修改定时任务
[root@dev1 snmp]# crontab -e -u cacti
*/5 * * * * /usr/local/bin/php -q /usr/local/apache2/htdocs/cacti/poller.php > /var/log/poller.log 2>&1
检查定时任务是否启动了
/etc/init.d/crond status
一切正常
检查log/cacti.log日志
12/23/2009 01:14:16 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 4754 seconds have passed since the last poll!
12/23/2009 01:20:01 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 345 seconds have passed since the last poll!
12/23/2009 01:25:00 PM - POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.
12/23/2009 01:25:00 PM - SYSTEM STATS: Time:298.7072 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:5 RRDsProcessed:0
12/23/2009 01:30:00 PM - POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.
手工执行了几次
php cacti/cmd.php
php cacti/poller.php
PHP Deprecated错误的解决
vi /usr/local/lib/php.ini
加入:
php_flag allow_call_time_pass_reference On
php_value error_reporting "E_ALL & ~E_NOTICE & ~E_DEPRECATED"
终于有数据了,发现好像是执行了php cacti/cmd.php,但是最后还是有些问题。
发表评论
-
Docker(4)Docker on Raspberry
2015-07-15 13:25 1104Docker(4)Docker on Raspberry I ... -
VirtualBox Network
2015-06-10 11:48 781VirtualBox Network Last one ye ... -
Debian System(1)Java and NodeJS Env
2015-03-29 06:27 1032Debian System(1)Java and NodeJS ... -
VirtualBox Importing OVA
2014-05-14 03:35 1230VirtualBox Importing OVAJust im ... -
Data Import Process
2012-09-05 11:21 1258Data Import Process 1. prepare ... -
Artifactory on Linux(1)
2011-12-13 22:41 1388Artifactory on Linux(1) Downlo ... -
Hudson/Jenkins Installation on Redhat4
2011-12-13 22:40 1356Hudson/Jenkins Installation on ... -
Archiva In Linux(1)
2011-12-13 13:56 1579Archiva In Linux(1) 1. install ... -
kingate(1)Install on redhat4
2011-11-02 23:02 1347kingate(1)Install on redhat4 1 ... -
JBOSS Performance Tuning
2011-09-22 16:20 1828JBOSS Performance Tuning 2. JV ... -
Linux Deploy Rails3 with Ruby1.9.2(5)Fix the Error Messages
2011-09-03 11:12 755Linux Deploy Rails3 with Ruby1. ... -
Linux Deploy Rails3 with Ruby1.9.2(4)Configure the rails in Apache2
2011-09-03 11:11 1610Linux Deploy Rails3 with Ruby1. ... -
Yum Problem after Python Upgrade
2011-08-23 17:09 4125Yum Problem after Python Upgrad ... -
Linux Deploy Rails3 with Ruby1.9.2(3)
2011-08-23 14:27 2218Linux Deploy Rails3 with Ruby1. ... -
Linux Deploy Rails3 with Ruby1.9.2(2)
2011-08-21 17:00 1677Linux Deploy Rails3 with Ruby1. ... -
Deploy Rails with Ruby1.9.2 on Redhat4(1)
2011-08-21 10:37 2217Deploy Rails with Ruby1.9.2 on ... -
Yum on Linux System
2011-08-20 14:00 1247Yum on Linux System download t ... -
Understand the Linux Version
2011-08-20 10:35 1434Understand the Linux Version 1 ... -
Linux Commands(I) scp
2011-06-21 23:54 1272Linux Commands(I) scp 1. scp i ... -
Linux Server Deployment(II)apache and SSH-CVS
2011-06-08 22:04 1616Linux Server Deployment(II)apac ...
相关推荐
- 首先,确保Windows服务器上的SNMP Informant服务已经启用并配置为允许Cacti所在IP访问。 - 其次,在Cacti中导入上述XML文件,创建对应的数据查询和数据源。 - 接着,根据服务器结构,创建或编辑相应的设备模板...
1. 配置Cacti服务器:确保SNMP服务在目标设备上运行,并且Cacti服务器能够通过网络访问到。 2. 添加设备:在Cacti的“设备”部分,添加你要监控的网络设备,并输入其IP地址、SNMP版本、社区字符串等信息。 3. 创建...
在CentOS系统上,安装Cacti通常涉及多个步骤,包括安装必要的软件包、配置数据库、设置权限等。本文将详细介绍如何使用一键安装脚本来简化这个过程。 首先,`auto_cacti1.2.22`脚本是为CentOS设计的,旨在自动化...
在安装完成后,需要配置 Cacti,按照以下步骤操作: 1. 打开 Web 浏览器,输入以下 URL,访问 Cacti 首页: ``` http://localhost/cacti ``` 2. 点击“Next”按钮,继续安装过程。 3. 选择语言,点击“Next”按钮。...
本篇文章将详细介绍如何在Linux系统上安装和配置Cacti,帮助你掌握网络监控的关键技能。 首先,Cacti的安装过程通常涉及以下步骤: 1. **系统准备**:确保你的Linux服务器已经安装了LAMP(Linux、Apache、MySQL、...
Centos 7.4 安装 Cacti 1.2.2/thold/monitor 是一篇详细的安装指南,涵盖了从系统环境配置到安装软件包再到环境配置的所有步骤。这篇文章旨在帮助用户避免一些安装错误,从而成功安装 Cacti 1.2.2/thold/monitor。 ...
本文将详细讲解如何在CentOS系统上一键安装Cacti 1.2.22,以及所需的软件配置。 首先,Cacti的安装通常涉及多个步骤,包括安装依赖、配置数据库、设置Web服务器等。而“CentOS系统一键安装cacti1.2.22脚本”正是...
使得Cacti的安装相比Centos7更简单,脚本的功能是在Centos8上一键安装cacti1.2.7。准备一台centos8的主机,所有文件放在/root目录,使用root账号安装,期间需要输入: 数据库root及cacti的用户密码、本机snmp团体字 ...
总的来说,Cacti1.2.14一键安装提供了一种便捷的方式,使得在CentOS Linux环境中部署Cacti变得简单高效。通过自动处理复杂的配置和安装过程,运维人员可以更专注于网络监控本身,而不是安装和维护监控工具。这在大型...
5. Web服务器(Apache)和PHP的安装配置: - 使用yum安装Apache Web服务器和PHP。安装时指定版本为Apache/2.4.6和php5.4.16。 - 启动httpd服务并设置为开机启动。 - 确保httpd.conf配置文件中包含必要的配置指令,...
Cacti在Linux操作系统上运行,尤其适用于监控网络带宽、服务器负载等关键指标。本手册将详细介绍如何在Linux环境下配置和应用Cacti。 一、安装Cacti的前提条件 在开始配置Cacti之前,你需要确保你的Linux系统满足...
centos stream 9安装cacti1.2.23,使用php8.0+maiadb10.5+rrdtool1.7.2
首先,安装Cacti需要SNMP(简单网络管理协议)的支持。SNMP允许远程监控和管理网络设备。在CentOS系统中,可以使用`yum`命令安装所需的SNMP软件包: ```bash yum install net-snmp net-snmp-devel net-snmp-utils `...
### 共享安装 Cacti 过程中的经历与心得 #### 一、项目背景及需求分析 在项目中遇到了一个需求,原有的 Cacti 监控系统所在的服务器需要退役,因此需要在新的服务器上重新部署 Cacti。然而,原先负责安装 Cacti 的...