我刚刚在Gentoo服务器上部署了Nagios,一切都很好,除了ssh,它标记为“CRITICAL”,因为它拒绝连接.但那是因为它运行在与默认端口22不同的端口上.如何更改它以便监视正确的端口?
解决方法
host:~$/usr/lib/nagios/plugins/check_ssh --help check_ssh v1991 (nagios-plugins 1.4.12) Copyright (c) 1999 Remi Paulmier <remi@sinfomic.fr> Copyright (c) 2000-2007 Nagios Plugin Development Team <nagiosplug-devel@lists.sourceforge.net> Try to connect to an SSH server at specified server and port Usage:check_ssh [-46] [-t <timeout>] [-r <remote version>] [-p <port>] <host>
这回答了你的问题了吗? -p参数允许您指定端口,在/etc/nagios/nrpe.cfg中进行自定义检查并放在那里:
command[check_remote_ssh]= /usr/lib/nagios/plugins/check_ssh -p 1234 some.host