Ad Widget

Collapse

Best way to get data from a J2EE app into Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rowanseymour
    Junior Member
    • Nov 2011
    • 4

    #1

    Best way to get data from a J2EE app into Zabbix

    Hi - I'm looking at Zabbix as a tool for monitoring servers used in remote health clinics in Africa. Each health clinic has an electronic medical record server running OpenMRS which is a J2EE application. I would envisage that this server could then run a Zabbix agent to report back system data to a Zabbix server at a nearby hospital. The clinic server would also have a local Zabbix proxy so that data is not lost when connectivity is down... which is most of the time. What I'm not sure about is the best way to get data from OpenMRS into Zabbix... some here are some ideas and perhaps someone can advise on the best approach...

    1. Create a web service in OpenMRS which exposes the relevant data, and then configure the zabbix agent to request this as a user parameter using wget or curl. Downside to this is that the web service is a security liability

    2. Create scripts which query the OpenMRS database and run those as User parameters from the zabbix agent. This would mean tho that the scripts need the database credentials... another security liability

    3. Create a scheduled service in OpenMRS which will send the data itself to the Zabbix proxy. However I haven't been able to successfully send data to a server or a proxy yet using the JSON protocol. I this even possible? I keep trying to send item data using telnet - the server will respond with OK, but the data never appears anywhere, and nothing happens in the logs.

    Any ideas would be much appreciated
  • rowanseymour
    Junior Member
    • Nov 2011
    • 4

    #2
    Maybe if I ask just one simple question then I can get an answer...

    Is it possible for another application to send data to a Zabbix proxy?

    Comment

    • Davidus
      Senior Member
      • Dec 2010
      • 281

      #3
      In my personal opinion NO

      Comment

      • elemarmb
        Member
        • Mar 2009
        • 53

        #4
        Use zabbix_sender to send data to server or proxy.

        Comment

        • Yello
          Senior Member
          • Apr 2011
          • 309

          #5
          Originally posted by rowanseymour
          Maybe if I ask just one simple question then I can get an answer...
          Hmmn, that's a toughie. Condescension doesn't really deserve an answer you see...

          Originally posted by rowanseymour
          Is it possible for another application to send data to a Zabbix proxy?
          As the previous respondent mentioned, you could use zabbix_sender. If you want to avoid calls to the OS to call that command or write custom log output then you could code your own transmission agent, which it looks like you've been trying to do. Others have got it to work so if you think you need that continue looking into it.

          Also, have you considered exposing your metrics via JMX? I know nothing of OpenMRS but assume that it is JMX compatible. Most users I've come across, including my site, gather Java App stats via JMX.

          Regards,
          David

          Comment

          • rowanseymour
            Junior Member
            • Nov 2011
            • 4

            #6
            It wasn't intended as condescension - just desperation for an answer. I'll try again with the JSON stuff - that would seem simpler for now than using JMX.

            Thanks for the info!

            Comment

            • Yello
              Senior Member
              • Apr 2011
              • 309

              #7
              Originally posted by rowanseymour
              I'll try again with the JSON stuff - that would seem simpler for now than using JMX.
              Are you aware that it isn't vanilla JSON? I've tried coding a custom agent but I've read somewhere that the JSON isn't "pure". Have you read all of the docs on the subject?


              Regards,
              Dave

              Comment

              • rowanseymour
                Junior Member
                • Nov 2011
                • 4

                #8
                All I've tried is pasting the examples from http://www.zabbix.com/documentation/1.8/protocols/agent into a telnet connection... but it's not clear what <HEADER><DATALEN> are supposed to be. Any ideas?

                Comment

                Working...