【基本介绍】
nagios的客户端nrpe自带了check_procs可以监控进程的数量(nrpe2.13带有这个脚本,早期版本不确定)
【基本参数】
[root@local libexec]# ./check_procs -h
check_procs v1.4.15 (nagios-plugins 1.4.15)
Checks all processes and generates WARNING or CRITICAL states if the specified
metric is outside the required threshold ranges. The metric defaults to number
of processes. Search filters can be applied to limit the processes to check.
Usage:
check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-t timeout] [-v]
Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
-w, --warning=RANGE
Generate warning state if metric is outside this range
-c, --critical=RANGE
Generate critical state if metric is outside this range
-m, --metric=TYPE
Check thresholds against metric. Valid types:
PROCS - number of processes (default)
VSZ - virtual memory size
RSS - resident set memory size
CPU - percentage CPU
ELAPSED - time elapsed in seconds
-t, --timeout=INTEGER
Seconds before connection times out (default: 10)
-v, --verbose
Extra information. Up to 3 verbosity levels
Filters:
-s, --state=STATUSFLAGS
Only scan for processes that have, in the output of `ps`, one or
more of the status flags you specify (for example R, Z, S, RS,
RSZDT, plus others based on the output of your 'ps' command).
-p, --ppid=PPID
Only scan for children of the parent process ID indicated.
-z, --vsz=VSZ
Only scan for processes with VSZ higher than indicated.
-r, --rss=RSS
Only scan for processes with RSS higher than indicated.
-P, --pcpu=PCPU
Only scan for processes with PCPU higher than indicated.
-u, --user=USER
Only scan for processes with user name or ID indicated.
-a, --argument-array=STRING
Only scan for processes with args that contain STRING.
--ereg-argument-array=STRING
Only scan for processes with args that contain the regex STRING.
-C, --command=COMMAND
Only scan for exact matches of COMMAND (without path).
RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If
specified 'max:min', a warning status will be generated if the
count is inside the specified range
This plugin checks the number of currently running processes and
generates WARNING or CRITICAL states if the process count is outside
the specified threshold ranges. The process count can be filtered by
process owner, parent process PID, current state (e.g., 'Z'), or may
be the total number of running processes
Examples:
check_procs -w 2:2 -c 2:1024 -C portsentry
Warning if not two processes with command name portsentry.
Critical if < 2 or > 1024 processes
check_procs -w 10 -a '/usr/local/bin/perl' -u root
Warning alert if > 10 processes with command arguments containing
'/usr/local/bin/perl' and owned by root
check_procs -w 50000 -c 100000 --metric=VSZ
Alert if VSZ of any processes over 50K or 100K
check_procs -w 10 -c 20 --metric=CPU
Alert if CPU of any processes over 10%% or 20%%
Send email to nagios-users@lists.sourceforge.net if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to nagiosplug-devel@lists.sourceforge.net
【简单例子】
创建监控警告:进程名是salt-minion数量在1以外的
[root@locallibexec]# ./check_procs -w 1:1 -C salt-minion
PROCS OK: 1 process with command name 'salt-minion
【一些总结】
1.如果判断进程名
用扩展信息模式,就可以指定进程名字,进程状态等信息
[root@local libexec]# ./check_procs -vv -w 1:1 -C salt-minion
CMD: /bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'
Matched: uid=0 vsz=361980 rss=26648 pid=27079 ppid=1 pcpu=0.00 stat=Sl etime= prog=salt-minion args=/usr/bin/python2.6 /usr/bin/salt-minion -d
PROCS OK: 1 process with command name 'salt-minion'
[root@local libexec]# /bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args' | grep salt-minion
S+ 0 3628 3505 6056 576 0.0 grep grep salt-minion
Sl 0 27079 1 361980 26648 0.0 salt-minion /usr/bin/python2.6 /usr/bin/salt-minion -d
【参考】
http://bangbangsoundslikemachinery.blogspot.tw/2011/09/nagios-plugin-checkprocs-incorrectly.html
分享到:
相关推荐
解决nagios安装后输出process不能出图,这是重新编译后的check_procs,直接替换原来的就可以出图了
日志检查时我们平时用的非常多的一种监控方式,检查日志我们需要使用nagios插件,比如nagios自带的check_logfile,功能比较有限;我们使用ConSol Labs出品的check_logfiles,它能够处理截断日志,支持宏定义,支持...
nagios 检查 mysql 最全的工具集
资源分类:Python库 所属语言:Python 资源全名:nagios_graphite-0.1.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
nagios-3.5.1.tar.gz Nagios-Plugin-0.34.tar.gz nagios-plugins-1.4.16.tar.gz nrpe-2.12.tar.gz Params-Validate-0.91.tar.gz pnp-0.4.14.tar.gz Regexp-Common-2010010201.tar.gz rrdtool-1.2.14.tar.gz check_...
nagios-check-http-multi-ips 该插件旨在监视具有多个A记录的域的HTTP的多个IP地址。 使用示例 如果要使用P06C UserAgent检查A记录,请执行以下操作: check_...
nagios-check_MK nagios-check_mk 是 Shopify 的 dashing 框架的小部件,用于显示从具有 Check_MK 前端的 nagios 实例检索的数据这个 repo 包含一个定制的进度条小部件、一个示例仪表板条目和一个从一个或多个 Check...
nagios监控oracle,通过这个perl可以很好的实现对oracle的监控,比如:表空间,Buffer,IO,等等
nagios监控nginx状态脚本 教程http://2860664.blog.51cto.com/2850664/1564225
nagios-check_query-elasticsearch 这是一个基本的NodeJs Elasticsearch查询应用程序它运行一个弹性的seach查询并进行调整以警告返回值我将签入更多的变体并更新代码以使其更符合100%节点的要求,并使其更加通用
Supervision_Nagios-源码.rar
NULL 博文链接:https://leiyi-sz.iteye.com/blog/1850381
利用Nagios-XI-5.7.X远程代码执行RCE身份验证 Nagios XI 5.7.X-远程执行代码RCE(已认证)
Nagios插件,用于监视Java服务器中的JMX属性。
check_http2 Nagios check_http插件替代。 没有实现全部功能,只有我们需要。用法./check_http2 -hUsage: check_http2 [OPTIONS]Application Options: --timeout= Timeout to wait for connection (default: 300s) ...
与使用 Dashing 构建的 Check_MK 一起使用的仪表板 与 Check_MK 实例结合使用的简单仪表板 查看了解更多信息。 安装所需项目的指南,以便在新安装的 debian 7 上运行 dashing 以 root 身份登录并使用 adduser ####...
linux中的nagios监控原理和进程、端口监控配置文件及参数含义详解。
配合nagios使用,非常不错的数据库监控插件。
nagios-check_memcached_paranoid 该程序通过 memcached 协议检查 memcached(或兼容)服务器:SET、GET、DELETE 和 GET。 SET random_key set_value 获取随机密钥如果 got_value != set_value -> CRITICAL 删除...
Nagios SNMP Plugins package contains two plugins to be used with Nagios