Spring中的aware接口详情
352
2022-10-29
实战Cacti网络监控(2)——搭建Spine轻量级框架实现多线程监控
本次实验接着上次实验的环境。实战Cacti网络监控(1)——基础安装配置
实验内容:
1.监控物理主机
2.Spine 多线程监控
3.monitor监控插件
1.监控物理主机
在物理主机上配置如下: <1>yum install net-snmp.x86_64 -y ##安装snmp服务 yum install net-snmp-utils.x86_64 -y <2>vim /etc/snmp/snmpd.conf
41 #com2sec notConfigUser default public
42 com2sec local localhost public
43 com2sec mynetwork 172.25.254.0/24 public
44
45 ####
46 # Second, map the security name into a group name:
47
48 # groupName securityModel securityName
49 #group notConfigGroup v1 notConfigUser
50 #group notConfigGroup v2c notConfigUser
51 group MyRWGroup v1 local
52 group MyRWGroup v2c local
53 group MyRWGroup usm local
54 group MyROGroup v1 mynetwork
55 group MyROGroup v2c mynetwork
56 group MyROGroup usm mynetwork
57 ####
58 # Third, create a view for us to let the group have rights to:
59
60 # Make at least snmpwalk -v 1 localhost -c public system fast again.
61 # name incl/excl subtree mask(optional)
62 view systemview included .1.3.6.1.2.1
63 view systemview included .1.3.6.1.2.1.25.1.1
64 view all included .1 80
65 ####
69 #access notConfigGroup "" any noauth exact systemview none n one
70 access MyROGroup "" any noauth exact all none none
71 access MyRWGroup "" any noauth exact all all none
72 # --
170 syslocation RHEL6.5
171 syscontact Root
331 disk / 10000
<3>systemctl start snmpd <4>snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex ##-v指版本,-c指密钥,即客户端snmp.conf里面所设置的,公认的密钥组为public(这也是snmp众所都知的bug之一,不安全!,当然也可以自己改个密码),IP——MIB指获取系统(物理机)的IP信息 *****************************************************************************************
[root@willis Desktop]# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex.10.52.115.4 = INTEGER: 24
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.172.25.254.6 = INTEGER: 22
IP-MIB::ipAdEntIfIndex.192.168.122.1 = INTEGER: 5 *************************************************************************************************************
<5>snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.9 ************************************************************************************************************* [root@foundation38 snmp]# snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.9 ##查看系统信息管理块
UCD-SNMP-MIB::dskIndex.1 = INTEGER: 1
UCD-SNMP-MIB::dskPath.1 = STRING: /
UCD-SNMP-MIB::dskDevice.1 = STRING: /dev/mapper/rhel-root
UCD-SNMP-MIB::dskMinimum.1 = INTEGER: 10000
UCD-SNMP-MIB::dskMinPercent.1 = INTEGER: -1
UCD-SNMP-MIB::dskTotal.1 = INTEGER: 225661280
UCD-SNMP-MIB::dskAvail.1 = INTEGER: 102136208
UCD-SNMP-MIB::dskUsed.1 = INTEGER: 123525072
UCD-SNMP-MIB::dskPercent.1 = INTEGER: 55
UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 0
UCD-SNMP-MIB::dskTotalLow.1 = Gauge32: 225661280
UCD-SNMP-MIB::dskTotalHigh.1 = Gauge32: 0
UCD-SNMP-MIB::dskAvailLow.1 = Gauge32: 102136208
UCD-SNMP-MIB::dskAvailHigh.1 = Gauge32: 0
UCD-SNMP-MIB::dskUsedLow.1 = Gauge32: 123525072
UCD-SNMP-MIB::dskUsedHigh.1 = Gauge32: 0
UCD-SNMP-MIB::dskErrorFlag.1 = INTEGER: noError(0)
UCD-SNMP-MIB::dskErrorMsg.1 = STRING:
这是创建好的
添加虚拟机监控界面
Console -> Graph Trees -> (Edit) -> Graph Tree Items
2.Spine 多线程监控
在虚拟主机server6上编译cacti-spine: <1>tar zxf cacti-spine-0.8.8h.tar.gz <2>cd cacti-spine-0.8.8h 《1》yum install net-snmp-devel mysql-devel openssl-devel -y ##解决依赖关系 《2》yum install dos2unix autoconf automake binutils libtool gcc cpp glibc-headers glibc-devel -y 《3》sh bootstrap 《4》./configure 《5》make && make install <3>cd /usr/local/spine/etc 《1》cp spine.conf.dist /etc/spine.conf 《2》vim /etc/spine.conf ##做如下修改 33 DB_Host localhost 34 DB_Database cacti 35 DB_User cacti 36 DB_Pass redhat
37 DB_Port 3306 <4>su - cacti 《1》/usr/local/spine/bin/spine **********************************************************************
[root@server10 etc]# su - cacti
-bash-4.1$ /usr/local/spine/bin/spine
SPINE: Using spine config file [/etc/spine.conf]
SPINE: Version 0.8.8h starting
SPINE: Time: 0.0821 s, Threads: 5, Hosts: 3
-bash-4.1$
********************************************************************** 网页添加 Console -> Cacti Settings
The path to Spine binary. /usr/local/spine/bin/spine
<5>vim /etc/php.ini ##修改PHP的时间区 946 date.timezone = Asia/Shanghai <6>/etc/init.d/restart ##重启apache服务 <7>cd /var/ tail -f /var/ ##监控日志,或者用cat cacti.log,只要出现如下类似消息即可: *****************************************************************************************
09/29/2016 03:20:01 PM - SYSTEM STATS: Time:0.1069 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:18 RRDsProcessed:16 *****************************************************************************************
3.monitor监控插件 (1)tar -zxf monitor-v1.3-1.tgz -C /var/ (2)浏览器页面操作:
搭建已经完成,过一段时间可以清楚的看到服务器性能变化曲线
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~