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

#6481
General Support / Re: Action to return value
March 10, 2010, 09:53:45 AM
Hi!

In NXSL, you can use any integer value as boolean, where 0 means false and any-non-zero value means true. So, you can use errorCount attribute as boolean flag if you wish, like below:

if (dci->errorCount)
{
    // Processing if error
}
else
{
   // Processing if OK
}

You can also apply boolean logic operations to integer values, for example:

if (!dci->errorCount)
{
   // Processing if there are no errors
}


Best regards,
Victor
#6482
General Support / Re: NXML Script
March 09, 2010, 10:52:09 PM
Hi!

I'll post updated NetXMS User Manual in a few days - it will have chapter about NXSL programming.

Best regards,
Victor
#6483
A kak vigljadit parametr Disk.Total i chto propisano v pole "instance" dlja parametra so skriptom? Problema pohoze v tom, chto formiruetsja nepravil'noe imja parametra, i FindDCIByName vozvraschaet NULL.
#6484
Announcements / NetXMS 1.0.0-rc2 released
March 08, 2010, 01:53:36 PM
Hi all!

Vesrion 1.0.0-rc2 is out. It fixes some build problems found in rc1, and adds possibility to search objects by comments in Windows console.

Best regards,
Victor
#6485
Ja ispravil odin bag v configure i perepakoval 1.0.0-rc2 (https://www.netxms.org/download/netxms-1.0.0-rc2.tar.gz) - poprobujte novij variant.
#6486
Hi!

Yes, you can call library script from another library script in a same way.

I'll check script saving in MS SQL a bit later.

Best regards,
Victor
#6487
Hello!

It's very strange - there are no size limitation on scripts. What database you are using?

To call one script from another, called script must be in script library, and contain function(s) other than main(). Then in calling script you should add use statement, for example:

script in library, called my_script:


sub my_function()
{
   return "some value";
}


script in event processing policy:


use my_script;

sub main()
{
   value = my_function();
   // some further processing
}


Best regards,
Victor
#6488
Please try 1.0.0-rc2 (https://www.netxms.org/download/netxms-1.0.0-rc2.tar.gz) - this problem should be fixed.

Best regards,
Victor
#6489
General Support / Re: Action to return value
March 05, 2010, 05:10:49 PM
It will require changes in very important part of code, and in turn will require additional tests - and I wouldn't want to do this until 1.0.0 release. However, I have added new attribute to DCI object - errorCount - which you can use to check from NXSL if given DCI had data collection error. This attribute will be 0 if last poll was completed succesfully, or > 0 if there was an error (will hold number of consecutive data collection errors).

Best regards,
Victor
#6490
General Support / Re: NXSL scripting
March 05, 2010, 12:55:30 PM
Hi!

It is backslash, so

println "\"";

for example will print single quotation mark character. Maybe there are other error in your script?

Best regards,
Victor
#6491
General Support / Re: skip modem from monitoring
March 03, 2010, 11:55:46 AM
Quote from: iwi on March 03, 2010, 11:43:02 AM
I thought I read the manual, but I only see %1-%99 events parameter numbers 1..99, but how can I determin what which number does? Is this the ID from Event Editor?

Numbered parameters are event-dependent, you can open Control Panel -> Events, open event of interest, and look at the description - for all predefined events there are list of parameters.

Best regards,
Victor
#6492
Добрый день!

Это баг в nxdbmgr. Он исправлен в 1.0.0-rc1 - попробуйте использовать nxdbmgr из новой версии.

Виктор
#6493
Problem with MySQL is already known, and I'll fix it in rc2. In the meantime, you could try to prefix ./configure with LDFLAGS=-lmysqlclient, like this:

LDFLAGS=-lmysqlclient ./configure --with-server --with-mysql

Nobody reports PostgreSQL problem so far. Could you please post config.log from failed PostgreSQL configuration?

Best regards,
Victor
#6494
General Support / Re: Action to return value
March 02, 2010, 07:34:25 PM
Hi!

StatusPollingInterval is a global parameter, and if you reduce it, all nodes will be polled more often. Depending on number of nodes, this may cause performance problems. One possible problem is network traffic increase, other is increased CPU and database usage. But severity of both these problems depends on number of nodes.

It's strange that you don't get data collection errors on Agent.Uptime - looks like a bug, because "data collection error" threshold should fire in that case. I'll check this.

Unfortunately all possible workarounds involves local agent. You can enable watchdog for local agent to restart it automatically in case of agent's crash, but it's workaround for workaround :) The only good solution I see is to allow status polling interval configuration for each node - it's on my todo list for some time, but I cannot promise exact version where this feature will be implemented.

Best regards,
Victor


#6495
General Support / Re: skip modem from monitoring
March 02, 2010, 07:26:01 PM
If you need to compare two values in NXSL, you should use == operator. Operator = is an assignment. So, if your script really uses = instead of ==, it's one mistake. Also, don't forget that any event passes all rules, except if matching rule contains "stop processing" option. You have to add it to your rule. Also, interface name always passed as parameter number 2 with SYS_IF_DOWN and SYS_IF_UP events, so you can compare just it's value to {5757FA85-B187-42A4-981C-7443B4ECFC90} instead of comparing full message text. So, I suggest the following rule:

event:
SYS_IF_DOWN
SYS_IF_UP

source:
any

severity:
any

script:
$2 == "{5757FA85-B187-42A4-981C-7443B4ECFC90}"

alarm:
none

actions:
none

options:
stop processing


Should work :)

Best regards,
Victor