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

#31
General Support / Re: v5.1.3 Android Client
September 25, 2025, 01:42:14 AM
Quote from: cserzs on September 24, 2025, 10:40:58 PMWhat is the syntax of the "Hostname or IP" parameter in the mobile app?

You can check if endpoint is correct - it should return information about the API itself, something like:

{"description": "NetXMS web service API", "version": "5.2.3.21", "build": "5.2-366-g15daea330f", "apiVersion": 1}⏎                                                                         
#32
Announcements / Re: NetXMS 5.2 patch release 5
September 22, 2025, 01:33:28 PM
Quote from: johnnyva on September 16, 2025, 07:39:49 AMHey Alex, I'd imagine we should also be checking for dupes on the tdata tables too right?

Yes, if you have table DCIs configured.

But this issue is already sorted in 5.2.6
#33
General Support / Re: Alarm notification call API
September 21, 2025, 09:57:57 PM
Add "server action" in EPP rule where you are creating alarm
#34
Feature Requests / Re: IOS App
September 18, 2025, 07:58:55 PM
Quote from: richard21 on September 18, 2025, 07:40:29 PMVery Nice I have it working one Observation / Issue it doesn't let you logon if you have MFA enabled on the account

Thanks for the report, I'll check it. It supposed to be working.

BTW, you can screenshot app and send comments directly in the TestFlight
#35
Feature Requests / Re: IOS App
September 16, 2025, 11:20:57 AM
It's still in TestFlight, not released into store itself. You can get it here: https://testflight.apple.com/join/B677yBU2
#36
General Support / Re: NetXMS default templates
September 12, 2025, 11:28:02 AM
Quote from: maliodpalube on September 12, 2025, 11:14:39 AMOk, thx, but when trying to import xml template nothing happens it just stands like this indefinitely, can click on ok, only browse or cancel

which version is it?
#37
Hi,

TL/DR: if you are using PostgreSQL - either wait for 5.2.6, or check that you don't have duplicate records in idata_* tables before the upgrade (scripts bellow).

in 5.2.5 we modified DB schema and added PK on the idata_* tables (which hold history of all collected metrics). It was done to resolve issues with active-active replication. Previously these tables had no PK for performance reasons (in really old verions of the postgres).

However, we got couple of reports, that schema upgrade failed due to duplicates. While it's not realy clear why there are duplicates, if breaks upgrade process. This will be automated in 5.2.6, but if you want to upgrade now, or already mid-process, do the following:

1) Check if you have any duplicates. If there are none - you are good to go, and can safely proceed with the upgrade.

DO $$
DECLARE
    node_record RECORD;
    tbl_name TEXT;
    dup_count INTEGER;
    total_duplicates INTEGER := 0;
BEGIN
    FOR node_record IN SELECT id FROM nodes
    LOOP
        tbl_name := 'idata_' || node_record.id;
       
        IF EXISTS (
            SELECT 1
            FROM information_schema.tables
            WHERE table_schema = 'public'
            AND table_name = tbl_name
        ) THEN
            RAISE NOTICE 'Processing table %', tbl_name;
           
            EXECUTE format('
                WITH ranked AS (
                    SELECT ctid,
                           ROW_NUMBER() OVER (PARTITION BY item_id, idata_timestamp ORDER BY ctid) as rn
                    FROM public.%I
                )
                SELECT COUNT(*)
                FROM ranked
                WHERE rn > 1
            ', tbl_name) INTO dup_count;
           
            IF dup_count > 0 THEN
                RAISE NOTICE 'Table % has % duplicate rows', tbl_name, dup_count;
                total_duplicates := total_duplicates + dup_count;
            END IF;
        END IF;
    END LOOP;
   
    RAISE NOTICE 'Total duplicate rows found: %', total_duplicates;
END $$;

2) If you have duplicates, you need to remove them before proceeding with the upgrade.

DO $$
DECLARE
    node_record RECORD;
    tbl_name TEXT;
    deleted_count INTEGER;
    total_deleted INTEGER := 0;
BEGIN
    FOR node_record IN SELECT id FROM nodes
    LOOP
        tbl_name := 'idata_' || node_record.id;
       
        IF EXISTS (
            SELECT 1
            FROM information_schema.tables
            WHERE table_schema = 'public'
            AND table_name = tbl_name
        ) THEN
            RAISE NOTICE 'Processing table %', tbl_name;
           
            EXECUTE format('
                WITH duplicates AS (
                    SELECT ctid,
                           ROW_NUMBER() OVER (
                               PARTITION BY item_id, idata_timestamp
                               ORDER BY ctid
                           ) as rn
                    FROM public.%I
                )
                DELETE FROM public.%I
                WHERE ctid IN (
                    SELECT ctid
                    FROM duplicates
                    WHERE rn > 1
                )', tbl_name, tbl_name);
           
            GET DIAGNOSTICS deleted_count = ROW_COUNT;
           
            IF deleted_count > 0 THEN
                RAISE NOTICE 'Deleted % duplicate rows from table %', deleted_count, tbl_name;
                total_deleted := total_deleted + deleted_count;
            ELSE
                RAISE NOTICE 'Table % has no duplicates', tbl_name;
            END IF;
        END IF;
    END LOOP;
   
    RAISE NOTICE 'Total duplicate rows deleted: %', total_deleted;
END $$;
#38
Announcements / Re: NetXMS 5.2 patch release 5
September 05, 2025, 12:39:21 PM
Quote from: Spheron on September 05, 2025, 09:36:46 AMThe script is running about 1h bevor i canceld it.

It was rather inefficient.

Try this one instead:

DO $$
DECLARE
    node_record RECORD;
    tbl_name TEXT;
    dup_count INTEGER;
    total_duplicates INTEGER := 0;
BEGIN
    FOR node_record IN SELECT id FROM nodes
    LOOP
        tbl_name := 'idata_' || node_record.id;
       
        IF EXISTS (
            SELECT 1
            FROM information_schema.tables
            WHERE table_schema = 'public'
            AND table_name = tbl_name
        ) THEN
            RAISE NOTICE 'Processing table %', tbl_name;
           
            EXECUTE format('
                WITH ranked AS (
                    SELECT ctid,
                          ROW_NUMBER() OVER (PARTITION BY item_id, idata_timestamp ORDER BY ctid) as rn
                    FROM public.%I
                )
                SELECT COUNT(*)
                FROM ranked
                WHERE rn > 1
            ', tbl_name) INTO dup_count;
           
            IF dup_count > 0 THEN
                RAISE NOTICE 'Table % has % duplicate rows', tbl_name, dup_count;
                total_duplicates := total_duplicates + dup_count;
            END IF;
        END IF;
    END LOOP;
   
    RAISE NOTICE 'Total duplicate rows found: %', total_duplicates;
END $$;

And then to delete duplicates:
DO $$
DECLARE
    node_record RECORD;
    tbl_name TEXT;
    deleted_count INTEGER;
    total_deleted INTEGER := 0;
BEGIN
    FOR node_record IN SELECT id FROM nodes
    LOOP
        tbl_name := 'idata_' || node_record.id;
       
        IF EXISTS (
            SELECT 1
            FROM information_schema.tables
            WHERE table_schema = 'public'
            AND table_name = tbl_name
        ) THEN
            RAISE NOTICE 'Processing table %', tbl_name;
           
            EXECUTE format('
                WITH duplicates AS (
                    SELECT ctid,
                          ROW_NUMBER() OVER (
                              PARTITION BY item_id, idata_timestamp
                              ORDER BY ctid
                          ) as rn
                    FROM public.%I
                )
                DELETE FROM public.%I
                WHERE ctid IN (
                    SELECT ctid
                    FROM duplicates
                    WHERE rn > 1
                )', tbl_name, tbl_name);
           
            GET DIAGNOSTICS deleted_count = ROW_COUNT;
           
            IF deleted_count > 0 THEN
                RAISE NOTICE 'Deleted % duplicate rows from table %', deleted_count, tbl_name;
                total_deleted := total_deleted + deleted_count;
            ELSE
                RAISE NOTICE 'Table % has no duplicates', tbl_name;
            END IF;
        END IF;
    END LOOP;
   
    RAISE NOTICE 'Total duplicate rows deleted: %', total_deleted;
END $$;
#39
Announcements / Re: NetXMS 5.2 patch release 5
September 04, 2025, 04:50:46 PM
Quote from: Spheron on September 04, 2025, 12:09:30 PMIf i run then nxdbmgr background-upgrade i get the following errors:

DROP INDEX idx_tdata_7035
SQL query failed (42P16 FEHLER:  mehrere Primärschlüssel für Tabelle »idata_7046« nicht erlaubt):
ALTER TABLE idata_7046 ADD PRIMARY KEY (item_id,idata_timestamp)
SQL query failed (42P16 FEHLER:  mehrere Primärschlüssel für Tabelle »tdata_7046« nicht erlaubt):
ALTER TABLE tdata_7046 ADD PRIMARY KEY (item_id,tdata_timestamp)
SQL query failed (42704 FEHLER:  Index »idx_idata_7052_id_timestamp« existiert nicht):
DROP INDEX idx_idata_7052_id_timestamp
SQL query failed (42P16 FEHLER:  mehrere Primärschlüssel für Tabelle »tdata_7052« nicht erlaubt):
ALTER TABLE tdata_7052 ADD PRIMARY KEY (item_id,tdata_timestamp)
SQL query failed (42P16 FEHLER:  mehrere Primärschlüssel für Tabelle »idata_7089« nicht erlaubt):
ALTER TABLE idata_7089 ADD PRIMARY KEY (item_id,idata_timestamp)
SQL query failed (42704 FEHLER:  Index »idx_tdata_7089« existiert nicht):
DROP INDEX idx_tdata_7089
SQL query failed (42P16 FEHLER:  mehrere Primärschlüssel für Tabelle »idata_7096« nicht erlaubt):
ALTER TABLE idata_7096 ADD PRIMARY KEY (item_id,idata_timestamp)
SQL query failed (42P16 FEHLER:  mehrere Primärschlüssel für Tabelle »tdata_7096« nicht erlaubt):
ALTER TABLE tdata_7096 ADD PRIMARY KEY (item_id,tdata_timestamp)
SQL query failed (42704 FEHLER:  Index »idx_idata_7127_id_timestamp« existiert nicht):

There is one more problem - you already have duplicates in the idata_* tables.

Try this query to find them:

DO $$
DECLARE
    node_record RECORD;
    tbl_name TEXT;
    dup_count INTEGER;
    total_duplicates INTEGER := 0;
BEGIN
    FOR node_record IN SELECT id FROM nodes
    LOOP
        tbl_name := 'idata_' || node_record.id;
       
        IF EXISTS (
            SELECT 1
            FROM information_schema.tables
            WHERE table_schema = 'public'
            AND table_name = tbl_name
        ) THEN
            EXECUTE format('
                SELECT COUNT(*) FROM public.%I
                WHERE ctid NOT IN (
                    SELECT MIN(ctid)
                    FROM public.%I
                    GROUP BY item_id, idata_timestamp
                )', tbl_name, tbl_name) INTO dup_count;
           
            IF dup_count > 0 THEN
                RAISE NOTICE 'Table % has % duplicate rows', tbl_name, dup_count;
                total_duplicates := total_duplicates + dup_count;
            END IF;
        END IF;
    END LOOP;
   
    RAISE NOTICE 'Total duplicate rows found: %', total_duplicates;
END $$;
#40
These items are from standard template "Operating Systems/Windows".
this template create two metrics related to file system (FileSystem.FreePerc({instance}) and FileSystem.UsedPerc({instance})), both with enabled instance discovery.

More information on instance discovery: https://netxms.org/documentation/adminguide/data-collection.html#instance

Short summary: system query FileSystem.MountPoints from the agent to get all available mount points and create (or delete) new DCI for each instance. Since it's done in the context of the node, template column is set to the node itself.

In instance discovery, there is a filter, which can return true or false: create or ignore.
Default filter in the template add anything except CDFS.

There are multiple solutions, simplest is:
1) create new template, configure automatic apply, like in the original template
2) disable existing DCIs in the "Operating Systems/Windows" template. Status change is persisted even when we update system templates.
3) copy these DCIs to the new template and adjust instance discovery filter to your liking.



We plan to implement small changes to the scripting language which will allow creating hooks for standard templates, but for now you'll have to modify them.
#41
General Support / Re: v5.1.3 Android Client
August 17, 2025, 09:08:58 PM
It's fixed in upcoming 5.2.5
#42
SNMPv2-TC.mib is bundled.

UBNT-MIB is bundled as well, but we have older version -- and that's probably the reason.

I've renamed both from .txt to .mib and copied them to $NETXMS_HOME/share/netxms/mibs/, then nxmibc works just fine.

I'm pretty much sure upload via UI will work as well, once you'll update UBNT-MIB.mib. Future releases will include latest version, I've pushed this fix.
#43
General Support / Re: issues with netxms
August 07, 2025, 12:23:34 AM
Quote from: nichky on August 07, 2025, 12:21:44 AMdo we have that option , greate. Whenever you're ready - Thanks
contact [email protected]
#44
General Support / Re: issues with netxms
August 06, 2025, 07:50:15 PM
Yes, nothing I can add, tbh.

I've provided you with all the information and keywords, next step it only install it remotely for you.
#45
General Support / Re: issues with netxms
August 05, 2025, 02:32:37 PM
2025.08.05 21:08:49.200 *E* [db.lock            ] Database is already locked by another NetXMS server instance (IP address: 10.100.99.34, machine info: ON-NIKOLA Windows 8 Build 9200)

Another instance of netxmsd is running. Kill all of them, the run "nxdbmgr unlock", then "nxdbmgr check".

https://netxms.org/documentation/adminguide/appendix.html#database-manager