2017 © Pedro Peláez
 

library nagparser

Nagios configuration parser

image

markri/nagparser

Nagios configuration parser

  • Sunday, February 1, 2015
  • by markri
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Nagios Config Parser

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)., (*1)

Currently it doesnt parse relations between definitions (yet)., (*2)

Installation

Install with composer. See Packagist for versions and constraints. Or use your own PSR-0 compliant autoloader, (*3)

Usage example

A little code example to fetch all service definitions from config, (*4)

<?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., (*5)

The Versions

01/02 2015

dev-master

9999999-dev

Nagios configuration parser

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

parser config nagios

01/02 2015

0.1

0.1.0.0

Nagios configuration parser

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

parser config nagios