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

#6586
General Support / Re: Action to return value
January 28, 2010, 01:22:39 AM
Hello!

Unfortunatelly, answers to all questions is "no". However, they all looks useful, so I will add them to feature request list.

Best regards,
Victor
#6587
Hi!

For example, we want to send email for every critical event in Windows "Application" event log. To achieve that, we should:

1. Create new event in NetXMS (via Control Panel -> Events). Remember ID assigned to new event. For example, let's call our new event EVENTLOG_ERROR and assume that ID 100001 was assigned to it. Set message template to

ERROR: %1

2. Create parser configuration file. To generate event with code 100001 on each error message it will looks like following:

<parser>
  <file>*Application</file>
  <rules>
    <rule>
      <severity>1</severity>
      <match>(.*)</match>
      <event params="1">100001</event>
    </rule>
  </rules>
</parser>

3. Configure LogWatch subagent:

in main section of nxagentd.conf:
SubAgent = logwatch.nsm

in LogWatch section:
*LogWatch
Parser = our_parser_file.xml

4. Restart agent

5. Add appropriate rule to event processing policy (send e-mail for each EVENTLOG_ERROR event)

That's all - now server should send e-mails for every error message written to application event log.

Best regards,
Victor
#6588
General Support / Re: Questions about UPS
January 28, 2010, 01:11:08 AM
Hello!

You have to configure UPS subagent. Add to agent's configuration file the following:

in main section:

SubAgent = ups.nsm


at the end of file:

*UPS
Device = 1:"COM1:":APC

Replace COM1 with actual port name. If your have UPS other than APC, change communication protocol to BCMXCP or MICRODOWELL, depending on what your UPS supports. Restart agent.

After that, you'll be able to collect information about UPS. All parameters require device id, which is set to 1 in our example.

Best regards,
Victor
#6589
General Support / Re: How to create a DCI
January 28, 2010, 01:07:07 AM
Hi!

First, you have to specify your requirement in more details. How status of your application can be monitored? Do you have a script or command line tool which returns current status of your application?

Best regards,
Victor
#6590
Hello!

I've fixed this problem in next release. For building 0.2.31, replace line 339 in file net.cpp (it should looks like


if (rti_info[RTAX_DST] != NULL && !(rtm->rtm_flags & RTF_WASCLONED))


) with


if (rti_info[RTAX_DST] != NULL)


Best regards,
Victor
#6591
Windows / Re: compile nxlexer files
January 27, 2010, 07:16:08 PM
You can download it at https://www.netxms.org/download/dev/scilexer.lib.

Best regards,
Victor
#6592
Windows / Re: compile nxlexer files
January 27, 2010, 11:02:03 AM
I check my setup - i have two different scilexer.lib for some reasons. One of them contains these functions (and looks like static library), other are not (and looks like import library for scilexer.dll). Check what scilexer.lib you are linking.

Best regards,
Victor
#6593
Hi!

Snapshots does not contain configure script - it is created as part of distribution preparation. In the root of NetXMS source tree there are script called reconf which will create configure - but you must have autoconf, automake, and libtool installed.

Best regards,
Victor
#6594
Windows / Re: compile nxlexer files
January 25, 2010, 03:03:35 PM
Hi!

What version of Scintilla library you are using? Class PropSet defined in PropSet.h from Scintilla library. I use version 1.67, which probably outdated - may be this is the problem.

Best regards,
Victor
#6595
A kakoj u faila pravil'nij timestamp? Ne zabivajte, chto eti parametri vozvraschajut UNIX timestamp, t.e. kolichestvo sekund s 1 Jan 1970 00:00:00 UTC. Esli nado perevesti v drugoj format, to eto mozno sdelat' cherez transformation script dlja DCI.
#6596
Polls / Re: Smartphone client
January 19, 2010, 01:19:31 PM
Currently we don't have blackberry device for testing, and I have no idea how hard development for blackberry could be. It's not very popular in my country, so I just forgot to include it in the list. However, I'll add blackberry to the list to see how big is demand for blackberry client.

Best regards,
Victor
#6597
Windows / Re: compile libnxsl files
January 19, 2010, 12:08:33 PM
Hi!

You need flex version 2.5.33 or above.Looks like GnuWin32 still uses 2.5.4. I personally use flex and bison (and other tools like grep, etc.) from MSYS (http://www.mingw.org/).

Best regards,
Victor
#6598
Windows / Re: compile libnxsl files
January 18, 2010, 01:52:02 PM
Hello!

Looks like double quotes are missing somewhere, and because bison is installed into C:\Program Files\... it breaks on a space in a path. Try to install GnuWin32 tools into directory without spaces in the path.

Best regards,
Victor
#6599
Quote from: wonderboy on January 15, 2010, 03:04:02 PM
Спасибо за помощь, но сразу возник еще один вопрос.

Так как на разном оборудовании разные порты могут быть серверными, транковыми и т.д.
Решил в дескрипшенах писать что-то типа Trunk ... , User ... , Server ...
И иметь всего 3 правила на все устройства.

Пишу в политике для эвента SYS_IF_DOWN скрипт ($2 - содержит имя интерфейса в указанном выше формате):
sub main() {
if ($2 ~= "Trunk")
{
  return 1;
}
}


Но вот видимо не срабатывает, потому что алярмы свой приоритет не меняют.

PS: Stdout куда выводятся print, println это где? Куда нужно смотреть? :)

Скрипт выглядит правильно. Stdout доступен только если скрипт запущен через nxscript. Приведенный выше скрипт можно протестировать например так:

1. создать файл test.nxsl, скопировать в него скрипт;
2. запустить команду

nxscript -r test.nxsl param1 param2


Результат будет примерно такой:


C:\Source\NetXMS\debug>nxscript -r test6.nxsl param1 param2
NetXMS Scripting Host  Version 1.1.0-rc10
Copyright (c) 2005-2009 Victor Kirhenshtein

Result = (null)

C:\Source\NetXMS\debug>

C:\Source\NetXMS\debug>nxscript -r test6.nxsl param1 Trunk
NetXMS Scripting Host  Version 1.1.0-rc10
Copyright (c) 2005-2009 Victor Kirhenshtein

Result = 1

C:\Source\NetXMS\debug>


Если в скрипте для отладки нужна печать на экран, то можно использовать print / println:


sub main()
{
   println "$2='" . $2 . "'";
   if ($2 ~= "Trunk")
   {
      println "match";
      return 1;
   }
   println "no match";
}


Получим


C:\Source\NetXMS\debug>nxscript -r test6.nxsl param1 param2
NetXMS Scripting Host  Version 1.1.0-rc10
Copyright (c) 2005-2009 Victor Kirhenshtein

$2='param2'
no match
Result = (null)

C:\Source\NetXMS\debug>

C:\Source\NetXMS\debug>nxscript -r test6.nxsl param1 Trunk
NetXMS Scripting Host  Version 1.1.0-rc10
Copyright (c) 2005-2009 Victor Kirhenshtein

$2='Trunk'
match
Result = 1

C:\Source\NetXMS\debug>

#6600
В заголовке окна видна пометка "modified". Event processing policy вступает в силу только после того, как она сохранена на сервере. Эти тестовые изменения были сохранены?