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

#6796
Tol'ko nastrojkoj DCI eto ne poluchitsja. Mozno sdelat' cherez ExternalParameter na ljubom agente, luchshe vsego na samom servere. Delaem parametr vida


ExternalParameterShellExec = ActiveCallCount(*):nxsnmpwalk $1 <numeric oid for ciscoVoiceDialControlMIB.cvdcMIBObjects.cvGatewayCallActive.cvCallActiveTable> | wc -l


On budet vozvraschat' kolichestvo strok v tablice dlja zadannogo hosta. Posle etogo mozno na uzle, dlja kotorogo trebuetsja sobirat' etot parametr, opredelit' DCI dlja parametra ActiveCallCount(ip) i ukazat' kak "proxy node" uzel, cherez kotorij budet proishodit' opros.

Nu i odnazdi ja vse-ze sdelaju podderzku SNMP tablic v DCI :)
#6797
Proveril - eto bug v servere. Ispravil, v 0.2.27 budet rabotat' kak nado.
#6798
Общие вопросы / Re: Alarm Notifier
July 06, 2009, 10:46:07 AM
Aga, teper' ponjal. Budu smotret'.
#6799
Est' malen'kij primerchik v user's manual po ispol'zovaniju situacij.
Smisl situacij - hranit' tekuschee sostojanie seti i obnovljat' ego na osnove prihodjaschih sobitij. Pri obrabotke soobschenij v event processing policy mozno menjat' znachenija atributov situacij, i iz ljubih scriptov (fil'tri v event processing policy, transformation dlja DCI, macro expansion) poluchat' tekuschie znachenija atributov.
Sejchas ne t vremeni podrobnee raspisivat', esli budut esche voprosi, vecherom napishu podrobnij primer ispol'zovanija.
#6800
Quote from: sodalist on July 02, 2009, 04:37:46 AM
BTW I am still searching for pay pal donations button :)

We have added such button :) May be it will have some use :)

Best regards,
Victor
#6801
Otlovit' mozno threshold'om "data collection error". S ispol'zovaniem v transformation script'e drugoj nodi problematichnej - sdelat' mozno tol'ko cherez situacii. T.e. dlja DCI #1 stavim threshold na "data collection error", generiruem kakoj-to custom event. V event processing policy obrabativaem eto sobitie, vistavljaja kakoj-to atribut sozdannoj dlja etogo situiacii. I v transformation scripte DCI #2 poluchaem tekuschee znachenie atributa situacii pri pomoschi funkcij FindSituation i GetSituationAttribute.
#6802
Общие вопросы / Re: Alarm Notifier
July 05, 2009, 11:22:04 AM
Vse, chto dolzno proizojti - v pole status tekst "Outstanding" dolzen smenitsja na "Acknowledged". Ili etogo toze ne proishodit?
#6804
Da, budet neskol'ko voprosov:

1. Eto proishodit kazdij raz ili inogda?
2. Skol'ko pravil v event policy?
3. Eto proishodit v lokal'noj seti ili na medlennih kanalah svjazi?
4. Na kakoj operacionke i baze rabotaet server?
5. Ispol'zuetsja li shifrovanie?
#6805
General Support / Re: Problem with subgents
July 01, 2009, 03:43:57 PM
When you query Icmp.* parameters, you should be asked for additional arguments. For Icmp.Ping, you should enter IP address you wish to ping. Agent should do ping to given address respond with ping response time. For all other Icmp.* parameters you should specify name or IP address of preconfigured target. See this document: https://www.netxms.org/documentation/ping_subagent.shtml.

Best regards,
Victor
#6806
General Support / Re: Problem with subgents
July 01, 2009, 02:09:59 PM
Hi!

It's a known bug - parameters LogWatch.Parser.* are not working. However, you don't need them to do log monitoring - it's just a parser statistics.

What about PING subagent - do you still have problems mentioned in your previous post?

Best regards,
Victor
#6807
Hi all!

Nearly six years ago I started NetXMS as my hobby open-source project. Then I found that quite a few people actualy use it and like it. This gave me a good reason not to stop. Few other guys have joined me and we continued development with increased efforts and passion - because we knew we do something really cool. Few years later I found myself having two fulltime jobs - my day job, and NetXMS. Couple months ago I realized that one of the jobs must go, so now NetXMS is my day job. I've set up a company - Raden Solutions - which is supposed (among few other things) to handle NetXMS commercial support and training activities. I hope that this will allow me to spent more time and resources on NetXMS development, resulting in better product with faster development cycle. And if by any chance you need "official" NetXMS support or training - you know where to look  :)

Company web site: http://www.radensolutions.com

Best regards,
Victor
#6808
General Support / Re: Actions - Parameter?
June 30, 2009, 07:50:43 PM
Yes, you right - alarm message is unavailable within script. For the next version, I add new global variable $alarmMessage which will hold alarm's text. It's not part of event object (it's only created based on event data), so it will be incorrect and technically slightly harder to put it as $event attribute.

Currently you able to pass alarm message to action via %A macro - this can help if you don't need it in script.

Quote from: jdl on June 30, 2009, 04:28:15 PM
In the script, the $event->message refers to the text message defined in the event not in the alarm which can be more specific as we get additional macro's at that level, right?

You have only two additional macros at alarm definition level - %m (event's message text) and %M (custom message, if set in matching script). All other macros are the same (including scripts and custom node attributes).

Best regards,
Victor
#6809
Server should not crash - it's a bug. But anyway, when script returns something to be used as macro expansion result, it should be string.

Best regards,
Victor
#6810
Hello!

Quote from: jdl on June 30, 2009, 11:21:04 AM
- Any possible way to insert comments? Using for example # as in Perl...

Yes. Comments is like in C or Java - i.e. you can have multiline comments enclosed in /* */, and comments till end of line started from //.

Quote from: jdl on June 30, 2009, 11:21:04 AM
- Is the operator ~= similar to the one in Perl? I.e. calling for regular expression?

Yes, it's calling regular expression specified at right on left operand, and result is true (1) if operand matches regexp, and false (0) otherwise. But unlike perl, you should specify regular expression as string, not inside // characters.

Quote from: jdl on June 30, 2009, 11:21:04 AM
As far as reg.ex. are concerned, is the syntax the same?
If for example, I need a script parsing a message text to return different elements and use them to defined return argument(s)...
Message test is "TCP Socket is open on host xyz.domain.com (172.16.0.1) using port 3333" and my regular expression is:
$event->message ~= "^TCP Socket is (.*) on host (.*) \((.*)\) using port (\d)$"

Syntax is not completely the same - NXSL uses POSIX extended regular expressions (http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions), and as far as I know Perl, there are some differences. Your example expression for NXSL should looks like

$event->message ~= "^TCP Socket is (.*) on host (.*) \((.*)\) using port ([0-9]+)$"

Quote from: jdl on June 30, 2009, 11:21:04 AM
How can I put the matched info in different variables: $status, $host, $ipaddr and $port?
How do you define those variables?

Similar to Perl, NXSL places matched parts enclosed in brackets into variables $1, $2, and so on. If you wish to place these results into your own variables, you have to assign them after match. Please note that  variable should not start with $ sign, it's often used as indicator of system/special variable. You may or may not use $ sign in your variables. Variables declared implicitly on first use. For example, to assign status, host, ipaddr and port variables on successful match, code can looks like this:


if ($event->message ~= "^TCP Socket is (.*) on host (.*) \((.*)\) using port ([0-9]+)$")
{
   status = $1;
   host = $2;
   ipaddr = $3;
   port = $4;
}



Quote from: jdl on June 30, 2009, 11:21:04 AM
What about functions in script?

You can define as many functions as you wish. Functions defined with sub keyword. For example:


/* script entry point */
sub main()
{
   // Call functions
   result = my_function_1();
   result2 = my_function_2(1, 2);
   println "result1=" . result . " result2=" . result2;
}

/* additional function */
sub my_function()
{
   return 1;
}

/* function with parameters */
sub my_function_2(param1, param2)
{
   return param1 + param2;
}


Function order within script is not important.

Quote from: jdl on June 30, 2009, 11:21:04 AM
How do we return an array as argument?
Is syntax return ($val_1, $val_2); correct?
Will this array be returned as an array?

To return an array, you should explicitly create it with array operator, assign array's elements, and return it. For example:


sub fx()
{
   array a;  // Create empty array and store reference to it in variable a
   a[1] = "value1";
   a[2] = "value2";
   return a;   // return reference to array
}

sub main()
{
   x = fx();  // get array result from function
   println "second element is " . x[2];
}


Quote from: jdl on June 30, 2009, 11:21:04 AM
Would you have a complex example to post that would illustrate as many things as possible about defining NXSL script?

We don't have one, but looks like it worth creating one :) I'll do this later.

Best regards,
Victor