News:

We really need your input in this questionnaire

Main Menu
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

#226
General Support / Re: Reading a Windows registry key
March 08, 2021, 03:11:02 PM
Yes, you can use standard command line registry editor for that:

ExternalParameter=RegQuery:reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /f NetXMSSessionAgent /t REG_SZ /v /e
ExternalList=RegQuery:reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /s


Adjust name of the parameter and arguments.

You can also do that with actions (but select "produce output" checkbox in object tool configuration):
Action=RegQuery:reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /s
#227
General Support / Re: Syslog Monitoring
March 04, 2021, 09:48:52 PM
It's in the database, table config_clob.
You can query it with:
SELECT var_value FROM config_clob WHERE var_name='SyslogParser'
#228
скриптом в Hook::CreateInterface (в Scripting Library).

Хук вызывается перед созданием интерфеса, и получает $1 - объект Interface и $node - объект Node.

что-то типа:

if (...) {
  $1->setExpectedState(2);
}
return true; //  важно
#229
General Support / Re: Microsoft Teams notification
February 19, 2021, 07:01:25 PM
Enable level 6 debugging for tag ncd.msteams and check server log (after attempt to send).

You can change debug level in runtime with
nxadm -c "debug ncd.msteams 6"
#230
Check alarm key in EPP rule which creates them. Also doubleclick on alarm and check key there.
Most likely key is either too narrow or unset (with empty key new alarm will be created even is similar already exists)
#231
All components with the same major.minor versions (e.g. 3.7) are compatible. Latest build of the management console is 144 (https://netxms.org/download/releases/3.7/nxmc-3.7.144-linux-gtk-x64.tar.gz), and you should use it with the .145 server.
#232
Upgrades are incremental, so you can safely go directly to the latest version, "nxdbmgr upgrade" will handle all steps correctly.
Should be safe, but I'd backup first anyway.

EDIT: I tried upgrade from empty 1.2.17 database and found a small bug with the upgrade. Either wait for next release, or apply https://github.com/netxms/netxms/commit/b30dfa64644c639d177f4367bc6de13ff4708311 and rebuild.

Another option will be upgrading to some intermediate version, but I'm not sure which will work correctly (2.x something should work, but it will be trial and error).
#233
General Support / Re: Nxmc management console
February 02, 2021, 01:12:22 PM
Hello.

You need to upgrade Java to version 11 or newer.
#234
General Support / Re: NetXMS Console fails to start
January 29, 2021, 04:35:03 PM
Since 3.7 minimal java version is 11
#235
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.

#236
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.
#237
Configuration -> Image Library
#238
По умолчанию права наследуются от родителя (если это принудительно не отключить на контейнере). Именно так выданы права админам - на 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, но потом перекрыт правилом на самой ноде)
#239
права на объекты надо на самих объектах, права в редакторе юзеров - для глобальных вещей (типа достапа к логам)
#240
General Support / Re: Failed DB Query count
January 08, 2021, 11:09:59 AM
Which version you are currently using?