Integrate Java application with Nagios

Asked

Viewed 156 times

1

I am developing an application that monitors assets (air conditioners, lamps, etc.) in a certain room and the floor plan of this room is illustrated in Nagios with the assets in their proper places.

I would like after my application did a status check of these assets (check if they are turned on or off) to be displayed in Nagios these status.

How to pass these parameters to Nagios? How to get Nagios to receive information from my application?

2 answers

4

I’ve done something similar.

In my case, my Java application received http requests from the Nagios system and returned the responses in pre-defined pads, so that Nagios could show them.

When a request was received by the application, it raised the status of the monitored resources and sent the response to Nagios. If you use this mechanism, there are 3 things to consider:

  1. What kind of monitoring to be done? With alarm in case of problems in the monitored resources? Read-only status in resources?
  2. Response time of monitored rejects has to be relatively small, not to have an http timeout, since Nagios works synchronously.
  3. Type of response being returned to Nagios:
    • should contain all data already ready for Nagios not need to calculate anything.
    • shall also contain messages that are readable and understandable to end-users.

I hope I’ve been clear enough and I can help.

If you have questions, do not hesitate to write them.

  • 1

    My application communicates with controllers via socket. These controllers send me information like current temperature of the environment, whether the lamps and air conditioning are on or off... anyway, when receiving this information from the controllers wanted to send this information to Nagios for it to show in the floor plan of the room, for example, if a lamp is out it displays an image of a red lamp, if it is on it displays a yellow image.

0


As far as I know, Nagios doesn’t work this way.
I may be mistaken, but in my experience, he acts as a client of the systems being monitored.
In other words, it is not passive, waiting for data from the monitored resources. He plays an active role and makes a survey of the status of resources with a predefined frequency per script, being able to use different plugins and protocols (my experience was with HTTP).

In this case, its Java application would only be a mediator between Nagios and the monitored resources. It would have the following role:

  • receive requests from Nagios via JMX, HTTP or some other supported protocol.
  • raise the status of resources monitored by socket.
  • pass the information to Nagios (If you use HTTP, such as Request HTTP-Response from Nagios).
    • That’s right. My application will be waiting for a Nagios request and soon after will check the assets and return the status to Nagios. How to proceed to accomplish such a task? Have some tutorial that can show how to configure Nagios to send requests for application and how the application should send the information?

    • Dear Anderson, I think these questions related to Nagios come out of the scope of this forum. But google is your best friend in this case. I found some interesting things already: https://twindb.com/about-nagios-best-practices/, http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html, http://nagios-plugins.org/documentation/, http://wiki.monitoring-portal.org/Nagios/tips/start. There is much more to be found. Good luck!

    • It does not escape the scope because my doubt is how to integrate my Java application with Nagios, it is not only in relation to the settings of Nagios itself.

    • Anyway thank you for the answers.

    Browser other questions tagged

    You are not signed in. Login or sign up in order to post.