基于 Telnet 的 check_mk 检查 [英] Telnet based check_mk checks

查看:65
本文介绍了基于 Telnet 的 check_mk 检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个基于 telnet 的检查.每 5 分钟检查一次网络设备的 telnets 并在其上运行一些命令并获取输出.

I want to implement a check which is telnet based. In every 5 minutes check telnets a network device and run some command on it and get the output.

是否有可能对此进行被动检查,check_mk 是否提供任何工具来进行基于 telnet 的被动检查.

Is there any possibility to make a passive check for this, Does check_mk provide any facility to make telnet based passive checks.

推荐答案

telnet 部分你应该看看

for the telnet part you should take a look at

为 Telnet 会话创建脚本?

对于我想添加的 Check_MK 部分:要完成每 5 分钟运行一次脚本的要求,您可以在 Check_MK 本地插件目录 (/usr/lib/check_mk_agent/local/) 内创建一个文件夹,以时间命名秒作为名称.例如,Check_MK 将每 300 秒运行/usr/lib/check_mk_agent/local/300/中的每个脚本,并将之前的检查结果保存在代理的缓存中.

for the Check_MK part I want to add: to accomplish the requirment to run the script every 5 minutes you can create a folder insider the Check_MK local plugin directory (/usr/lib/check_mk_agent/local/) named with the time in seconds as name. Check_MK will for example run every script inside /usr/lib/check_mk_agent/local/300/ every 300 seconds and hold the previous check result in cache for the agent.

https://mathias-kettner.de/checkmk_localchecks.html

有时脚本会运行超过几秒钟.如果一个代理的所有脚本和插件的运行时间超过了监控核心主动检查的超时时间(通常是 60 或 120 秒),那么完整的检查将被中止.为了避免这种情况,您可以异步运行本地检查并使用缓存文件.这是通过将您的脚本放入一个以数字命名的子目录中来完成的 - >脚本输出有效的秒数:

Sometimes a script will run for longer than a few seconds. If the run time of all script and plugins of an agent exceed the timeout for active checks of the monitoring core (usually 60 or 120 seconds), then the complete check will be aborted. In order to avoid this you can have local checks be run asynchronously and use cache files. This is done by putting your script into a subdirectory that is named by a number - the number of seconds that >the output of the script is valid:

/usr/lib/check_mk_agent/local/300/myscript

/usr/lib/check_mk_agent/local/300/myscript

在这种情况下,代理将:

In this case the agent will:

在后台运行此脚本,不要等待它完成.将脚本的结果存储在/etc/check_mk/cache 下的缓存文件中.在再次运行脚本之前使用该文件 300 秒.

Run this script in the background and wait not for it to finish. Store the result of the script in a cache file below /etc/check_mk/cache. Use that file for 300 seconds before running the script again.

这篇关于基于 Telnet 的 check_mk 检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆