markri/nagparser
最新稳定版本:0.1
Composer 安装命令:
composer require markri/nagparser
包简介
Nagios configuration parser
README 文档
README
Nagios Config Parser a simple parser written in PHP that parses Nagios config files (.cfg) into PHP objects, All definitions available in Nagios Nagios doc are read into PHP objects with getters for all options (easiness of autocompletion).
Currently it doesnt parse relations between definitions (yet).
Installation
Install with composer. See Packagist for versions and constraints. Or use your own PSR-0 compliant autoloader
Usage example
A little code example to fetch all service definitions from config
<?php
include 'vendor/autoload.php';
$parser = new NagParser\Parser('/usr/local/nagios/etc');
$parser->parse();
$checkServices = $parser->getServiceDefinitions();
// ... Whatever you want to with found definitions
Reason for existence
I wanted easy Nagios CFG editing, without repeated configs. So I came up with this parser to read all available services in order to create auto-generated servicegroups. This way I'm sure that no service will be left uncategorized, and would surely be in one of my servicegroups.
统计信息
- 总下载量: 411
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-01