系统级监控

cpu (system, user)
memory (cache, buffer, use)(MB)
load (cpu core)
diskspace (used, inode)(GB)
diskio (read, write, io)
traffic (in, out)(Mb)

应用级监控

tcp connection
nfs mount
web access user count
lvs
haproxy

install

yum -y install xinetd
yum -y install check-mk-agent-1.2.6p2-1.noarch.rpm

/etc/xinetd.d/check_mk

service check_mk
{
type = UNLISTED
port = 6556
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/check_mk_agent # If you use fully redundant monitoring and poll the client
# from more then one monitoring servers in parallel you might
# want to use the agent cache wrapper:
#server = /usr/bin/check_mk_caching_agent # configure the IP address(es) of your Nagios server here:
#only_from = 127.0.0.1 10.0.20.1 10.0.20.2 # Don't be too verbose. Don't log every check. This might be
# commented out for debugging. If this option is commented out
# the default options will be used for this service.
log_on_success = disable = no
}

/usr/lib/check_mk_agent/plugins

These plugins can be installed in the plugins directory of the Linux agent
in /usr/lib/check_mk_agent/plugins/. Please only install the plugins that
you really need. If you want a plugin to be run asynchronously and also in
a larger interval then the normal check interval, then you can
copy it to a subdirectory named after a number of *minutes*,
e.g.: /usr/lib/check_mk_agent/plugins/60/mk_zypper In that case the agent will: - Run this plugin in the background and wait not for it to finish.
- Store the result of the plugin in a cache file below /etc/check_mk/cache.
- Use that file for one hour before running the script again.

plugins example

# Run and *send* only once every __ seconds
. $MK_CONFDIR/mk_inventory.cfg 2>/dev/null || true # Default to four hours
INTERVAL=${INVENTORY_INTERVAL:-14400} FLAGFILE=$MK_VARDIR/mk_inventory.last.$REMOTE
LAST_RUN=$(stat -c %Y $FLAGFILE)
NOW=$(date +%s)
UNTIL=$((NOW + INTERVAL + 600)) if [ $(( NOW - LAST_RUN )) -ge $INTERVAL ]
then
touch $FLAGFILE # List of DEB packages
if type dpkg-query >/dev/null; then
echo "<<<lnx_packages:sep(124):persist($UNTIL)>>>"
dpkg-query --show --showformat='${Package}|${Version}|${Architecture}|deb|${Summary}|${Status}\n'
fi # List of RPM packages in same format
if type rpm >/dev/null; then
echo "<<<lnx_packages:sep(9):persist($UNTIL)>>>"
rpm -qa --qf '%{NAME}\t%{VERSION}\t%{ARCH}\trpm\t%{SUMMARY}\t-\n'
fi # Information about distribution
echo "<<<lnx_distro:sep(124):persist($UNTIL)>>>"
for f in /etc/{debian_version,lsb-release,redhat-release,SuSE-release} ; do
if [ -e $f ] ; then
echo -n "$f|" ; tr \\n \| < $f | sed 's/|$//' ; echo
fi
done # CPU Information. We need just the first one
if [ -e /proc/cpuinfo ] ; then
echo "<<<lnx_cpuinfo:sep(58):persist($UNTIL)>>>"
sed 's/[[:space:]]*:[[:space:]]*/:/' < /proc/cpuinfo
fi # Information about main board, memory, etc.
if type dmidecode >/dev/null ; then
echo "<<<dmidecode:sep(58):persist($UNTIL)>>>"
dmidecode -q | sed 's/\t/:/g'
fi # Information about kernel architecture
if type uname >/dev/null ; then
echo "<<<lnx_uname:persist($UNTIL)>>>"
uname -m
uname -r
fi
if type lspci > /dev/null ; then
echo "<<<lnx_vga:sep(58):persist($UNTIL)>>>"
lspci -v -s $(lspci | grep VGA | cut -d" " -f 1)
fi fi

监控系统 - check_mk_agent的更多相关文章

  1. Opserver开源的服务器监控系统(ASP.NET)

    Opserver是Stack Exchange下的一个开源监控系统,系统本身由C#语言开发的ASP.NET(MVC)应用程序,无需任何复杂的应用配置,入门很快.下载地址:https://github. ...

  2. prometheus监控系统

    关于Prometheus Prometheus是一套开源的监控系统,它将所有信息都存储为时间序列数据:因此实现一种Profiling监控方式,实时分析系统运行的状态.执行时间.调用次数等,以找到系统的 ...

  3. 利用WCF的双工通讯实现一个简单的心跳监控系统

    何为心跳监控系统? 故名思义,就是监控某个或某些个程序的运行状态,就好比医院里面的心跳监视仪一样,能够随时显示病人的心跳情况. 心跳监控的目的是什么? 与医院里面的心跳监视仪目的类似,监控程序运行状态 ...

  4. 分布式监控系统Zabbix-3.0.3-完整安装记录(7)-使用percona监控MySQL

    前面已经介绍了分布式监控系统Zabbix-3.0.3-完整安装记录(2)-添加mysql监控,但是没有提供可以直接使用的Key,太过简陋,监控效果不佳.要想更加仔细的监控Mysql,业内同学们都会选择 ...

  5. 监控系统Opserver的配置调试

    Stack Exchange开源其监控系统Opserver有一段时间了.之前在项目中用过他们的MiniProfile来分析页面执行效率和帮助新人了解项目,当他们开源了其监控系统的时候正好部门也在关注监 ...

  6. 日志监控系统中,大批量查询mysql方案

    最近开发遇到一个问题:需要查询一个大时间段内的数据,分1000个小段,即为1000个点.X轴是时间,Y轴是该小时间段内统计后数据.注意:数据返回是一个list,其中每个对象返回值都是该小时间段内数据统 ...

  7. day26 分布式监控系统开发

    本节内容 为什么要做监控? 常用监控系统设计讨论 监控系统架构设计 监控表结构设计 为什么要做监控? –熟悉IT监控系统的设计原理 –开发一个简版的类Zabbix监控系统 –掌握自动化开发项目的程序设 ...

  8. 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码

    本文为 Dennis Gao 原创技术文章,发表于博客园博客,未经作者本人允许禁止任何形式的转载. 开源倾情奉献系列链接 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码 开源倾 ...

  9. Zabbix监控系统深度实践

    Zabbix监控系统深度实践(企业级分布式系统自动化运维必选利器,大规模Zabbix集群实战经验技巧总结,由浅入深全面讲解配置.设计.案例和内部原理) 姚仁捷 著  ISBN 978-7-121-24 ...

随机推荐

  1. VALGRIND

    系统编程中一个重要的方面就是有效地处理与内存相关的问题.你的工作越接近系统,你就需要面对越多的内存问题.有时这些问题非常琐碎,而更多时候它会演变成一个调试内存问题的恶梦.所以,在实践中会用到很多工具来 ...

  2. IGS_学习笔记10_IREP监控SOA Integration和日志设定(案例)

    20150506 Created By BaoXinjian

  3. jquery extend中

    var $=123; <src="jquery.js"> //加载jquery.js的时候           里面有句 _$=window.$,保存123的 //no ...

  4. protobuf使用说明

    1..proto文件为要生成.java文件的模板文件,其中包含名称空间.文件名等信息2.cmd中进入当前目录D:\JAVA\protoc-2.5.0-win323.运行 protoc.exe --ja ...

  5. SQL 优化原则

    一.问题的提出 在应用系统开发初期,由于开发数据库数据比较少,对于查询SQL语句,复杂视图的的编写等体会不出SQL语句各种写法的性能优劣,但是如果将应用 系统提交实际应用后,随着数据库中数据的增加,系 ...

  6. 在ubuntu下安装phpmyadmin 出现404错误

    在ubuntu下安转phpmyadmin 只要一条命令: Sudo apt-get install phpmyadmin 安装完成后,在浏览器里输入http://localhost/phpmyadmi ...

  7. HOST ip is not allowed to connect to this MySql server

    报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在loc ...

  8. A - Red and Black(3.2.1)(小递归)

    Description There is a rectangular room, covered with square tiles. Each tile is colored either red ...

  9. 合并 hdfs 文件

     待研究,只做保存 将HDFS中不同目录下面的数据合在一起,并存放在指定的目录中,示例如: sqoop merge –new-data /test/p1/person –onto /test/p2 ...

  10. T4 模板的调试方法,方便大家遇到问题自己快速定位和优化

    T4 模板的调试方法,方便大家遇到问题自己快速定位和优化 :1. .ttinclude文件的第一行修改为 <#@ template language="C#" debug=& ...