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
General Support / Re: NetXMS Console fails to start
January 29, 2021, 04:35:03 PM
Since 3.7 minimal java version is 11
#212
General Support / Re: Get mac vendor result as dci
January 18, 2021, 05:20:49 PM
You can download latest mapping here: http://standards-oui.ieee.org/oui.txt

Then parse it and save in the mapping table (in this example - using nxshell):

#!/usr/bin/env nxshell

TABLE_NAME='MAC Address'

# find mapping table, create if missing
table_id = -1
for t in session.listMappingTables():
    if t.name == TABLE_NAME:
        table_id = t.id
        break
if table_id == -1:
    table_id = session.createMappingTable(TABLE_NAME, 'Lookup table for MAC -> Vendor', 0)

target_table = session.getMappingTable(table_id)

with open('oui.txt', 'r') as f:
    target_table.data.clear()
    for line in f.readlines():
        if "(hex)" in line:
            (mac, _, name) = line.strip().split('\t')
            mac = mac.split(' ')[0].replace('-', ':')
            target_table.data.add(MappingTableEntry(mac, name, None))

session.updateMappingTable(target_table)


Then you can lookup with map() function (in this example - find interface which have primary IP address):


for (i : $node->interfaces) {
if (i->ipAddr == $node->ipAddr) {
return map("MAC Address", (substr(i->macAddr, 0, 8)));
}
}


Result: Apple, Inc.

#213
General Support / Re: Get mac vendor result as dci
January 18, 2021, 03:18:35 PM
On one of the nodes with agent (let's call it "node1") add external parameter:

ExternalParameter=ResolveMAC(*):curl -s "https://api.macvendors.com/$1"

Then add DCI in the template:
Parameter=ResolveMAC(%{node_mac})
Source Node=node1

But I'd use mapping tables instead of calling remote service.
#214
Configuration -> Image Library
#215
По умолчанию права наследуются от родителя (если это принудительно не отключить на контейнере). Именно так выданы права админам - на Infrastructure Services есть единственное правило для группы Admins.

Актуальные права пользователя высчитываются наложеним:
1) отнаследованные права на объекте
2) права на объекте для групп, в которых есть пользователь
3) права на объекте для пользователя

например можно сделать структуру (для примера есть user1, user2 и они в group1):
Container1 - тут дать read права для group1, наследование по умолчанию включено
+ Node1 - пустой access control
+ Node2 - тут в access control добавить user1 вообще без прав

по результатам:
user1 будет видеть Container1 и обе ноды
user2 будет видеть Container1 и только Node1 (read будет отнаследован от Container1, но потом перекрыт правилом на самой ноде)
#216
права на объекты надо на самих объектах, права в редакторе юзеров - для глобальных вещей (типа достапа к логам)
#217
General Support / Re: Failed DB Query count
January 08, 2021, 11:09:59 AM
Which version you are currently using?
#218
There are multiple ways to do that, I'd probably use instance in action name:

1) configure 2 actions on the agent: StartA, StartB
2) Create 2 DCIs - Process.Count(A) and Process.Count(B) with threshold "< 1" on both (or any other way how you detect that process is down), set instance to "A" and "B" respectively (in thresholds tab, will be used in action name) and some activation event (can be the same).
3) handle this event in EPP with "Execute command on remote node via agent" action, as agent action name put something "Start%<instance>"
#219
Sample config:


LogFile=c:\netxms\logs\nxagentd.log

[EXT:XYZ]
LogFile=c:\netxms\logs\nxagentd.xyx.log

Action=StartApp:c:\...\app.exe


Core agent (which runs as service) will read main section, and second instance of the agent will read EXT: section instead.
Second instance should be started in the user's session with additional command line arguments: -G EXT:XYZ -H
-G should match EXT: section in the config file and -H will hide agent's console window from user.

You can add agent to autostart using reg command (or in any other way):
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NetXMSExternalAgent /t REG_SZ /d "C:\NetXMS\bin\nxagentd.exe -c C:\NetXMS\etc\nxagentd.conf -G EXT:XYZ -H" /f
#220
Один из вариантов - вытащить на карту не коммутатор, а его интерфейс (двойной клик на ноде в дереве откроет интерфейсы, если они еще не загружены), после чего поменять в пропертях интерфейса иконку для карты и имя.
Второй вариант - сделать ноду с IP=0.0.0.0, на ней DCI (скриптовый или с трансформационным скриптом) с включенной опцией "Use this DCI for node status calculation" и возвращать значение статуса (0-6), который и и будет менять статус этой ноды.
#221
General Support / Re: Unknown error
December 24, 2020, 12:24:38 PM
Check filtering script in event processing policy rules #3 and #5. You call nonexisting function there in line 3 of the script.
#222
General Support / Re: Undo terminate event
December 23, 2020, 04:48:27 PM
I assume that by "terminate event" you mean "terminate alarm".
Short answer is no - once terminated, alarm will remain only in alarm log. However, you can repeat threshold activation events (you can set that in threshold editor) and therefore recreate alarms, if threshold is still active. Everything else will not be repeated.

Another way - revoke "terminate alarms" permission from user (leave only "Resolve"), then terminate with separate user (or even another person after verification that issue was solved).
#223
yum install libcurl-devel
потом ./configure без --without-curl
#224
Quotegenerated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --with-server --with-mariadb --with-mariadb-compat-headers --with-agent --without-curl --disable-ssh --disable-mqtt --disable-dependency-tracking

cURL был принудительно отключен в configure: --without-curl
#225
cURL был доступен в момент сборки? Лог config.log остался?