List of IP's

Started by DanG, October 03, 2011, 02:58:58 PM

Previous topic - Next topic

DanG

Hi,

Is there a way to produce a repport with all IP's discoverd by NetXMS?

Regards,

Dan

Alex Kirhenshtein

#1
Hi.

You can get this list from DB using following query:
SELECT
    interfaces.ip_addr AS interfaces_ip_addr,
    interfaces.ip_netmask AS interfaces_ip_netmask,
    object_properties.name AS object_properties_name,
    interfaces.node_id AS interfaces_node_id
FROM
    object_properties
INNER JOIN
interfaces
ON
object_properties.object_id = interfaces.node_id
ORDER BY
interfaces_node_id, interfaces_ip_addr


I've also made a simple report for that, it's available in svn: http://svn.netxms.org/public/netxms/trunk/reports/IP%20Inventory.jrxml

To run it you need to setup your netxms server first:
1) download https://netxms.org/report-generator.jar and put it into server's DataDirectory (default values are c:\NetXMS\var on Windows and $prefix/share/netxms/ on UNIX)
2) add following parameters to netxmsd.conf:JavaPath=/usr/bin/java
JDBCDriver=org.postgresql.Driver
JDBCUrl=jdbc:postgresql://localhost/netxms


After that you could import report definition in management console by right click on "Reports" in the object browser and selecting "New Report"

DanG

#2
Hi Alex,

Thank you for the SQL query, it works fine.
I'm afraid the url to the Java report generator returns 404.
Another question, which JDBCDriver should I use for MsSql?

Regards,

Dan

Alex Kirhenshtein

My bad, it should be https://netxms.org/report-generator.jar (or you can build it from svn: https://svn.netxms.org/public/netxms/trunk/src/java/report-generator)

I don't have MSSQL available right not to test, but connection string should be like jdbc:microsoft:sqlserver://server_name:port/dbname. Port (including colon) is optional, default value is 1433.

Also set JDBCDriver to "com.microsoft.sqlserver.jdbc.SQLServerDriver".

DanG

Hi Alex,

I followed your steps and was able to import the report and open it.
Executing it was successful. when I then try to Render it to PDF I get the "Save File" dialog, but after clicking the Save button I receive the following error:
Cannot render report IP List job 1: Input/Output error

Any clue?

Regards,

Dan