News:

We really need your input in this questionnaire

Main Menu
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 - suphu

#16
General Support / nxshell-3.2.451 python version
April 22, 2020, 03:41:56 AM
from launched nxshell-3.2.451

print sys.version
2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43)

is there any plans to upgrade the embedded python to version 3.x?

thanks.
#17
Thanks.  I was able to set InstanceRetentionTime = 5 (days) to allow time to re-bind without loosing discovered dci instances.

In Server Configuration, I have tried changing AgentTunnels.UnboundTunnelTimeoutAction = "Bind tunnel to existing node" or "Bind tunnel to existing node or create new node", however neither of these settings seem to do anything. 

Could you explain how these should work?

Thanks.
#18
Hi,

Windows version 2.2.13.  Agent tunnels have been working now for just over 1 year.  Some nodes have alerts "Native agent is not responding" and have been changed to "unbound" in Agent Tunnel Manager.  I have found the problem to be the certificate created by tunnel has expired. 

Location of generated agent tunnel certificate = C:\Windows\System32\config\systemprofile\AppData\Local\nxagentd\certificates 

It appears when the agent is first "bound", this certificate is created with one year expiration.

Fixing the problem is a matter of "Bind to" existing node.  However, this resets some of the "Instance Discovery" DCI's, which I use a lot of. 

Is there a way to rebind without loosing dci data?
Can you change the default expiration of the generated tunnel certificate?
Other remedies?

Thanks.
#19
Hi,

Current version is 2.2.13 for Windows.  I am retrieving $node->alarms and wish to resolve alarm->ackBy and alarm->resolvedBy to fullName of user.  It appears the UserDBObject Class has this info, I just can't find how to get an instance.

Thanks.
#20
Hi,

Could anyone provide info of any enhancements to the WebSvc (HTTP/REST API) that will be in 3.x?
If no documentation, any source code links for WebSvc 3.x?

Thanks.
#21
I found my problem.  The C:\NetXMS\lib\nxshell.jar was out of date.  Replaced with nxshell-2.2.13.jar and it works.
#22
Version 2.2.13
C:\NetXMS\bin> .\nxshell.exe -u myUserName -P myPass ..\var\scripts\myscript.py
Traceback (most recent call last):
  File "..\var\scripts\myscript.py", line 256, in <module>
    objectTools = session.getObjectTools()
        at org.netxms.client.objecttools.ObjectTool.<init>(ObjectTool.java:96)
        at org.netxms.client.NXCSession.getObjectTools(NXCSession.java:7256)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/simpleframework/xml/Serializer
#23
Found the problem. 
I downloaded nxshell-2.2.8.jar and replaced C:\NetXMS\lib\nxshell.jar
Works Great!
Thanks.
#24
Thank You!  Very helpful.
#25
Thank you.  What link for 2.2.8 docs?
#26
From Windows 2016 Server where I have NetXMS installed.
C:\NetXMS\bin\nxshell.exe -u <myUserName> -P <myPassword>
#27
Hi, I am coding in python using nxshell version 2.2.8

Looking at some post about how to create new data collector items - this works!
https://www.netxms.org/forum/general-support/how-to-create-dci-using-netxms-java-api-version-2-1-m3/msg22320/#msg22320

However, the API Reference marks this method as Deprecated.  Going forward, what is/will be the proper API call(s) to create DCI's?
https://www.netxms.org/documentation/javadoc/latest
createItem(DataCollectionObject object)
Deprecated.

Thanks.
#28
Hi, I am coding in python using nxshell 2.2.8 and having problems retrieving Event Processing Policies

    epp = session.getEventProcessingPolicy()
        at java.util.Objects.requireNonNull(Objects.java:203)
        at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
        at java.util.Arrays.asList(Arrays.java:3800)
        at org.netxms.client.events.EventProcessingPolicyRule.<init>(EventProcessingPolicyRule.java:135)
        at org.netxms.client.NXCSession.getEventProcessingPolicyInternal(NXCSession.java:5897)
        at org.netxms.client.NXCSession.getEventProcessingPolicy(NXCSession.java:5912)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
java.lang.NullPointerException: java.lang.NullPointerException

    epp = session.openEventProcessingPolicy()
        at java.util.Objects.requireNonNull(Objects.java:203)
        at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
        at java.util.Arrays.asList(Arrays.java:3800)
        at org.netxms.client.events.EventProcessingPolicyRule.<init>(EventProcessingPolicyRule.java:135)
        at org.netxms.client.NXCSession.getEventProcessingPolicyInternal(NXCSession.java:5897)
        at org.netxms.client.NXCSession.openEventProcessingPolicy(NXCSession.java:5926)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
java.lang.NullPointerException: java.lang.NullPointerException
#29
Hi, I am coding in python using nxshell 2.2.8 and having problems retrieving ScriptLibrary (need rows from table script_library)

the below code retrieves script id and name, but source = None.
scripts = session.getScriptLibrary()
for script in scripts:
    pprint('id={0} name={1} source={2}'.format(
             script.getId()
            ,script.getName()
            ,script.getSource()
        )
    )

'id=1 name=Filter::SNMP source=None'
'id=2 name=Filter::Agent source=None'
'id=3 name=Filter::AgentOrSNMP source=None'
'id=4 name=DCI::SampleTransform source=None'
'id=11 name=Hook::StatusPoll source=None'
'id=12 name=Hook::ConfigurationPoll source=None'
'id=13 name=Hook::InstancePoll source=None'
'id=14 name=Hook::TopologyPoll source=None'
'id=15 name=Hook::CreateInterface source=None'
'id=16 name=Hook::AcceptNewNode source=None'
'id=17 name=Hook::DiscoveryPoll source=None'
'id=18 name=Hook::PostObjectCreate source=None'
'id=10000 name=testTraverse source=None'
#30
Hi, I am coding in python using nxshell 2.2.8 and having problems retrieving EventObjects (need rows from table event_cfg)

    session.syncEventObjects()
AttributeError: 'org.netxms.client.NXCSession' object has no attribute 'syncEventObjects'

    events = session.getEventObjects()
AttributeError: 'org.netxms.client.NXCSession' object has no attribute 'getEventObjects'

    events = session.getCachedEventObjects()
AttributeError: 'org.netxms.client.NXCSession' object has no attribute 'getCachedEventObjects'

    event = session.findEventObjectByCode(1)
AttributeError: 'org.netxms.client.NXCSession' object has no attribute 'findEventObjectByCode'