实战Cacti网络监控(2)——搭建Spine轻量级框架实现多线程监控


本次实验接着上次实验的环境。实战Cacti网络监控(1)——基础安装配置
实验内容:
1.监控物理主机2.Spine 多线程监控3.monitor监控插件

1.监控物理主机在物理主机上配置如下:
yum install net-snmp.x86_64 -y ##安装snmp服务
yum install net-snmp-utils.x86_64 -y
vim /etc/snmp/snmpd.conf
41 #com2sec notConfigUser default public42 com2sec local localhost public43 com2sec mynetwork 172.25.254.0/24 public4445 ####46 # Second, map the security name into a group name:4748 # groupName securityModel securityName49 #group notConfigGroup v1 notConfigUser50 #group notConfigGroup v2c notConfigUser51 group MyRWGroup v1 local52 group MyRWGroup v2c local53 group MyRWGroup usm local54 group MyROGroup v1 mynetwork55 group MyROGroup v2c mynetwork56 group MyROGroup usm mynetwork57 ####58 # Third, create a view for us to let the group have rights to:5960 # 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.163 view systemview included .1.3.6.1.2.1.25.1.164 view all included .1 8065 ####
69 #access notConfigGroup “” any noauth exact systemview none n one70 access MyROGroup “” any noauth exact all none none71 access MyRWGroup “” any noauth exact all all none72 # —
170 syslocation RHEL6.5171 syscontact Root
331 disk / 10000 systemctl start snmpd
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::ipAdEntIfIndexIP-MIB::ipAdEntIfIndex.10.52.115.4 = INTEGER: 24IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1IP-MIB::ipAdEntIfIndex.172.25.254.6 = INTEGER: 22IP-MIB::ipAdEntIfIndex.192.168.122.1 = INTEGER: 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: 1UCD-SNMP-MIB::dskPath.1 = STRING: /UCD-SNMP-MIB::dskDevice.1 = STRING: /dev/mapper/rhel-rootUCD-SNMP-MIB::dskMinimum.1 = INTEGER: 10000UCD-SNMP-MIB::dskMinPercent.1 = INTEGER: -1UCD-SNMP-MIB::dskTotal.1 = INTEGER: 225661280UCD-SNMP-MIB::dskAvail.1 = INTEGER: 102136208UCD-SNMP-MIB::dskUsed.1 = INTEGER: 123525072UCD-SNMP-MIB::dskPercent.1 = INTEGER: 55UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 0UCD-SNMP-MIB::dskTotalLow.1 = Gauge32: 225661280UCD-SNMP-MIB::dskTotalHigh.1 = Gauge32: 0UCD-SNMP-MIB::dskAvailLow.1 = Gauge32: 102136208UCD-SNMP-MIB::dskAvailHigh.1 = Gauge32: 0UCD-SNMP-MIB::dskUsedLow.1 = Gauge32: 123525072UCD-SNMP-MIB::dskUsedHigh.1 = Gauge32: 0UCD-SNMP-MIB::dskErrorFlag.1 = INTEGER: noError(0)UCD-SNMP-MIB::dskErrorMsg.1 = STRING:*******************************************************************************************************
网页端配置
打开网页http:172.25.254.10
在左边选Device 然后点击Add

这是创建好的然后点击右上方第一个添加虚拟机监控界面Console -> Graph Trees -> (Edit) -> Graph Tree Items

2.Spine 多线程监控在虚拟主机server6上编译cacti-spine:
tar zxf cacti-spine-0.8.8h.tar.gz
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
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
su – cacti
《1》/usr/local/spine/bin/spine
**********************************************************************
[root@server10 etc]# su – cacti-bash-4.1$ /usr/local/spine/bin/spineSPINE: Using spine config file [/etc/spine.conf]SPINE: Version 0.8.8h startingSPINE: Time: 0.0821 s, Threads: 5, Hosts: 3-bash-4.1$ **********************************************************************
网页添加
Console -> Cacti Settings
The path to Spine binary. /usr/local/spine/bin/spine **********************************************************************
vim /etc/php.ini ##修改PHP的时间区
946 date.timezone = Asia/Shanghai
/etc/init.d/httpd restart ##重启apache服务
cd /var/www/html/cacti/log
tail -f /var/www/html/cacti/log/cacti.log ##监控日志,或者用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/www/html/cacti/plugins
(2)浏览器页面操作:



搭建已经完成,过一段时间可以清楚的看到服务器性能变化曲线

相关推荐: 网络运维 – 你与真相就差一层窗户纸

大家好,我是姜汁啤酒。你可能觉得莫名其妙,从今年二月份这个经常上头版的网工兄弟,居然突然从51cto消失了,博客也不更新了?莫非,哥们,不会,和埃隆马斯克去火星了吧?其实,需要给大家解释解释,我消失了三个月一共完成了两件大事。我在51cto写了一个专栏:《老司…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 01/26 11:43
下一篇 01/26 11:43