Where there any changes to the nxshell ? Im using 2.2.16 and all my old scripts no longer work. I even tried most of the examples in the wiki and they no longer work either. This is the error i receive
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.python.core.PySystemState (file:/home/gmonk/Development/Python/Netxms%20Scripts/nxshell-2.2.16.jar) to method java.io.Console.encoding()
WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
node_id,interface_id,name,ip,mask
Traceback (most recent call last):
File "iftest.py", line 8, in <module>
allInterfaces = node.getAllChilds(objects.GenericObject.OBJECT_INTERFACE)
AttributeError: 'org.netxms.client.objects.Node' object has no attribute 'getAllChilds'
Check what Java version you are using. It could be that Jython is not compatible with newer versions.
Best regards,
Victor
I tried directly on the server which has version Java Version 1.8.0 and still nothing. However this scripts works just fine on both server and separate client.
import sys
from fnmatch import fnmatch
if len(sys.argv) > 1:
mask = sys.argv[1]
else:
mask = ".1.3.6.1.*"
nodes = filter(lambda x: isinstance(x, objects.Node), s.getAllObjects())
matched = filter(lambda x: fnmatch(x.getSnmpOID(), mask), nodes)
for node in matched:
print node.getObjectId(), node.getObjectName(), node.getPrimaryIP().getHostAddress()
any script with getAllChilds method does not work
something has definitely changed the older api shows getChilds() method the latests does not and I cant even find the documentation for my version 2.2.16
https://www.netxms.org/documentation/javadoc/versioned/Release-2.2.8/
Sorry, I was distracted by reflective access warnings and didn't notice actual method name. It was renamed to getAllChildren. We will upload javadocs for 2.2.17 and 3.0 in next few days.
Best regards,
Victor
Working now ... Thank you