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

#856
Yes, persistent storage (or custom attribute on a node) that holds timestamp of last SYS_NODE_DOWN would be best solution.

Best regards,
Victor
#857
Hi,

could be database issue or time zone issue. In database you should have table idata_nnn, where nnn is actual node object ID. Check if you have any records in that table. If yes, check that time on your server is correct and that time zone is correct as well. Internally server and client uses UTC timestamps, so even when time looks identical it may in fact be incorrect on one side when concerted to UTC. If there are no records in idata table then likely there is issue with storing data to database - in that case check server log for SQL errors.

Best regards,
Victor
#858
Hi,

looks like reading from DB take very long time - which is quite strange if you have only 15 nodes. Please set server debug level to 6, repeat the problem, and provide server log file for that time.

Best regards,
Victor
#859
General Support / Re: Migrating fails
July 22, 2020, 12:34:36 PM
Hi,

looks like wrong primary key was set during PostgreSQL DB init. What NetXMS version you are using?

Best regards,
Victor
#860
General Support / Re: Network map - device names
July 22, 2020, 12:32:16 PM
Hi,

names on maps are the same as object names. You cannot have separate "map" name. However, you can rename your nodes automatically to include location information using configuration poll hook. For example, you can have hook script as this:


if (($node->snmpSysLocation != "") and not ($node->name like "*" . $node->snmpSysLocation))
   $node->rename($node->name . " " . $node->snmpSysLocation);


This script checks that node name is not already ended with location string and it is not empty, and then appends location string to node name. You may need to introduce more sophisticated logic if sysLocation can change over time and you'll need to replace old location with new one and not simply append new location.

Best regards,
Victor
#861
Hi,

upgrade to version 3.3 or 3.4, it will renew expiring certificates automatically before expiration date.

Best regards,
Victor
#862
General / Re: PostgreSQL subagent
July 16, 2020, 11:50:44 AM
Now it makes sense :) I think PostgreSQL.Replication.WALSenders will be the best name then.

Best regards,
Victor
#863
Hi,

it looks like we setup hypertables in a wrong way, adding unnecessary space partitioning. This causes hypertable to have lots of chunks, so queries like SELECT max(event_id)  ... took lot of time, because each chunk should be queried. For net major release we already implemented conversion of log tables structure. You can wait for it (likely release time is September) or you can try to convert your event_log and alarms tables manually using the following queries:


ALTER TABLE alarms RENAME TO old_alarms;
CREATE TABLE alarms (
   alarm_id integer not null,
   parent_alarm_id integer not null,
   alarm_state integer not null,
   hd_state integer not null,
   hd_ref varchar(63) null,
   creation_time integer not null,
   last_change_time integer not null,
   rule_guid varchar(36) null,
   source_object_id integer not null,
   zone_uin integer not null,
   source_event_code integer not null,
   source_event_id bigint not null,
   dci_id integer not null,
   message varchar(2000) null,
   original_severity integer not null,
   current_severity integer not null,
   repeat_count integer not null,
   alarm_key varchar(255) null,
   ack_by integer not null,
   resolved_by integer not null,
   term_by integer not null,
   timeout integer not null,
   timeout_event integer not null,
   ack_timeout integer not null,
   alarm_category_ids varchar(255) null,
   event_tags varchar(2000) null,
   rca_script_name varchar(255) null,
   impact varchar(1000) null,
   PRIMARY KEY(alarm_id));
CREATE INDEX idx_alarms_source_object_id ON alarms(source_object_id);
CREATE INDEX idx_alarms_last_change_time ON alarms(last_change_time);
INSERT INTO alarms (alarm_id,parent_alarm_id,alarm_state,hd_state,hd_ref,creation_time,last_change_time,rule_guid,source_object_id,zone_uin,source_event_code,source_event_id,dci_id,message,original_severity,current_severity,repeat_count,alarm_key,ack_by,resolved_by,term_by,timeout,timeout_event,ack_timeout,alarm_category_ids,event_tags,rca_script_name,impact) SELECT alarm_id,parent_alarm_id,alarm_state,hd_state,hd_ref,creation_time,last_change_time,rule_guid,source_object_id,zone_uin,source_event_code,source_event_id,dci_id,message,original_severity,current_severity,repeat_count,alarm_key,ack_by,resolved_by,term_by,timeout,timeout_event,ack_timeout,alarm_category_ids,event_tags,rca_script_name,impact FROM old_alarms;
DROP TABLE old_alarms CASCADE;

ALTER TABLE event_log RENAME TO old_event_log;
DROP INDEX IF EXISTS idx_event_log_event_timestamp;
DROP INDEX IF EXISTS idx_event_log_source;
DROP INDEX IF EXISTS idx_event_log_root_id;
CREATE TABLE event_log (
   event_id bigint not null,
   event_code integer not null,
   event_timestamp integer not null,
   origin integer not null,
   origin_timestamp integer not null,
   event_source integer not null,
   zone_uin integer not null,
   dci_id integer not null,
   event_severity integer not null,
   event_message varchar(2000) null,
   event_tags varchar(2000) null,
   root_event_id bigint not null,
   raw_data text null,
   PRIMARY KEY(event_id,event_timestamp));
CREATE INDEX idx_event_log_event_timestamp ON event_log(event_timestamp);
CREATE INDEX idx_event_log_source ON event_log(event_source);
CREATE INDEX idx_event_log_root_id ON event_log(root_event_id) WHERE root_event_id > 0;
SELECT create_hypertable('event_log', 'event_timestamp', chunk_time_interval => 86400);
INSERT INTO event_log (event_id,event_code,event_timestamp,origin,origin_timestamp,event_source,zone_uin,dci_id,event_severity,event_message,event_tags,root_event_id,raw_data) SELECT event_id,event_code,event_timestamp,origin,origin_timestamp,event_source,zone_uin,dci_id,event_severity,event_message,event_tags,root_event_id,raw_data FROM old_event_log;
DROP TABLE old_event_log CASCADE;


Please note that data copy could take significant time. If you are not intended to keep existing event log you can just drop event_log table and create new one.

Don't forget to make database snapshot or backup before trying this!

Best regards,
Victor
#864
Hi,

there is an option in alarm section of EPP rule - "create helpdesk ticket". If checked it will create ticket automatically when alarm is created.

Best regards,
Victor
#865
General Support / Re: libnetxms.so.34
July 15, 2020, 06:19:01 PM
Hi,

all binaries installed from packages should be in /usr/bin. You can delete any leftovers from /usr/local/bin, or just do not run them.

Server package should install systemd unit. Check it's status with


systemctl status netxmsd


You may need to manually enable it with


systemctl enable netxmsd


If it is enabled but not started, check server log for possible errors.

Best regards,
Victor
#866
General / Re: PostgreSQL subagent
July 15, 2020, 06:16:31 PM
Should it be "WAL receivers" or "WAL sending targets" then - as those servers receive data from current server, not send data to it?
#867
General / Re: PostgreSQL subagent
July 14, 2020, 03:56:20 PM
Added it. Now I have a question regarding these lines:

"SELECT count(*) stanby FROM pg_catalog.pg_stat_replication

{ _T("PostgreSQL.Replication.Stanby(*)"), H_GlobalParameter, _T("REPLICATION/stanby"), DCI_DT_INT64, _T("PostgreSQL/Replication: WAL senders") },

shouldn't it be "standby"? Or even "PostgreSQL.Replication.WALSenders"?

I don't know meaning of this parameter, question is based purely on name and description difference :)

Best regards,
Victor
#868
General / Re: PostgreSQL subagent
July 14, 2020, 02:49:23 PM
It is 9.5.13. I will retest it on 9.6. I'm not sure about support for 9.5 - formally it is supported until 2021, but I don't know how widely it is used.

Best regards,
Victor
#869
Hi,

you can define action in agent configuration file on that machine:


ActionShellExec = RestartService:net stop svcname && net start svcname


(I'm not sure if command is actually correct, but you should get an idea).

then define server side action of type "execute command on remote node", enter RestartService as command name, and add this new action in EPP to be executed on web service error event.

Best regards,
Victor
#870
General Support / Re: libnetxms.so.34
July 14, 2020, 02:39:02 PM
Hi,

looks like nxdbmgr is older than libraries. Also I see that you start it as /usr/local/bin/nxdbmgr which looks like compiled from sources, but libnetxms is in /lib/x86_64-linux-gnu which is usual for installed from deb packages. Are you sure you didn't mix compiled binaries/libraries with installed from packages?

Best regards,
Victor