Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

  • Posted by ufis on November 4, 2008 at 09:03

    I have quickly scanned the documentation about this product and could not find an answer.
    There is two things I would like to know before I install and try out this product:
    1. Can I use some of my existing java classes to perform tests for feedback into this monitoring tool?
    2. How difficult is it to incorporate these java classes?

    ufis replied 16 years, 3 months ago 3 Members · 6 Replies
  • 6 Replies
  • raul

    Member
    November 4, 2008 at 10:07
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Maybe it is necessary to clarify the idea:

    – You can use your java classes to perform test and the result of that tests can be sent to the Pandora Server (you can use your own way or use an agent that sends the data to the server), data inserted into the database and you can see it into the console.

    – You need and agent that can launch your java classes and get the answer. For instance, if you class is c:testertest.class and you get some values after run the java classes, you can send the data using a module like:

           module_begin
           module_name test
           module_type generic_data
           module_exec java -cp C:tester C:testertest |findstr "something"
           module_description Test Java Class
           module_end
    

    Where the agent (I suppose under Windows OS) runs the java class and looks for the “something” string.

    I don’t know if this is what you need, if not, please be more clear.

    Raúl

  • ufis

    Member
    November 4, 2008 at 11:16
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    My first look at a monitoring tool was nagios.

    So my java classes are set up for the nagios tool (except that I cannot get the java to work with nagios)
    I do not know how familiar you are with nagios but the plugins (your own tools that monitor someting) you create should write a short message to System.out and then exit with a specific code to indicate test success or failure. System.exit(0) for example.

    Now what I want to do with my java classes is, for example, pass it a url and see if that url is up with maybe checking for a specific phrase, or passing it database information and the java should be able to perform a simple query, or check to see if a specific web service is running, or whatever.

    But I would need a way to pass success/failure of the test back to pandora so that pandora can report on that. That is all. The java will perform all the testing and should pass back success/failure/warning status back to the monitoring tool.

    I hope this explains it a bit better.

    Looking at your reply I think I will go read up on modules.

  • Sancho

    Administrator
    November 4, 2008 at 13:39
    2321 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Check the plugin server system documentation. It’s easy and compatible with java or whatever you have, it just execute a command using a interface to pass parameters and reuse it, and your app only need to return a single value.

  • ufis

    Member
    November 5, 2008 at 03:56
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    [cite]Posted By: nil[/cite]
    Check the plugin server system documentation. It’s easy and compatible with java or whatever you have, it just execute a command using a interface to pass parameters and reuse it, and your app only need to return a single value.
    [span class=CommentSignature]Rasca y gana….[/span]

    Excellent.

    Now the more important question:
    If I have 50 java checks to make, once a minute, this method (going by the bold part in the quite) will have to create and destroy 50 jvm’s every minute. The overhead will be too much.
    Is there a way, provided by Pandora, to avoid the creation of the separate jvm’s ? Or run all java commands inside one existing jvm?

  • Sancho

    Administrator
    November 5, 2008 at 06:20
    2321 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Mmm. Interesting issue, I don’t think about this kind of problems before (before I usually work on scripting or small executable environments).

    To reduce overhead in the creation of a vm you probably need to change the way to obtain information. The standard plugin system works in this way:

    Pandora processor queure -> Call to plugin exec() -> Get data and insert into DB

    Overhead is in 2º step (creation and destruction of a VM). So don’t call in each call the VM, just let one running all the time and writting results on different “logfiles” (with a single value for each of them or mixed). If you have a “information daemon” running all the time (in an infinite loop with a sleep) writing to the files, the “plugin” only needs to make a cat of a file, this is much more “light” for the system.

    Another option is to use a modification of the agents to exec only once, produce a mixed results, and process it to “put” the pieces on the same agent XML write. This needs to be written as agent plugin, but its on agent and not centralized.

    Anyway, there is no “perfect” solution for a call to a vm, becase the problem is the overhead of starting the enviroment.

    Ideal solution will be to create a client-server model with a java server running the information gathering process and a single client (written in other language using a easy api to communicate). Pandora will use the client to get the data from the server, but… it needs some code working 🙂

  • ufis

    Member
    November 5, 2008 at 08:45
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Thank you for your answers.

    I think in the end I will have the monitoring tool make one call to java which will perform and log all the tests. Then make other separate (or one combined) calls to pick up the results from the logs.

    I’ll play around with calling the java from the tool each time or running it as a looping process and how each will affect performance and resources.

    Thank you for your time and answers.