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

#3826
Если скрипт вызван из политики, то у него будут две переменных выставлены - $node и $event. Описания классов здесь: http://wiki.netxms.org/wiki/NXSL:Node и http://wiki.netxms.org/wiki/NXSL:Event.
#3828
С добавлением метода enableAgent можно повесить скрипт на SYS_NODE_ADDED и отключать агентов с его помощью.
#3829
Добавил новые методы в класс Node: enableAgent, enableConfigurationPoll, enableIcmp, enableSnmp, enableStatusPoll, enableTopologyPoll.
Теперь в скрипте можно написать

o->enableAgent(false);

#3830
Можно добавить функции или методы в NXSL класс для изменения конкретных флажков или аттрибутов (как сделано например сейчас с ManageObject или RenameObject).
#3831
Строка

o->flags += 33554432;

дает ошибку компиляции, а поскольку команда exec ищет только скомпилированные скрипты, то выдается несколько нелогичное сообщение "script not found".

Ошибка компиляции на самом деле из-за бага в интерпретаторе NXSL - он не понимает += для аттрибутов объектов.

o->flags = o->flags + 33554432;

скомпилируется без ошибок. Кстати, дла выставления и проверки флагов надо использовать битовые операции:

o->flags = o->flags | 33554432;

тогда можно не проверять на текущее значение flags.

Однако главная проблема в том, что сейчас флаги объекта из скриптов менять нельзя (и вообще ничего нельзя) - в NXSL класс Node read-only. Я могу это поменять, но это уже будет в следующем релизе (ну или со снапшота собрать можно будет).
#3832
Вроде нашел возможную причину. Я могу выложить версию с исправлениями - в каком формате лучше?
#3833
This is mostly for historical reasons. Initially we create network services as separate objects with two goals in mind: so they affect node status and so configuration will be a bit easier. Then service check DCIs was added for greater flexibility, but services as objects remains to maintain compatibility and because some people prefers to see them as objects (mostly in small installations). So I would say currently there are no advantages over DCIs.

Best regard,
Victor
#3834
General Support / Re: Value formatting
March 25, 2014, 07:32:10 PM
Hi!

You can format event parameter using script, like this:

1. use %[formatted_p4] instead of %4

2. Create script named formatted_p4 in library like this:

return format($event->parameters[4], 1, 2);

Best regards,
Victor
#3835
Feature Requests / Re: 'comments' tab on DCI objects
March 25, 2014, 07:26:29 PM
I've added this as feature request: https://www.radensolutions.com/chiliproject/issues/537
#3836
We implement it just recently, in 1.2.12, and it is not documented yet.

Best regards,
Victor
#3837
Updated subagent attached.

Best regards,
Victor
#3838
No problem, I'll build intermediate binary. Are you using 32 or 64 bit version?

Best regards,
Victor
#3839
General Support / Re: network discovery
March 24, 2014, 02:21:19 PM
Discovery polling used to collect IP addresses of potential new nodes, and it is not run if network discovery is disabled. Routing table polls used to read and cache routing tables - they are using in event correlation (to detect that node down is because of intermediate router failure) and for IP route visualization.

Best regards,
Victor
#3840
General Support / Re: VPN connectors
March 24, 2014, 02:17:52 PM
I think that some code is broken. I'll check that in next few days (I registered it as an issue: https://www.radensolutions.com/chiliproject/issues/535).

Best regards,
Victor