监视puppet代理运行的检查
check-puppet-agent的Python项目详细描述
WYWYGMBH/支票傀儡代理
一个小的脚本,很少依赖于它来检查puppet代理的状态 运行
它作为sensu check插件进行测试,但也与 NGIOS/ICIGA/…由于类似的退出代码
安装
依赖关系
要求如下:
- argparse(命令行参数分析)
- yaml(读取傀儡状态文件)
- six(python 2和3兼容性)
管道
该软件包在pypi上很容易获得,只需使用 pip,这还包括命令行脚本
$pip安装检查傀儡代理
转速
目前没有提供预构建的RPM包,但是您可以构建 您只需使用一些简单的命令即可完成这些任务
$git clone…$cd check puppet agent$python setup.py bdist_RPM
使用量
注意:脚本将作为puppet用户或根用户运行,否则它不是 能够读取所需文件
$ check-puppet-agent [CRITICAL] applying catalog compiled at 2015-12-06 21:50:21 (1 days 20 hours 3 minutes 23 seconds ago) [ OK] last run on 2015-12-08 17:36:19 (17 minutes 25 seconds ago) [ OK] => last run took 11 seconds
如果代理被puppet agent --disable "test"
禁用,则示例$ check-puppet-agent [ WARNING] puppet agent is disabled - reason: test [CRITICAL] applying catalog compiled at 2015-12-06 21:50:21 (1 days 20 hours 4 minutes 53 seconds ago) [ OK] last run on 2015-12-08 17:36:19 (18 minutes 55 seconds ago) [ OK] => last run took 11 seconds
选项
$ check-puppet-agent --help usage: check_puppet [-h] [--warning-run-age WARNING_RUN_AGE] [--critical-run-age CRITICAL_RUN_AGE] [--warning-catalog-age WARNING_CATALOG_AGE] [--critical-catalog-age CRITICAL_CATALOG_AGE] [--warning-run-duration WARNING_RUN_DURATION] [--critical-run-duration CRITICAL_RUN_DURATION] [--filename FILENAME] [--disabled-lock-file DISABLED_LOCK_FILE] [--run-lock-file RUN_LOCK_FILE] optional arguments: -h, --help show this help message and exit --warning-run-age WARNING_RUN_AGE warn at age of last puppet run in seconds (default: 1h5m) => 0s to disable --critical-run-age CRITICAL_RUN_AGE critical at age of last puppet run in seconds (default: 2h10m) => 0s to disable --warning-catalog-age WARNING_CATALOG_AGE warn at catalog age in seconds (default: 1h5m) => 0s to disable --critical-catalog-age CRITICAL_CATALOG_AGE critical at catalog age in seconds (default: 2h10m) => 0s to disable --warning-run-duration WARNING_RUN_DURATION warn at puppet run duration in seconds (default: 20m) => 0s to disable --critical-run-duration CRITICAL_RUN_DURATION critical at puppet run duration in seconds (default: 30m) => 0s to disable --filename FILENAME the puppet state file to parse --disabled-lock-file DISABLED_LOCK_FILE the path to the lock file if the agent is disabled --run-lock-file RUN_LOCK_FILE the path to the lock file if the agent is running
许可证
版权所有2015 WYWY GmbH
根据apache许可证2.0版(以下简称“许可证”)授权;您可以 除非符合许可证,否则不要使用此文件。你可以获得 在
http://www.apache.org/licenses/LICENSE-2.0除非适用的要求 法律或书面同意,根据许可证分发的软件是 按“原样”分配,无任何保证或条件 善意的,明示的或暗示的。具体见许可证 管理许可下的权限和限制的语言。
这个脚本由wywy GmbH的devops人员自豪地呈现。