Giter Site home page Giter Site logo

livestatus4j's Introduction

livestatus4j

Java Client Library for mk_livestatus by Matthias Kettner

About

Livestatus is a broker module for for Nagios which is a system-monitoring application. It enables the user to query information about the statuses of the objects directly out of the nagios core using lql (Livestatus Query Language).

Features

  • querying of nagios objects snd statuses directly over the network using a lightweight protocol
  • implemented so far: Tables (HOSTS, SERVERICES), Columns, Filters

Getting Started

  • Download the latest release

      wget https://github.com/hey-johnnypark/livestatus4j/zipball/master
    
  • Extract the project

      tar xvf livestatus4j-xxx.zip
    
  • Include the .jar file in your Java Buildpath

  • Use it!

      import static foo.bar.livestatus.LiveStatusTable.HOSTS;
      import foo.bar.livestatus.LiveStatusConn;
      import foo.bar.livestatus.LiveStatusQuery;
      import foo.bar.livestatus.LiveStatusResult;
      import foo.bar.livestatus.LiveStatusResultEntry;
    
      LiveStatusConn lsc = new LiveStatusConn("nagios-host", 6557); //set up the tcp connection
      LiveStatusQuery lsq = new LiveStatusQuery(HOSTS).addColumn("address").addColumn("name"); //create the query and add specific columns you like to query
      LiveStatusResult lsr= lsc.query(lsq); //lsq is an Array of LiveStatusResultEntry instances 
      LiveStatusResultEntry lsre= lsr.get(0); //retrieves the first entry
      
      System.out.println("HOST_NAME: " + lsre.get("name")); //prints the host name
      System.out.println("HOST_ADDRESS: " + lsre.get("address")); //prints the host address
      System.out.println("Results count: " + lsr.size()); //how many entries have been retrieved in total
    

livestatus4j's People

Contributors

hey-johnnypark avatar

Stargazers

David Ecker avatar Jan Minder avatar

Watchers

 avatar David Ecker avatar

livestatus4j's Issues

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.