监视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人员自豪地呈现。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在某些练习中避免索引异常   java Android,如何在具有socket的网络区域上提高性能?   更改web中的执行顺序后,JavaServlet过滤器不起作用。xml   java如何绑定泛型类?   JavaGmail RESTAPI:使用Google凭证而不模拟   java是解码整数序列的最快方法   java根据hashmaps的值(通过map的值进行比较)对hashmaps的数组列表进行排序   用于JBoss 7.1或Apache的java负载平衡器,带有Healt检查   java非常慢的MySQL读取性能   java如何在使用iRetryAnalyzer时从Windows CMD关闭Selenium WebDriver?   java随机闪烁仅出现在Galaxy Note 4上   java AttributeOverride MappedSuperClass属性的类型不同   java JPA:如何检测现有实体是否已更新?   java如何使用mavenassemblyplugin从dependencySet中删除METAINF?   安装SecurityManager时,java MQQueueManager构造函数挂起