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
Currently this is very limited. You can use macros in templates - these macros will be expanded when template applied to nodes. This can be useful if you create template and need to pass IP address or node name to parameter after it was applied to node. Here is short description for template macros: https://www.netxms.org/documentation/adminguide/data-collection.html#macros-in-template-items

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

o->enableAgent(false);

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

o->flags += 33554432;

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

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

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

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

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

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

Однако главная проблема в том, что сейчас флаги объекта из скриптов менять нельзя (и вообще ничего нельзя) - в NXSL класс Node read-only. Я могу это поменять, но это уже будет в следующем релизе (ну или со снапшота собрать можно будет).
#3833
Вроде нашел возможную причину. Я могу выложить версию с исправлениями - в каком формате лучше?
#3834
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
#3835
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
#3836
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
#3837
We implement it just recently, in 1.2.12, and it is not documented yet.

Best regards,
Victor
#3838
Updated subagent attached.

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

Best regards,
Victor
#3840
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