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

R

rostyslav

@rostyslav
Unfollow Follow
About
Posts
25
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reports... again
    R rostyslav
    Support

    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


  • Agent upgrade from 1.2.10 to 1.2.12
    R rostyslav
    Support
    cat /proc/drbd
    version: 8.3.11 (api:88/proto:86-96)
    srcversion: 93CE421BB73A731BDC72D8E
     0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
        ns:926633166 nr:24520 dw:926662000 dr:2020550685 al:1982608 bm:108 lo:32 pe:0 ua:0 ap:32 ep:1 wo:f oos:0
    

  • Agent upgrade from 1.2.10 to 1.2.12
    R rostyslav
    Support

    The gdb output is attached.


    gdb_output.txt


  • Agent upgrade from 1.2.10 to 1.2.12
    R rostyslav
    Support

    I don't know if this is the same issue, but nxagentd still doesn't start after upgrade. nxagent -D9 in the attachment. My system is Ubuntu 12.04.


    debug.log


  • Agent upgrade from 1.2.10 to 1.2.12
    R rostyslav
    Support

    Same problem here. OS: Ubuntu 12.04


  • NetXMS cluster configuration
    R rostyslav
    Support

    Just wanted to share how to configure a NetXMS cluster (on Ubuntu in my case).
    I've used DRBD + Corosync + Pacemaker to do this, the underlying database is PostgreSQL, although it is not much different for any other database.
    I won't describe how to configure DRBD and Corosync here, there are a lot of materials in the Web about this. I used this http://wiki.postgresql.org/images/0/07/Ha_postgres.pdf, it is very thorough. Only change that I did, is that I restarted corosync on both nodes after configuration.

    So assume you configured DRBD and have NetXMS installed. First you need to get netxms LSB-compatible init script. Good that it is already exist in the .deb packages on the site. We just need to make some changes in it (I attached the script to the post).

    1. Add -e to the DAEMON_ARGS parameter like this DAEMON_ARGS="-d -e -D 5". -e option will automatically unlock the database locked by previous primary server.
    2. Change path to the netxmsd in the DAEMON=/usr/local/bin/$NAME
      Now that init script is ready place it in the /etc/init.d/ . Don't forget to make it executable (chmod +x /etc/init.d/netxmsd)

    With that done we can create a crm primitive for netxms:

    crm configure primitive netxmsd_lsb lsb:netxmsd \
            op monitor interval="30" timeout="60" \
            op start interval="0" timeout="60" \
            op stop interval="0" timeout="60" \
            meta target-role="Started"
    

    This primitive needs to be added to our crm group. That is easy.

    user@cluster#crm
    crm(live)# cib new fixgroup
    crm(live)# configure delete PGServer
    crm(live)# configure group PGServer pg_lvm pg_fs pg_lsb pg_vip netxmsd_lsb
    crm(live)# cib commit fixgroup
    crm(live)# quit
    

    And that's all. You have working NetXMS cluster now.


    netxmsd


  • Reports... again
    R rostyslav
    Support

    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


  • Reports
    R rostyslav
    Support

    Because the scheduling is not working I've came up with this solution.

    Generate report from console:

    "/usr/bin/java" -cp "/opt/netxms/java-lib/report-generator.jar" org.netxms.report.Generator "/etc/netxmsd.conf" "/opt/OpenVPN-report.def" "/opt/reports/`date +%d%m%Y`-openvpn-count.output"
    

    /opt/OpenVPN-report.def is our jasper report .jrxml file.

    Convert this report to PDF format:

    "/usr/bin/java" -cp "/opt/netxms/java-lib/report-generator.jar" org.netxms.report.Exporter "/opt/reports/`date +%d%m%Y`-openvpn-count.output" "/opt/reports/`date +%d%m%Y`-openvpn-count.pdf"
    

    And send this report via email:

    sendemail -f "[email protected]" -t "[email protected]" -m "Subject: OpenVPN report `date +%d-%b-%Y`" -u "Header: Report `date +%d-%b-%Y`" -a "/opt/reports/`date +%d%m%Y`-openvpn-count.pdf"
    

    Add all of this to the cron, and we have custom reports scheduling.

    All that left is to wait when these features will be available from GUI.

    Edited: Attached short instruction with all necessary steps.

    Best regards,
    Rostyslav


    Reports.pdf


  • Reports
    R rostyslav
    Support

    I've got this working... kind of.
    Created new custom report with http://jasperforge.org/projects/ireport software.

    Had some trouble with figuring out how to create a query. Here is what I end with:

    SELECT
    	object_properties.name AS nas_name,
    	items.name AS parameter,
    	raw_dci_values.transformed_value AS value
    FROM
    	object_properties
    INNER JOIN
    	items
    ON
    	object_properties.object_id = items.node_id AND items.name = 'OpenVPN.Users'
    INNER JOIN
    	raw_dci_values
    ON
    	items.item_id = raw_dci_values.item_id AND raw_dci_values.transformed_value ~ '^[0-9]+'
    ORDER BY
    	value
    

    object_properties table stores node names, items stores data collection items and raw_dci_values stores actual data.
    I've had to slightly change this query to create a pie chart similar to those on dashboards.

    I attached my reports for those who might need it.

    Now I'm having troubles with scheduling reports. Clicking on "Schedule report execution" do nothing.

    Also is there an option on sending reports via email?

    Best regards,
    Rostyslav


    VPN-text.jrxml

    VPN-piechart.jrxml


  • Reports
    R rostyslav
    Support

    Alex, thank you for the prebuild package and instruction on how to build it myself.
    I've replaced report-generator.jar file with https://www.netxms.org/tmp/report-generator.jar , restarted netxms server and reports are generating.

    Lucas, I haven't seen this exception on my ubuntu server.

    I will try to generate my own, not prebuild reports, and will post results here.

    Best regards,
    Rostyslav


  • Reports
    R rostyslav
    Support

    I am trying to generate some reports and have some troubles.

    I downloaded report from https://svn.netxms.org/public/netxms/tags/version-1.2.4/reports/IP Inventory.jrxml and imported it to the NetXMS server.
    Then compiled report-generator.jar

    apt-get install fastjar
    wget -r --no-parent https://svn.netxms.org/public/netxms/trunk/src/java/report-generator/
    jar cvf report-generator.jar report-generator/
    cp report-generator.jar /opt/netxms/java-lib/
    

    Then added this code to the netxmsd.conf

    JavaPath=/usr/bin/java
    JavaLibraryDirectory=/opt/netxms/java-lib
    JDBCDriver=org.postgresql.Driver
    JDBCUrl=jdbc:postgresql://localhost/netxms
    

    But reports not generating.
    Thanks for any help.


  • DCI Error issue
    R rostyslav
    Support

    There is no history.


  • DCI Error issue
    R rostyslav
    Support

    Hello,

    I'm trying to implement service that downloads file from my servers and gives me time of download. I am doing this via ExternalParameter.
    Of course if download time is bigger then ExecTimeout in agent config I get an << ERROR >>. I want to change this error value to integer.
    For example, if my download time is greater then 45 seconds, then return 60. I've tried to add the following transformation script, but it doesn't work.
    Will be grateful for any help.

    sub main ()
    {
      if ($1 < 46)
        return $1;
      else
        return 60;
    }
    

  • DCI Aggregation
    R rostyslav
    Support

    Hello.

    Can I somehow aggregate DCI values? I have created DCI's for OpenVPN users count on several servers, and now I would like to see the total users count.
    I read wiki and saw there a script "Aggregation of DCI values and applying the 95% percentile average". I've written similar script for OpenVPN users count, saved it in Script Library, but I don't know where and how to apply it.


  • Threshold issue
    R rostyslav
    Support

    Thank you. It worked.


  • Threshold issue
    R rostyslav
    Support

    Hello!

    I have configured CPU temperature monitoring with ExternalParameter = CPU.Temperature(*):/usr/bin/sensors|egrep 'Core\s*$1' | cut -d+ -f2 | cut -d. -f1
    It gives me the integer part of the core temperature. I've added return int32($1) to the transformation
    I can build graphs based on this values, but when I try to generate alarm based on threshold "> : greater then" it is not working.
    I suppose, despite the transformation, it processes the value as string, because "like/not like" thresholds seems to be working.
    What can be done about this issue?

    Any help appreciated!


  • FileSystem.* and LVM
    R rostyslav
    Support

    Thank you. It worked like a charm.


  • FileSystem.* and LVM
    R rostyslav
    Support

    I have a trouble with configuring DCI with FileSystem.Total/Free/etc and LVM on my Ubuntu 12.04 server.
    In case of simple physical disk I would use /dev/sda, but what should I use with LVM?
    I've tried FileSystem.Free(/dev/SysVolGroup/root) but that's doesn't seem to be working.

    NetXMS server and agent versions are 1.2.4


  • Ошибка Сегметирования
    R rostyslav
    Support (Russian)

    Спасибо большое, обновление до 1.0.12-rc решило проблему.


  • Ошибка Сегметирования
    R rostyslav
    Support (Russian)

    Вот вывод:

    (gdb) bt
    #0  Node::deleteInterface (this=0x93f93f0, pInterface=0x9514248) at node.cpp:927
    #1  0xb7ee44bb in Node::updateInterfaceConfiguration (this=0x93f93f0, dwRqId=0, dwNetMask=0) at node.cpp:1787
    #2  0xb7ee5927 in Node::configurationPoll (this=0x93f93f0, pSession=0x0, dwRqId=0, nPoller=14, dwNetMask=0)
        at node.cpp:1647
    #3  0xb7ef3002 in ConfigurationPoller (arg=0xe) at poll.cpp:307
    #4  0xb7ce096e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #5  0xb7b12a4e in clone () from /lib/tls/i686/cmov/libc.so.6

  • 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