从日志中收集响应时间的nagios插件。
nagios.responsetime的Python项目详细描述
从日志中收集响应时间的nagios插件。
用法:check_responsetime --logfile /path/to/logfile
插件会记住它在每个日志项上看到的最新日志项的时间戳。 运行,下次运行时只考虑较新的日志项。
Log format
支持的日志格式如下:
<timestamp> "<http-verb> <path> <http-version>" <responsetime>
- 时间戳:%d/%b/%y:%h:%m:%s%z
- http动词:get,post
- 路径:请求的url路径
- http版本:例如http/1.1
- 以秒为单位的响应时间,例如0.5
示例:
17/May/2011:14:11:18 +0200 "GET /index.html HTTP/1.1" 0.289
nginx服务器的示例配置如下:
http { log_format timing '$time_local "$request" $upstream_response_time'; server { access_log /path/to/timing.log timing; } }
Future directions
一个明显的附加特性是定义阈值的能力(例如“a 3秒以上的平均响应时间为警告,5秒以上为关键“
Development
源代码可以在Mercurial存储库中找到 https://code.gocept.com/hg/public/nagios.responsetime
请将发现的任何错误报告给Wolfgang Schnerring。
内容
Changes
1.0.4 (2012-12-07)
- 明确声明我们对nagiosplugin的依赖性<;0.5
- 修复测试套件中的API不兼容。
1.0.3 (2011-12-08)
- 如果此检查期间没有可用记录,则返回空性能 值(全部为零)以避免仅为噪声的未知状态。
1.0.2 (2011-11-14)
- 修正了只有一个条目(9332)时被零除的错误。
1.0.1 (2011-09-04)
- 修复了当前间隔(9332)没有日志项时的错误。
1.0 (2011-07-01)
- 修复了日志文件行不完整的错误(“float()的文本无效:-”)。
1.0rc1 (2011-06-10)
- 第一次释放。