Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - rostyslav

#1
General Support / NetXMS cluster configuration
February 14, 2013, 05:47:53 PM
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.
#2
General Support / Reports... again
January 17, 2013, 04:57:01 PM
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

2. 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

3. Edit pom.xml to remove unnecessary dependencies:
cd ./svn.netxms.org/public/netxms/trunk/src/java/report-generator/
nano pom.xml

4. 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/

5. 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"
6. 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"
7. 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
#3
General Support / Reports
December 25, 2012, 12:11:25 PM
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%20Inventory.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.
#4
General Support / DCI Error issue
December 12, 2012, 11:14:45 AM
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;
}
#5
General Support / DCI Aggregation
December 07, 2012, 11:20:44 AM
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.
#6
General Support / Threshold issue
December 05, 2012, 11:46:30 AM
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!
#7
General Support / FileSystem.* and LVM
November 29, 2012, 12:31:43 PM
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
#8
Добрый день.

Столкнулся с такой проблемой после переноса IP адреса на соседний порт на сервере на котором крутится NetXMS он начал падать с Ошибкой сегментирования. Последние сообщения дебага выглядят так:
Quote[22-Jun-2011 13:16:36] Node::deleteInterface(node=Server_Watcher [15197], interface=eth1 [21162])
[22-Jun-2011 13:16:36] EVENT 16 (F:0x0001 S:0) FROM Server_Watcher: Interface "eth1" deleted (IP Addr: 10.1.0.1/255.255.255.0, IfIndex: 3)
Ошибка сегментирования

NetXMS 1.0.11, ОС: Ubuntu 10.04.2

Подскажите, пожалуйста, как можно решить эту проблему не перенося обратно IP адрес, так как предыдущий порт на сервере битый.
#9
Здравствуйте,
В Event Processing Policy Editor в строке Source можно указывать контейнеры или устройства и хорошо было бы, если бы можно было также указать устройства которые не должны обрабатываться при создании Policy. Как в access-list'ах: выбираю использовать в качестве Source такой-то контейнер (permit), но исключаю из этого контейнера несколько устройств (deny). Либо если есть устройства пересекающиеся в разных контейнерах, тогда ставлю deny на один контейнер и permit на другой.
На мой взгляд это добавило бы гибкости.
#10
Здравствуйте.
У меня возник вопрос по картам. Есть контейнер к нему привязана карта, в контейнере какое-то количество устройств для которых нарисована схема (объекты соединены линками, линки подписаны). Все работает отлично до того момента, когда мне в контейнер надо добавить устройство. При добавлении устройства на карте оно не отображается и увидеть его можно только включив "Enable automatic layout" или сделав "Redo layout" при этом естественно порушив всю нарисованную схему.
Можно ли сделать так, чтобы при добавлении ноды в контейнер, новое устройство добавлялось на карту, например в левом верхнем углу?