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 - Alex Kirhenshtein

#211
Вот пример, что можно сделать:

trace(0, "Calculating link color for " . $endpoint1->name . " -> " . $endpoint2->name);

match1 = $endpoint1->name match ".*ASA-(.*)$";
match2 = $endpoint2->name match ".*ASA-(.*)$";

if (match1 and match2) {
key = "Dummy(ipsec-uptime-" . lower(match1[1]) . "-" . lower(match2[1]) . ")";
trace(0, "Searching for " . key . " on " . $endpoint1->name);
value = GetDCIValueByName($endpoint1, key);
if (not value) {
key = "Dummy(ipsec-uptime-" . lower(match2[1]) . "-" . lower(match1[1]) . ")";
trace(0, "Searching for " . key . " on " . $endpoint2->name);
value = GetDCIValueByName($endpoint2, key);
}

if (value != null) {
trace(0, "Got value " . value);
if (value > 0) {
return "green";
}
}
}

return "red";
#212
Эти 20 линков будут на одной циске? Или линк будет между уникальными парами устройств?

EDIT: хотя полюбому, можно же сматчить линк по обеим нодам. Как еще один вариант - если имена нод похожие, то можно просто брать конец имени, и собирать название DCI (e.g. MSK-APR")
#213
Это зависит уже от конкретных метрик. Скрипт может взять данные с любой ноды (как через $endpoint1/$endpoint2, так и через FindNodeObject(null, "server1")), дальше уже вопрос поиска нужного DCI на ноде.
Если DCI никак не определить из скрипта, можно прописать его ID в custom attribute на ноде и доставать таким образом - вариантов много, надо знать детальные требования, чтоб предложить оптимальный путь.
#214
Самое простое решение - в настройках линка выбрать Color -> Script выбрать скрипт, который будет возвращать цвет на основе DCI (при помощи одной из GetDCIValue* функций - https://www.netxms.org/documentation/nxsl-latest/#func-getdcivalue).
Скрипт берется из Scripting Library и должен возвращать цвет - в виде строки или числа.
Строка - как в CSS, название цвета или любой из вариантов "#RRGGBB", "0xRRGGBB", "rgb(R, G, B)", где R, G и B - компоненты цвета красный-зеленый-синий. Список цветов можно посмотреть тут: https://github.com/netxms/netxms/blob/master/src/libnetxms/tools.cpp#L4292
Так же можно вернуть число, с цветом побайтно - 0xRRGGBB (например красный - 0xFF0000, эквивалентно 16711680).

Кроме обычных функций и глобальных переменных, в скрипте так же доступны две переменные "$endpoint1" и "$endpoint2", которые указывают на ноды линка.

Второй вариант - сделать ноду с IP=0.0.0.0, на ней сделать dummy DCI с флагом "Use this DCI for node status calculation" и скриптом, который будет возвращать статус 0-6 (normal, warning, minor, major, etc.)
#215
На данный момент нет. В принципе штука полезная, сделаем.

Прямо сейчас можно сделать некотрое подобие на основе object tool  c скриптом:
1) сделать событие, что-то типа MAINTENANCE_RECORD
2) настроить object tool с текстовым input field, который запускает nxsl скрипт
3) из скрипта посылать событие MAINTENANCE_RECORD (https://www.netxms.org/documentation/nxsl-latest/#func-postevent), в параметры сложить текст из поля ввода

Просмотрел - в event log.
#216
Добрый день.

Да, конечно, можете спокойно использовать. Лицензия - GPLv2, основное требование, которое потенциально может мешать коммерческому использованию - если вы вносите изменения в исходный код продукта (это не относится к вашей конфигурации / скриптам / etc.), то по запросу вы должны предоставить эти изменения кода.
#217
apt-get dist-upgrade должно помочь
#218
General Support / Re: WebUI questions
July 02, 2021, 11:30:12 PM
2 - you can use fullscreen-dashboard=name instead of dashboard= in the URL

3 - User should have read permission on the dashboard itself and read on all objects (or some of them - rest will be shown as "error") which are referenced in the dashboard.
Dashboard itself is just a layout configuration for the console.

4. We use jetty9 as an application server. You can either modify installed server.xml (https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/config/etc/jetty-https.xml, https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-server/src/main/config/etc/jetty-ssl.xml, https://www.eclipse.org/jetty/documentation/jetty-9/index.html#configuring-ssl) or install reverse proxy.

I personally think that HTTPS configuration in Jetty/Tomcat is an overcomplicated mess and almost never use it. Instead I do all SSL termination on the nginx / reproxy / traefik which works as reverse proxy.
#219
There are multiple ways to achieve that.
If it's ok for you to query data multiple times - just extract common code into a script in the library, then use it in the transformation / wrapper scripts:


// Library script "lib1"
function collect() {
  // collect data and return as array of records
}

// transformation script on the DCI or source script:
records = lib1::collect();
return records[0]; // add logic here

// for tables:
records = lib1::collect();
t = Table(); // or use $1 if it's transformation script
t->addColumn("col1"); // required only when creating table from scratch
t->addColumn("col2");
for (r : records) { // add logic here
   row = t->addRow();
   t->set(row, 0, r[0]);
   t->set(row, 1, r[1]);
}


Another option is to create table DCI, then use this DCI as data source for any other, e.g.:


// GetDCIValue() and GetDCIValueByDescription() might be usefull (see https://www.netxms.org/documentation/nxsl-latest/#_data_collection)
t = GetDCIValueByName($node, "My.Table.DCI"); // result will be either String or Table object
return t->findRowByInstance("peer1")->get("col1"); // you can use  either column names or indexes in get()
#220
Hello.

You can parse https://github.com/netxms/changelog/blob/master/ChangeLog. It's updated before the official release is announced, but once X.Y-CURRENT is changed to full version X.Y.Z - it's frozen.
#221
Hello.

Seems fine on my system. (Big Sur 11.2.3 (20D91) on MacBook Pro (15-inch, 2018))
#222
Hello.

It depends on your setup.
How many nodes do you monitor? How many DCIs and how often they are collected? How many events / alarms per day? Do you collect syslog?
#223
General Support / Re: Change or regenerate agent ID
March 18, 2021, 02:46:32 PM
I just realized that there is a simpler way to do that - run agent with "-T" argument:

(nx-stable) ➜  netxms-stable git:(stable-3.8) nxagentd -h
Usage: nxagentd [options]
Where valid options are:
   ...
   -T         : Reset agent identity
   ...


Agent will exit after reseting ID, so you can do this as Action (define in nxagentd.conf):


Action=Agent.ResetID=C:\NetXMS\bin\nxagentd -T


Then execute Agent.ResetID either using object tools, or with "nxaction" command (e.g. "nxaction -o IP Agent.ResetID").
Once ID reset - restart agent (also, you can do this either with object tools, or by using "nxaction IP Agent.Restart")
#224
General Support / Re: Object Access Control
March 13, 2021, 01:08:16 PM
Unlock user "system", relogin as "system" and fix permissions. Once done - lock this user again (there are no access control for this user, so it's better to keep it disabled).
#225
General Support / Re: Change or regenerate agent ID
March 12, 2021, 10:53:34 AM
Hello.

Remove file "nxagentd.db" from data directory. Data directory location is logged on startup, something like this:
2020.12.14 12:34:48.558 *I* [                   ] Data directory: /opt/netxms/stable/var/lib/netxms

Out of curiosity: are you using our ATM monitoring solution, or made your own based on the NetXMS?