企业级监控介绍

2017年3月6日23:58:47 发表评论 2,930 ℃

企业级监控

SNMP

RRDTool

cacti

展示

时间序列数据

Nagios

SNMP

net-snmp(Agent) 被监控端

net-snmp-utils(NMS:command) 监控端

安装SNMP

#yum install net-snmp net-snmp-utils -y

#service snmpd start

#snmpwalk -v 2c -c public localhost

#snmpget -v 2c -c public localhost

#vim /etc/snmp/snmpd.conf 

添加view    systemview    included   .1.3.6.1.2.1.6

#service snmpd restart

#snmpwalk -v 2c -c public localhost tcp | grep established | wc -l  //查看已建立的链接

#vim /etc/snmp/snmpd.conf   

com2sec notConfigUser  default       public 修改为

com2sec notConfigUser  127.0.0.1      mypublic  // 只允许本地获取信息

#service snmpd restart

#snmpnetstat -v 2c -c mypublic -Can -Cp tcp 127.0.0.1

RRDtool

#yum install rrdtool -y

#rrdtool create test.rrd --step 5 DS:testds:GAUGE:8:0:U RRA:AVERAGE:0.5:1:17280 RRA:AVERAGE:0.5:10:3456 RRA:AVERAGE:0.5:100:1210

#rrdtool info test.rrd //查看

#vim rrd.sh

#!/bin/bash

while true;do

   rrdtool update test.rrd N:$RANDOM

   sleep 5

done

#rrdtool fetch -r 5 test.rrd AVERAGE //查看每隔5秒的平均数据

#rrdtool graph a.png --step 5 -s 1486666900 -t Test  -v vtest DEF:vtest=test.rrd:testds:AVERAGE LINE1:vtest#ff0000:testline

#rrdtool graph b.png -s 1486666900 -t Test  -v vtest DEF:vtest=test.rrd:testds:AVERAGE:step=5 DEF:vartest2=test.rrd:testds:AVERAGE:step=50 LINE1:vtest#ff0000:testline LINE1:vartest2#00FF00:testline2

cacti

rrdtool  create

周期性执行能够取得数据的命令,并将取回的数据保存至rrd文件中

利用rrdtool绘图并展示

php开发网页程序

LAMP,LNMP

编译安装php需启用--enable-sockets

插件机制

thold报警插件

模板

图形模板

数据模板

主机模板

收集方法:数据收集方法

数据查询:xml格式数据收集方法

数据输入方法:命令或者脚本

脚本:

只需要指定如何获取数据,并且获取到的数据经过处理后要按规定输出

TAG:data  TAG:data

input:30   output:40

Nagios

监控工具

主机,服务/资源

OK,AWRNGING,CRITICA,UNKNOWN

比如:CPU:90%(CRITICAL),80%(WARNING), OK ,UNKNOWN

报警系统

Nagios Core

不做任何监控工作

Plugins(scripts)

ssh 、nrpe(远程端安装nrpe进程,控制端也要按照nrpe )、snmp(支持windows、打印机)、NSCA(被动监控)、NSClient++(windows)、xyz(自定义)

几种对象实现监控工作

主机、主机组

服务/资源,服务组

联系人

时段

命令  (模板—>应用到么讴歌被监控对象,以实现具体的监控)

安装

服务器端 

Nagios Daemon 

Nagios Plugins

【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: