NetXMS Support Forum

Development => General => Topic started by: pouya.moradian on October 14, 2015, 02:35:30 PM

Title: Node ID for Push parameter
Post by: pouya.moradian on October 14, 2015, 02:35:30 PM
Hi

As i see for pushing parameter to server node Id and DCI name is needed.
I'm using push parameter for pushing client side event as parameter,
So i need Node Id for each node in agent code, Is there any global variable or any variable to retrieve node id in java sub agent?

Is there any better approach to push event to server side for each client(node) ?

With Best Regards
Pouya
Title: Re: Node ID for Push parameter
Post by: Victor Kirhenshtein on October 16, 2015, 06:31:07 PM
Hi,

you may set node ID to 0, then server will find actual node by source IP address.

Best regards,
Victor
Title: Re: Node ID for Push parameter
Post by: pouya.moradian on October 17, 2015, 08:58:46 AM
Hi,

Thanks for your reply,
I got invalid object Id on using 0 as object id !

With best Regards
Pouya
Title: Re: Node ID for Push parameter
Post by: Victor Kirhenshtein on October 17, 2015, 07:40:56 PM
Hi,

can you show me code snippet how you push data?

Best regards,
Victor
Title: Re: Node ID for Push parameter
Post by: pouya.moradian on October 19, 2015, 01:30:12 PM
Hi,

I'm using Runtime.exec() in java in my agent but here is same story in command prompt.

Thank you.
Title: Re: Node ID for Push parameter
Post by: Victor Kirhenshtein on October 24, 2015, 08:10:39 PM
Hi,

I was thinking you are using Java or C++ API, not command line tool. For command line tool you just have to omit node ID - server will find it from connection's source IP address.

Best regards,
Victor
Title: Re: Node ID for Push parameter
Post by: pouya.moradian on October 25, 2015, 07:40:10 AM
Hi,

Thanks for your reply,
there is just some function like this in sample code :

@Override
   public ListParameter[] getListParameters()
   {
      return new ListParameter[] {
         new ListParameterAdapter("ListParameter1", "List Description") {
            @Override
            public String[] getValue(String value)
            {
               return new String[] { "1", "2" };
            }
         }
      };
   }

how can i use this for pushing parameter to server on an event ?

With best regards,
Pouya