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

#1456
Occurs in Firefox also. Created https://track.radensolutions.com/issue/NX-1765 issue for that.
#1457
Hi!

Can we get some more details on how exactly it's not working? Can you may be try to call a command file, that logs parameters that it's receiving and show what is in netxms agent's log and what that command file gets?
#1458
General Support / Re: cant get powershell script to run
January 14, 2020, 05:30:22 PM
Yes, right, it's not the timeout, otherwise there would be a message on 4-th debug level:
command "powershell.exe C:\test3.ps1" execution timeout (70 seconds)

Can you increase debug level to 7 and attach the log.

#1459
General Support / Re: cant get powershell script to run
January 13, 2020, 07:23:43 PM
There is agent configuration parameter ExternalParameterProviderTimeout that sets timeout for external parameters provider execution. By default it's equial to 30 seconds. The behavior you describing might be happening if your script runs longer then 30s.
#1460
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)

#1461
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.
#1462
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.
#1463
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?
#1464
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

#1465
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
#1467
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.
#1468
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.
#1469
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.
#1470
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.