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 - Victor Kirhenshtein

#6661
General / Re: problem with development
November 25, 2009, 12:24:06 PM
Yes, it could be encrypted, and in that case you should provide correct encryption context. However, if you are not using encryption, you can simple pass NULL.

Best regards,
Victor
#6662
General / Re: problem with development
November 24, 2009, 10:28:16 PM
CSCP is an old name for NXCP, and it's partially replaces in the code. In latest versions, there are no RecvCSCPMessage() function, only RecvNXCPMessage() - but it's the same function anyway.

Best regards,
Victor
#6663
Общие вопросы / Re: Огромная БД
November 24, 2009, 11:29:30 AM
Явно выраженного перекоса в сторону одной из таблиц нет. Можно почистить event log, но это всего лишь 34MB, не думаю что это решит проблему. Попробуйте включить slow query log в MySQL (http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html) - попробуем посмотреть, какие именно запросы тормозят, и будем их оптимизировать.
#6664
General / Re: problem with development
November 24, 2009, 11:24:10 AM
Hi!

You should create CSCPMessage object from CSCP_MESSAGE structure filled by RecvNXCPMessage function. After that, you can access to variables inside message via GetVariableXxx methods of class CSCPMessage. If you getting parameter's value from agent, you should be interested in variables VID_RCC - DWORD holding response code, and VID_VALUE - received value as string.

Best regards,
Victor
#6665
Hi!

No, it's not possible. We are planning to add this feature in future versions.

Best regards,
Victor
#6666
Currently it is not possible. Most likely such feature will be added in one of the next versions.

Best regards,
Victor
#6667
General Support / Re: Individual Service Monitorning
November 23, 2009, 12:47:55 PM
Hello!

You can monitor status of Windows services via agent's parameter System.ServiceState. It should be used as

System.ServiceState(service name)

You can also found discussion about it here: https://www.netxms.org/forum/index.php/topic,166.0.html

Best regards,
Victor
#6668
General / Re: problem with development
November 19, 2009, 09:46:33 AM
This define is required for porting code to Windows. On Windows, if you want to export function or class from DLL, you should add __declspec(dllexport) to it's declaration. So, on Windows we define LIBNETXMS_EXPORTABLE as __declspec(dllexport) when building DLL, and on other platforms it simply defines to nothing. So, if you are not writing your code for Windows or not writing a Windows DLL you can simply remove this or define to nothing.

Best regards,
Victor
#6669
General / Re: problem with development
November 18, 2009, 10:56:56 AM
Hello!

I see the following errors:

1. when you sending message to the agent, you give the wrong message size - instead of


send(socketId,&pRawMsg,sizeof(msg),0)


you should use


send(socketId,&pRawMsg,ntohl(pRawMsg->dwSize),0);


2. You use very small receive buffer - sizeof(CSCP_MESSAGE) will be something like 24 to 32 bytes, but incoming message could be much larger. You should use at least 1024 bytes buffer for receiving messages with single parameter's value and much larger if you wish to get lists from agent. We typically use buffers of 256KB. Other option is to receive message header first, check message size, and allocate buffer for received message dynamically.

3. Protocol messages use binary representation of data, so debugging with printf("%s") will not help much. You should print individual fields.

4. For header - there are many errors on different levels. I suggest you to use same declarations as in nms_cscp.h, especially for CSCP_MESSAGE and CSCP_DF structures, because they represents actual data positions in transmission stream. Don't forget to use #pragma pack or you will get incorrect results on some platforms or compilers.


And why you not using already written communication code in libnetxms and libnxsrv? libnxsrv contains ready to use C++ API for communicating with agents, which handles all communication and protocol things and gives you high level API.

Best regards,
Victor

#6670
General Support / Re: Centralized agent upgrade feature
November 18, 2009, 10:37:45 AM
Quite strange - from configure output looks like it was unable to find dlopen. Could you please provide config.log and detailed information about operating system?

Best regards,
Victor
#6671
Общие вопросы / Re: Статус aknowledge
November 17, 2009, 05:18:07 PM
Togda bol'she pohoze na bug. A esli acknowledge ne delat', to terminate srabativaet, ili toze net?
#6672
General Support / Re: DCI ServiceCheck Parameters
November 17, 2009, 05:17:18 PM
All ServiceCheck.xxx parameters has the same response codes:

0 - success (server was connected and return expected response)
1 - invalid arguments was passed
2 - cannot connect to server
3 - bad server's response

Best regards,
Victor
#6673
General Support / Re: Centralized agent upgrade feature
November 17, 2009, 05:15:35 PM
Quote from: CTXM on November 17, 2009, 04:24:02 PM
As I understand, update procedure sends sourceball, then configures and automakes it on the host. installs it in the same directory where current netxms operates.

Yes, exactly.

Quote from: CTXM on November 17, 2009, 04:24:02 PM
It would be nice to tune/control more this process, because
1. many of admin crews organizes directory structure and compiled soft differently in their environments.
2. configure, make logs could be retreived from server in the same way as nxagent.conf file does

Real example:
We store every compiled soft in form of: /opt/$software_brand-$version
Then we create softlink in form of: /opt/$software_brand-$version <- /opt/$software_brand
So, it just need to be done "ls /opt/" on a server to know main applications or software installed manually.

In case netxms-agent update proceeds remotely, form of $software_brand-$version becomes misleading.

It doesn`t scares us much, but it makes a little hole in our logic. So - it possibly can unsatisfy other teams with larger or more specific or more beurocratic IT organisations.
Even more: in case of tests there could be specially different agent versions keeped. And not only on one single server. I do so, for example.
I have even quickfixed init script to understand version of agent I want to start via second variable passed (/etc/init./netxms start 0.2.26):
...
[ -z "$2" ] || netxmsExec="/opt/netxms-$netxmsVer/bin/nxagentd -c /opt/netxms$netxmsVer/etc/nxagentd.conf -d"
[ -n "$2" ] || netxmsExec="/opt/netxms/bin/nxagentd -c /opt/netxms/etc/nxagentd.conf -d"
...

That`s why I suggest to invent more control in auto-deployment.

There is no difficulty to implement unified control for many different store conventions we can emagine.
Autodeploy destination directory need to be configurable, possibility to retrieve logs, older ver move configurable (some kind of automatic logical or manual suffix addon). Softlink of new location to old location could be created for linux systems because of init scripts.


Yes, there are some room for improvement :) Thank you for interesting suggestions, I'll take them into consideration.

Best regards,
Victor
#6674
General Support / Re: Centralized agent upgrade feature
November 17, 2009, 05:11:08 PM
Quote from: CTXM on November 17, 2009, 04:17:31 PM
Small addon to instruction:
InstallationServers instruction need to be set in nxagent.conf to be able to deploy package onto agent`s OS using centralised deployment

But in case when there was no InstallationServers instruction provided, I wasn`t able even to EDIT agent`s configuration file from NetXMS server. So, I did this via standart ssh session Is it normal behavior?

Only after I have added meaned parameter pointed the same as MasterServers (is MasterServers same instruction as Servers, or there is some difference?) I was able to edit agent`s configuration

Yes, I forgot to mention that. Agent will accept upgrade packages only from server(s) listed under MasterServers parameter. And InstallationServers is a deprecated synonim for MasterServers.

Agent has three access levels for servers. To gain specific access level, server should be listed under one of thee parameters: Servers, ControlServers, or MasterServers.

Servers - gives read-only access (can get parameters)
ControlServers - read parameters and execute preconfigured actions
MasterServers - full control

Unless your setup has specific security needs, it is recommended to list your NetXMS server under MasterServers.

Best regards,
Victor
#6675
Общие вопросы / Re: Статус aknowledge
November 17, 2009, 01:14:19 PM
Nuzno v pravile, kotoroe sozdaet alarm iz sobitija SYS_IF_DOWN, dobavit' alarm key, skazem IF_DOWN_%i_%1, i dobavit' pravilo na sobitie SYS_IF_UP, gde v pole "alarm" vistavit' "terminate alarm with key" i kak key ukazat' IF_DOWN_%i_%1.

Best regards,
Victor