Integrate Java application with Nagios

1

I'm developing an application that monitors assets (air conditioners, lamps, etc.) in a certain room and the floor plan of that room is illustrated in Nagios with assets in place.

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

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

    
asked by anonymous 05.11.2014 / 19:50

2 answers

0

As far as I know, Nagios does not work this way. Home It may be that he is mistaken, but in my experience he acts as a client of the systems to be monitored. In other words, it does not become passive, waiting for data from the monitored locations. It has an active role and it does itself a survey of the status of the resources with a predefined frequency by script, being able to use different plugins and protocols (my experience was with HTTP).

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

  • receive Nagios requests via JMX, HTTP, or some other supported protocol.
  • raise the status of monitored resources per socket.
  • pass information to Nagios (If you use HTTP, such as HTTP-Response from the Request coming from Nagios).     
  • 13.11.2014 / 14:13
    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 folders, so that Nagios could display 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:

  • What kind of monitoring should be done? With alarm in case of problems in monitored resources? Read only status on resources?
  • Response time of monitored requests has to be relatively small, so there is no http timeout since Nagios works synchronously.
  • Response type being returned to Nagios:
    • should contain all data already ready so that Nagios does not need to calculate anything.
    • It should also contain readable and understandable messages for end users.
  • I hope I was clear enough and could have helped.

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

        
    11.11.2014 / 14:50