JSend NSCA

Java API and command-line tool for sending Nagios Passive Checks to NSCA
Download

JSend NSCA Ranking & Summary

Advertisement

  • Rating:
  • License:
  • The Apache License 2.0
  • Price:
  • FREE
  • Publisher Name:
  • Rajneesh Patel
  • Publisher web site:
  • http://code.google.com/u/rajneeshpatel/

JSend NSCA Tags


JSend NSCA Description

Java API and command-line tool for sending Nagios Passive Checks to NSCA JSend NSCA is a Java API and command line tool for sending Nagios Passive Checks to the Nagios NSCA add on.By using the JSend NSCA core API, you can easily integrate your Java applications into a Nagios monitored environment thereby notifying Nagios of problems and issues during the running of your application.The Jsend NSCA CLI (command-line interface) tool wraps the API and allows you to send passive checks from the command-line.JSend NSCA was developed as the company I’m working for uses Nagios to monitor applications and servers. For existing applications written in Perl and c, there are options available to send passive checks but for Java applications, the option available was to shell out and execute the send_nsca command line tool.Although send_nsca worked in this manner, it’s ugly and we preferred having the code within our applications for better performance, testability, cleanliness...A search on the internet revealed a few options such as the NagiosAppender for log4j but in the end we settled on writing our own client. This client is currently in use thus proving the feasibility of the approach.On the back of this, I decided to write JSend NSCA from the ground up as an exercise in TDD and thought I would make it available as an open source project so other developers can benefit from the functionality.Quick Start Example Codeimport java.io.IOException;import com.googlecode.jsendnsca.core.*;import com.googlecode.jsendnsca.core.builders.*;public class QuickStart { public static void main(String[] args) { NagiosSettings nagiosSettings = NagiosSettingsBuilder .withNagiosHost("localhost") .withPort(5667) .withConnectionTimeout(5000) .withResponseTimeout(15000) .withPassword("password") .create(); NagiosPassiveCheckSender sender = new NagiosPassiveCheckSender( nagiosSettings); MessagePayload payload = MessagePayloadBuilder .withHostname("localhost") .withLevel(Level.CRITICAL) .withServiceName("Test Service Name") .withMessage("Test Message") .create(); try { sender.send(payload); } catch (NagiosException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }} Requirements: · Java 2 Standard Edition Runtime Environment What's New in This Release: · Number of fixes, particularly to builders in order to make them thread safe and enhancements to non blocking sender. Many thanks to Claus Ibsen for raising and fixing these issues.


JSend NSCA Related Software