Giter Site home page Giter Site logo

nagiostatus's People

Contributors

cpliakas avatar

Stargazers

 avatar

Watchers

 avatar  avatar

nagiostatus's Issues

Implement pluggable parsers

Currently the parser assumes a 3.x config file. The parser should be pluggable so that alternate parsers can be leveraged to handle different Nagios versions in addition to future versions that haven't been released yet.

Improve performance of parsing

Current every line is evaluated by at lease one regular expressions. If we change the logic of the parser, the 80% case could be handled first (which is parsing reports inside a status block) and we can probably eliminate the regular expressions as well.

Implement the observer pattern so that loggers can be added

Pluggable logging functionalities that wrap around systems such as Zend_Log or Drupal's watchdog should be implemented by this library to capture errors and debugging information.

UPDATE: Implementing the observer pattern should work fine without explicitly adding the loggers.

Reduce memory consumption

Currently the script will consume about 100MB of memory when parsing an 11MB file. This is due to creating an array from the parsed file as well as storing the entire document in memory prior to outputting. The code should be refactored so that the plugins can output the content directly so that no bog data structures are stored in memory.

Fix false positive in error detection

The buildDocument() method incorrectly identifies empty lines as being invalid. The logic should be modified to correctly handle empty lines. There is no error handling currently in place to the library still works, but it will cause problems when we implement the observer pattern.

Provide fluent interface

It'd be nice if the Parser provided a fluent interface so you could do:

<?php
  $document = new SimpleXMLElement(Nagiostatus_Parser::instance('/usr/local/nagios/var/status.dat')
    ->render('xml', true));
?>

You could also chain your registerPlugin() calls instead of making them static methods.

Come up with a more useful XML format

Currently the XML structure closely matches the status.dat structure, so it isn't very useful when used on conjunction with things like XPath. We should come up with a structure that makes it easy to navigate the file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.