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

Topics - Mongi

#1
General Support / DCI modification using protocol
October 11, 2010, 09:28:26 PM
Hello.

I'm writing my own client to connect and operate with NetXMS using it's protocol. It was quite successful until I faced creation of DCI's.

The problem is that to create DCI of an object, you need to create DCI(you get just new ID) and then modify it's content. When I tried to modify it, I've go error RCC_OUT_OF_STATE_REQUEST. According to session.cpp and ClientSession::ModifyNodeDCI I need to lock the object DCI list somehow. Some hard search resulted the only command able to lock this DCI list of object is CMD_GET_NODE_DCI_LIST(and CMD_UNLOCK_NODE_DCI_LIST to unlock). But it has two disadvantages:
1) It gives you all of DCI within selected object
2) This list of DCI doesn't finish with any "LIST_END" command, like object list is closed by CMD_OBJECT_LIST_END. So, we have to wait for a timeout in order to figure out that server finished list sending. (Moreover, there is command CMD_NODE_DCI_LIST_END in protocol reference but it's totally missing in source code :-\ )

So, is there more straightforward way to create/modify new DCI without waiting for full DCI list (or without this list at all)?

If it's the only way for now, could you please implement some possibility in protocol to simply lock and unlock object DCI list for current session?
#2
We are planning to use NetXMS with our custom push-type counters. All numeric counters seem to work well, but string one has some problems.

First of all, they are limited to 255 chars (according to database configuration). Moreover, they can cause server to crush due to lack of string NULL-terminator.

Way to reproduce:
1) Create DCI, Parameter:Test, Type: string; Origin: Push Agent
2) Excute:
QuoteC:\NetXMS\bin>nxpush.exe -H localhost -u user -P pass host.local:Test=123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789
(it is string with 300+ symbols)
3) Open "Last values" -- here you will see probably all of string
4) Open "Show history" -- here are 2 possibilities:
   a) server crush and you wont see anything
   b) you are lucky to see first 127 symbols and a bunch of garbage from server memory till first NULL-symbol

Server 1.0.4, Windows; DB: MSSQL

In spite of server crush, Is there a way work with strings longer than 127 symbols?