Hello Alex,
can you upload the examples once again?
The projekt files in sample_reports.tar.gz do not work. Thank you.
Kind regards,
Dennis
@alk said in Install report server:
Hello.
Reporting module is still sort of work-in-progress, it will be finalised and fully documented with the 2.0 release.
In a meantime, I'll write some notes here.
Part 1 – setup
-
Enable support in netxms core, then restart netxmsd: nxdbmgr set EnableReportingServer 1
-
Unpack netxms-reporting-server-2.0-M2.zip into some folder, in this example - /opt/nxreporting
-
Create directory "conf"
-
Create logger configuration: conf/logback.xml (sample attached), detailed description here: http://logback.qos.ch/manual/configuration.html#syntax
-
Create configuration file for reporting server: conf/nxreporting.xml
<config>
<workspace>/opt/nxreporting/workspace</workspace>
<netxmsdConfig>/opt/netxms/etc/netxmsd.conf</netxmsdConfig>
<datasources>
<datasource>
<id>secondary</id>
<type>postgresql</type>
<url>jdbc:postgresql://127.0.0.1/netxms</url>
<username>netxms</username>
<password>netxms</password>
</datasource>
</datasources>
<smtp>
<server>127.0.0.1</server>
<from>[email protected]</from>
</smtp>
<netxms>
<server>127.0.0.1</server>
<login>admin</login>
<password>netxms</password>
</netxms>
</config>
In most cases (when reports are using only single datasource), setting "netxmsdConfig" is enough, database type and credentials will loaded automatically from netxmsd.conf.
"netxms" section of the config is required for reports, which load data not from SQL datasource, but using NetXMS API instead (connection is maintained by reporting server).
-
Create workspace directory (as set by "workspace" parameter), it will contain both report definitions and intermediate report data (in "output" directory).
-
Put report definition jars into workspace/definitions/:
AirAlk:~() $ ls -al /opt/nxreporting/workspace/definitions/*.jar
-rw-r--r-- 1 alk wheel 3729 Mar 11 15:31 /opt/nxreporting/workspace/definitions/alarm-history-1.0.0.jar
-rw-r--r-- 1 alk wheel 5607 Mar 11 15:31 /opt/nxreporting/workspace/definitions/alarm-resolution-time-1.0.0.jar
-rw-r--r-- 1 alk wheel 4570 Mar 11 15:31 /opt/nxreporting/workspace/definitions/alarm-resolution-time-statistics-by-users-1.0.0.jar
-rw-r--r-- 1 alk wheel 4203 Mar 11 15:31 /opt/nxreporting/workspace/definitions/dci-1.0.0.jar
-rw-r--r-- 1 alk wheel 9968 Mar 11 15:31 /opt/nxreporting/workspace/definitions/epp-1.0.0.jar
…
- Start reporting server:
cd /opt/nxreporting
java -jar nxreporting-2.0-M2.jar
When started with "-jar" option, java will automatically find configuration files in conf/ and all libraries in lib/. However, you can run it differently (and omit "cd /opt/nxreporting"): java -cp /opt/nxreporting/lib/\*.jar:/opt/nxreporting/conf:/opt/nxreporting/nxreporting-2.0-M2.jar com.radensolutions.reporting.Launcher
or, if you are running windows: java -cp /opt/nxreporting/lib/\*.jar:/opt/nxreporting/conf:/opt/nxreporting/nxreporting-2.0-M2.jar com.radensolutions.reporting.Launcher
Resulting directory structure:
/opt/nxreporting:
total 5728
drwxr-xr-x 6 alk wheel 204 Apr 7 20:31 .
drwxr-xr-x 14 alk wheel 476 Apr 3 20:07 ..
drwxr-xr-x 4 alk wheel 136 Apr 7 20:31 conf
drwxr-xr-x 79 alk wheel 2686 Jan 23 10:29 lib
-rw-r--r-- 1 alk wheel 2929061 Jan 23 10:29 nxreporting-2.0-M2.jar
drwxr-xr-x 4 alk wheel 136 Mar 11 15:06 workspace
/opt/nxreporting/conf:
total 16
drwxr-xr-x 4 alk wheel 136 Apr 7 20:31 .
drwxr-xr-x 6 alk wheel 204 Apr 7 20:31 ..
-rw-r--r-- 1 alk wheel 1367 Apr 7 20:21 logback.xml
-rw-r--r-- 1 alk wheel 764 Apr 7 13:21 nxreporting.xml
/opt/nxreporting/lib:
total 109528
…
/opt/nxreporting/workspace:
total 0
drwxr-xr-x 4 alk wheel 136 Mar 11 15:06 .
drwxr-xr-x 6 alk wheel 204 Apr 7 20:31 ..
drwxr-xr-x 32 alk wheel 1088 Mar 11 15:43 definitions
drwxr-xr-x 8 alk wheel 272 Mar 11 15:42 output
/opt/nxreporting/workspace/definitions:
total 248
drwxr-xr-x 32 alk wheel 1088 Mar 11 15:43 .
drwxr-xr-x 4 alk wheel 136 Mar 11 15:06 ..
-rw-r--r-- 1 alk wheel 3729 Mar 11 15:31 alarm-history-1.0.0.jar
-rw-r--r-- 1 alk wheel 5607 Mar 11 15:31 alarm-resolution-time-1.0.0.jar
-rw-r--r-- 1 alk wheel 4570 Mar 11 15:31 alarm-resolution-time-statistics-by-users-1.0.0.jar
…
/opt/nxreporting/workspace/output:
total 0
drwxr-xr-x 8 alk wheel 272 Mar 11 15:42 .
drwxr-xr-x 4 alk wheel 136 Mar 11 15:06 ..
drwxr-xr-x 4 alk wheel 136 Mar 11 15:44 01827cdb-cb23-4b06-b607-fd02c4279add
drwxr-xr-x 4 alk wheel 136 Mar 7 22:04 52ce4398-a131-4a79-887e-672cc73d5d34
drwxr-xr-x 3 alk wheel 102 Mar 11 15:44 8a7c025c-84c8-4914-b2bf-3b4cde27a224
…
You can download complete sample setup here (including two reports): https://www.dropbox.com/s/pcqtfqhnwnrseb9/nxreporting.tar.bz2?dl=0