Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Reports... again

Reports... again

Scheduled Pinned Locked Moved Support
8 Posts 6 Posters 44.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    R
    rostyslav
    wrote on last edited by
    #1

    So, I've got the reports working.
    I am able to generate many different reports for different time periods now.
    It required some additional scripting, so I decided to share it with those who might need it.
    The idea behind the scripts is following.
    We generate XML files, which is called subreports. Each subreport have its own SQL query and generate its own TimeSeries graph.
    After subreports have been generated we list them in the main XML report and compile the main report from command line.

    Steps to teach your server to generate reports (tested on Ubuntu):

    1. Download packages
    wget -r --no-parent https://svn.netxms.org/public/netxms/trunk/src/java/report-generator/
    wget http://repo1.maven.org/maven2/net/sf/jasperreports/jasperreports/4.7.0/jasperreports-4.7.0.jar
    
    1. Install required packages:
    sudo apt-get install sendemail maven2
    mvn install:install-file -DgroupId=jasperreports -DartifactId=jasperreports -Dversion=4.7.0 -Dpackaging=jar -Dfile=./jasperreports-4.7.0.jar
    
    1. Edit pom.xml to remove unnecessary dependencies:
    cd ./svn.netxms.org/public/netxms/trunk/src/java/report-generator/
    nano pom.xml
    
    1. Compile java package and copy it to your preferred location (I use /opt/netxms/java-lib/):
    mvn clean package
    cp ./svn.netxms.org/public/netxms/trunk/src/java/report-generator/target/report-generator.jar /opt/netxms/java-lib/
    
    1. Add the following to your netxmsd.conf (modify for your installation):
    JavaPath=/usr/bin/java
    JavaLibraryDirectory=/opt/netxms/java-lib
    JDBCDriver=org.postgresql.Driver
    JDBCUrl=jdbc:postgresql://localhost/netxms
    

    Steps to actually generate reports:

    1. Download script (xml-generation.pl, createMainXML.pm, createSubReport.pm)
    2. Install perl
    3. Modify SQL subqueries, descriptions, conditions, folder (where xml files should be stored) in the xml-generation.pl file to suit your needs. (If you are not using PostgreSQL you should also modify the DBI connection and query in createSubReport.pm)
    4. Run the xml-generation.pl script. It will generate subreports named <node_name>-<description>-<interval>.jrxml and main report named <interval>.jrxml
    5. Compile the report:
    "/usr/bin/java" -cp "/opt/netxms/java-lib/report-generator.jar" org.netxms.report.Generator "/etc/netxmsd.conf" "/opt/xml-reports/hourly.jrxml" "/opt/reports/hourly.output"
    
    1. Convert it to pdf:
    "/usr/bin/java" -cp "/opt/netxms/java-lib/report-generator.jar" org.netxms.report.Exporter "/opt/reports/hourly.output" "/opt/reports/hourly.pdf"
    
    1. And send it to your e-mail:
    sendemail -f "[email protected]" -t "[email protected]" -m "Hourly report" -u "Report" -a "/opt/reports/hourly.pdf"
    

    Best regards,
    Rostyslav


    xml-generation.pl

    createMainXML.pm

    createSubReport.pm

    1 Reply Last reply
    0
    • S
      S
      sohgnar
      wrote on last edited by
      #2

      Has anyone configured reports with NetXMS server installed on a windows machine?

      1 Reply Last reply
      0
      • M
        M
        mialkfl
        wrote on last edited by
        #3

        Hi Gentlemen

        I was not able to get reports working on a windows machine so far, too. Could you please post a short guide on how to implement reports module on windows machines?

        Thanks in advance and best regards
        Florian Mialki

        1 Reply Last reply
        0
        • P
          P
          Santosh Khanna
          wrote on last edited by
          #4

          Is there any external tools by which we can generate reports on Windows Installation?

          1 Reply Last reply
          0
          • Y
            Y
            yshiro
            wrote on last edited by
            #5

            @phonix786 said in Reports... again:

            Is there any external tools by which we can generate reports on Windows Installation?

            Hi phonix, i´m using http://community.jaspersoft.com/project/ireport-designer, with iReport you can generate a jrxml file extension, this file will be used by netxms when we succesfully install reports on netxms with windows server.

            I have some reports created, like capacity of switches.

            Greetings.

            1 Reply Last reply
            0
            • A
              A
              Alex Kirhenshtein
              wrote on last edited by
              #6

              I highly recommend you to use Jaspersoft Studio (http://community.jaspersoft.com/project/jaspersoft-studio) instead of iReport

              1 Reply Last reply
              0
              • Y
                Y
                yshiro
                wrote on last edited by
                #7

                @alk said in Reports... again:

                I highly recommend you to use Jaspersoft Studio (http://community.jaspersoft.com/project/jaspersoft-studio) instead of iReport

                Hi Victor, ill give a try, thanks!

                Greetings.

                1 Reply Last reply
                0
                • R
                  R
                  rostyslav
                  wrote on last edited by
                  #8

                  I've rewritten the script to PHP. Now it is much more cleaner and easier to understand.
                  Link to github: https://github.com/frostyslav/netxms-report-generator

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  Powered by NodeBB Contributors
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups