加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 使用Nagios在非默认端口上监视ssh

发布时间:2020-12-13 18:19:42 所属栏目:Linux 来源:网络整理
导读:我刚刚在Gentoo服务器上部署了Nagios,一切都很好,除了ssh,它标记为“CRITICAL”,因为它拒绝连接.但那是因为它运行在与默认端口22不同的端口上.如何更改它以便监视正确的端口? 解决方法 host:~$/usr/lib/nagios/plugins/check_ssh --helpcheck_ssh v1991 (na
我刚刚在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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读