【发布时间】:2019-07-11 09:01:52
【问题描述】:
我是 Nagios 的初学者,我正在尝试监视我的 unix 机器上的特定进程是否启动。 服务器和客户端在同一台机器上:试图从运行在其上的 Nagios 监控该机器。 我已经安装了 Nagios Core 4、nrpe 和它的插件。在网上查看后,我找到了如何使用 check_procs 插件(向上或向下)监视进程的答案,这就是我在文件中实际拥有的内容:
1- 在 /etc/nagios/nrpe.cfg
server_address=127.0.0.1
command[check_service]=/usr/lib/nagios/plugins/check_procs -c 1: -C $ARG1$
2- 我在 /usr/local/nagios/etc/servers/ 中创建了一个名为“ubunutu_host.cfg”的文件:
# Ubuntu Host configuration file
define host {
use linux-server
host_name ubuntu_host
alias Ubuntu Host
address 127.0.0.1
register 1
}
define service {
host_name ubuntu_host
service_description check_apache2
check_command check_service!apache2
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}
3- 在 /etc/nagios-plugins/configp/rocs.cfg 中:
define command{
command_name check_service
command_line /usr/lib/nagios/plugins/check_procs -c 1: -C ‘$ARG1$’
}
我的问题是: 运行此命令时:
/usr/lib/nagios/plugins/check_procs -c 1: -C apache2
这就是我的结果
PROCS OK: 7 processes with command name 'apache2' | procs=7;;1:;0;
但是在 Nagios 中,低于我所拥有的(apache2 总是很关键): Problem proc apache2 is always shown critical
【问题讨论】:
-
帮助大家!谢谢
-
serverfault.com 或 askubuntu.com 是解决这个问题的更好的论坛。 StackOverflow 用于编程问题,而 ServerFault 涵盖管理问题,AskUbuntu 涵盖一般问题。
-
尝试以 Nagios 用户身份运行此命令
/usr/lib/nagios/plugins/check_procs -c 1: -C apache2并尝试将‘$ARG1$’替换为"$ARG1$",以防万一……
标签: ubuntu apache2 monitoring nagios nrpe