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

Messages - Filipp Sudanov

#1576
There's a couple of minor things that are causing issues here. NetworkMapLink expects IDs within map, not netxms object IDs, so there's a function to convert. And we need to explicitly specify that IDs of status-providing nodes are of type "Long". Here's an example of working script:

from java.util import ArrayList
from java.lang import Long

amap = s.findObjectById(2722)
mapPage = amap.createMapPage()

cd = NetworkMapLink(NetworkMapLink.NORMAL, mapPage.findObjectElement(672).id, mapPage.findObjectElement(674).id)

sList = ArrayList()
sList.add(Long(674))
sList.add(Long(672))

cd.setStatusObjects(sList)

cd.setRouting(NetworkMapLink.ROUTING_DIRECT)
cd.setColorSource(LinkConfig.COLOR_SOURCE_OBJECT_STATUS)

mapPage.addLink(cd)

data = NXCObjectModificationData(2722)
data.setMapContent(mapPage.getElements(), mapPage.getLinks())
s.modifyObject(data)

#1577
I forgot to mention, that you should wait for netxms to hang first and then launch the script. So can you please wait for it to hang on it's own and then run the script.
#1578
Ok, let's try to get some debug information with this script: https://github.com/netxms/netxms/blob/master/tools/capture_netxmsd_threads.sh

In order for this to work you should have gdb and all relevant netxms-*-dbg packages installed. Is netxms installed from packages?

Script will produce output file in /tmp. Please attach it here.
#1579
If you check running processes on netxms server, is netxmsd present in the list of processes on the moment it hangs? I mean, does it actually creash and terminate, or it hangs?
#1580
General Support / Re: Netxms 3.1.261 and device discovery
December 26, 2019, 02:43:01 PM
Here's an example of such script, that will change community string for all nodes, that have SNMP polling enabled
newAuthName = 'public2'
for node in [o for o in session.getAllObjects() if isinstance(o, objects.Node)]: # filter all objects for objects.Node
    if (node.getFlags() & Node.NF_DISABLE_SNMP) = 0: # SNMP polling is not disabled
        if (node.getSnmpAuthName() != newAuthName):
            print('Processing node %s: changing community string from %s to %s' % (node.objectName, node.getSnmpAuthName(), newAuthName))
            md = NXCObjectModificationData(node.objectId)
            md.setSnmpAuthName(newAuthName)
            session.modifyObject(md)


The script is launched like this:
java -jar nxshell-3.1.241.jar script_name.py


There are some examples of Jython scripts in netxms sources in src/client/nxshell/samples/
Some examples are also here: https://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations
Documentation of API calls is here: https://www.netxms.org/documentation/javadoc/latest/overview-summary.html

#1581
3.1 packags for raspbian buster have been released. Installation by installing https://packages.netxms.org/netxms-release-latest.deb in not working yet, so it's necessary to manually add
deb http://packages.netxms.org/raspbian/ buster main
into sources.list
#1583
Hi!

Let me describe the whole configuration process for DS18x20 sensors on RPi in case if someone needs this later.
1) A pull-up resistor of 2..10KOhm should be connected between DQ pin of the sensor and +3.3v. GPIO2 and GPIO3 have built-in 1.8KOhm pull-up resistors (at least on RPi 3), so if you don't need I2C, you can connect the sensor to one of these pins.
2) A kernel module is used to communicate with the sensor. It is activated ty adding dtoverlay=w1-gpio to the end of /boot/config.txt file.
By default the DQ pin of the sensor should be connected to GPIO4, to use another GPIO the following format could be used: dtoverlay=w1-gpio,gpiopin=3. Reboot RPi when finished editing the file.
Since kernel version 4.9.28 it's also possible to use dynamic overlay loading: sudo dtoverlay w1-gpio gpiopin=5, in this way it's possible to have sensors on several GPIO pins.
3) After restart (of after dynamic overlay loading) the sensors should get detected:
root@raspberrypi:~# ls  /sys/bus/w1/devices/
28-6cb0611f64ff  w1_bus_master1

here we have one sensor connected, it has name 28-6cb0611f64ff
4) And we should be able to read the temperature:
root@raspberrypi:~# cat /sys/bus/w1/devices/28-6cb0611f64ff/w1_slave
78 01 55 00 7f ff 0c 10 57 : crc=57 YES
78 01 55 00 7f ff 0c 10 57 t=23500

which in this case is 23,5 degrees C.
5) To configure NetXMS agent we add the following lines to /etc/nxagentd.conf
SubAgent=ds18x20.nsm

[DS18X20]
Sensor = Test:28-6cb0611f64ff

6) After agent restart systemctl restart nxagentd our parameter "Test" should return the temperature.
user@netxms-server:~$ nxget raspberrypi.lan 'Sensor.Temperature(Test)'
23.312



Your configuration looks exactly the same. The thing is that the error message in agent log "Unable to add sensor from configuration file. Original configuration record:" looks to be a bug, i am also getting it (as of v. 3.1.274). But the parameter works. Most probably on your system Sensor.Temperature(Test) will also give the result.
#1584
General Support / Re: how to enable capabilities
December 23, 2019, 07:27:19 PM
Which capabilities do you expect to be in "Yes" state? In may cases it's just enough to have isAgent Yes. Netxms agent provides a lot of monitoring options.
#1585
General Support / Re: how to enable capabilities
December 22, 2019, 12:21:32 PM
isSNMP will get enabled on full configuration poll, it your node supports SNMP. All the rest flags are similar and auto-detected, e.g. isPrinter gets enabled, if NetXMS detects, that the node is a printer and so on. It's not possible to change these flags manually.
#1586
Current approach to templates in NetXMS has the idea, that all nodes, belonging to one template are absolutely the same.

You could create a separate template for your exclusion cases and set up template autoapply scripts that would set correct template for a particular node.

The other way could be to use the following syntax in threshold field %{custom_attribute_name:100} in template. In this case threshold value will be taken from a custom attribute, specified on a node and if such attribute is not present on a node, a default value of 100 will be used.
#1587
General Support / Re: how to enable capabilities
December 22, 2019, 02:20:30 AM
Capabilities get updated when Full Configuration Poll is performed. If node responds to attempt to connect to netxms agent, isAgent capability will be set to Yes and so on.
#1588
Try to undeploy and deploy the war. Also try to clean /var/cache/tomcat/work/Catalina/localhost folder.

The most recent mac console will be released in the next few days, currently you can use previous one, the differences are minor: https://netxms.org/download/releases/3.1/nxmc-3.1.241.war
#1589
Имеется в виду SNMP community string? В каком имено месте - в свойствах ноды или в Configuration -> SNMP credentials?

Какая точно версия сервера? Какая база данных, ее версия? Какая консоль, под какой ОС?
#1590
I've tried on my system with Postgres 10 and NetXMS 3.1.261 on Ubuntu 18.04 - the reconnect actually occurs. Can you increase debugging for DB operations, e.g. by running this from command line:
nxadm -c "debug db.* 8"
and show the log during the moment when database stops/restarts.