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 - twenrich

#1
General Support / Re: Restart Agent 3.9.334 on CentOS 7
November 16, 2021, 11:18:55 AM
ps fax returns
/3086 ?        Ssl   27:08 /opt/netxms/bin/nxagentd -d -c /etc/nxagentd.conf


On system startup, I use a script in /etc/rc.d/init.d/nxagentd (attached).
However, the restart usually worked with a few 2.2 versions and the same startup configuration.

With Agent 2.2.10, I get in the log
2021.11.16 10:08:19.108 *D* RestartAgent() called
2021.11.16 10:08:19.108 *D* Restarting agent with command line '"/opt/netxms/bin/nxagentd" -c "/etc/nxagentd.conf" -d -D 1 -G CORE -X 29246'
2021.11.16 10:08:19.112 *D* Trap sender thread terminated
2021.11.16 10:08:20.113 *D* Session Watchdog thread terminated
2021.11.16 10:08:20.113 *D* Listener thread terminated
2021.11.16 10:08:20.114 *D* [threads.pool       ] Thread pool COMM destroyed
2021.11.16 10:08:20.592 *I* NetXMS Agent stopped

2021.11.16 10:08:21.116 Log file opened (rotation policy 2, max size 4194304)
2021.11.16 10:08:21.116 *D* Log rotation policy set to 2 (size=16777216, count=4)
2021.11.16 10:08:21.116 *I* Core agent version 2.2.10
2021.11.16 10:08:21.116 *I* Additional configs was loaded from /etc/nxagentd.conf.d
2021.11.16 10:08:21.116 *I* Debug level set to 1
2021.11.16 10:08:21.117 *I* Data directory: /opt/netxms/var/lib/netxms
2021.11.16 10:08:21.117 *I* File store: /opt/var/nxagentd


With Agent 3.9.334 (installed with package manager from the NPI on the NetXMS Download page), on the same machine, I get in the logs
2021.11.16 10:11:33.315 *D* [                   ] RestartAgent() called
2021.11.16 10:11:33.316 *D* [                   ] Restarting agent with command line '"/opt/netxms/bin/nxagentd" -c "/etc/nxagentd.conf" -p "/var/run/nxagentd.pid" -G CORE -d -X 2641'
2021.11.16 10:11:33.375 *D* [dc                 ] Data reconciliation thread stopped
2021.11.16 10:11:33.376 *D* [threads.pool       ] Thread pool DATACOLL destroyed
2021.11.16 10:11:33.376 *D* [dc                 ] Data collection scheduler thread stopped
2021.11.16 10:11:33.376 *D* [dc                 ] Data sender thread stopped
2021.11.16 10:11:33.377 *D* [dc                 ] Database writer thread stopped
2021.11.16 10:11:34.377 *D* [                   ] Session Watchdog thread terminated
2021.11.16 10:11:34.377 *D* [                   ] Listener thread terminated
2021.11.16 10:11:34.377 *D* [notifications      ] Notification processor stopped
2021.11.16 10:11:34.378 *D* [threads.pool       ] Thread pool COMM destroyed
2021.11.16 10:11:34.378 *D* [threads.pool       ] Thread pool WEBSVC destroyed
2021.11.16 10:11:34.378 *D* [threads.pool       ] Thread pool PROCEXEC destroyed
2021.11.16 10:11:34.703 *I* [                   ] NetXMS Agent stopped


Regards,
Thomas
#2
General Support / Restart Agent 3.9.334 on CentOS 7
November 15, 2021, 12:53:15 PM
During the last days, I upgraded our 2.2.12 NetXMS to 3.9.334 (mostly painless).
I also upgraded the agents on most of our servers (with the exception of some CentOS6 machines).

However, I was used to restart the agent from the console (Node=>Tools=>Restart agent).
With the 3.9 agent, this works only on the Windows servers.

On CentOS7, this stops the agent (and requires manual restart on the target machine).

Do I miss some configuration option ?

Regards,

Thomas
#3
This is solved by now.

nxmc worked again after we uninstalled & reinstalled nxmc (maybe the machine got restarted between, before or after these steps).
#4
General Support / Windows Console nxmc.exe not starting
February 06, 2019, 05:18:41 PM
Hi,

on one of out workstations nxmc refuses to start.
We are not aware of any changes to this specific system (the console runs fine on other similar Windows installations).

This is an installation including the Java Runtime.

We tried
- nxmc.exe -clean
- reinstalling console (including the embedded JRE)
- rebooting the system (several times)

Do you have any hints in this regard ?

Please find below an excerpt from the logfiles (complete logs are attached).

Thank you very much,

Thomas


!SESSION 2019-02-06 12:00:24.329 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_144
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data @user.home/.nxmc/data

!ENTRY org.eclipse.osgi 4 0 2019-02-06 12:00:27.036
!MESSAGE An error occurred while automatically activating bundle org.netxms.ui.eclipse.console (296).
!STACK 0
org.osgi.framework.BundleException: Exception in org.netxms.ui.eclipse.console.Activator.start() of bundle org.netxms.ui.eclipse.console.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
...
Caused by: java.lang.UnsatisfiedLinkError: org.eclipse.swt.internal.C.PTR_sizeof()I
at org.eclipse.swt.internal.C.PTR_sizeof(Native Method)
at org.eclipse.swt.internal.C.<clinit>(C.java:24)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:227)
....
Root exception:
java.lang.UnsatisfiedLinkError: org.eclipse.swt.internal.C.PTR_sizeof()I
at org.eclipse.swt.internal.C.PTR_sizeof(Native Method)
at org.eclipse.swt.internal.C.<clinit>(C.java:24)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:227)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:205)
at org.netxms.ui.eclipse.console.resources.SharedIcons.init(SharedIcons.java:152)
at org.netxms.ui.eclipse.console.Activator.start(Activator.java:61)
....
#5
Dear all,

this was simply not true.

The node we assumed we had deleted was still visible in "Entire Network" and therefore not deleted.

Really deleting the node removed also the alarms (on-screen and in the summary mail).

Kind regards,
Thomas
#6
Hi all,

we just found is a small inconsistency in the "Alarm summary" email, where we find a "Node Down" event for a node we deleted a few days ago.
The alarm is not visible in the F8 Alarm browser.
This might be related to an update (we updated from 2.1 to 2.10 around time when the node was removed).

Both Config entries "DeleteAlarmsOfDeletedObject" and "DeleteEventsOfDeletedObject" are set to 1 (default).

I will apply https://wiki.netxms.org/wiki/Reseting_state_of_all_alarms_and_node_statuses to resolve the issue.

Kind regards,
Thomas
#7
I use a script for instance discovery and a filter script to remove unwanted services.
Additional, custom attributes allow to include and exclude services per node.

Please see the attached image for usage in the template DCI.

Kind regards,
Thomas


Script windows_auto_services:

col_startup = 4;
array a;

table = AgentReadTable($node, "System.Services");
if (table == null)
{
    println "ERROR: Cannot read table from agent";
    return;
}

index = 0;
for (i=0; i<table->rowCount; i++)
    {
    startup = table->get(i, col_startup);
    if (startup == "Auto")
        {
        a[index++] = table->get(i, 0);
        println table->get(i, 0);
        }
    }

// trace(1, "discover_auto_services: return 0");

return a;


Script filter_windows_services:

sub filter_windows_service(svc)
{
attr = GetCustomAttribute($node, "SERVICE_EXCLUDE");
if (attr != null && inList(attr, ",", svc))
{
trace(1, $node->name . ": Service " . svc . " excluded by attribute SERVICE_EXCLUDE");
return false;
}
attr = GetCustomAttribute($node, "SERVICE_INCLUDE");
if (attr != null && inList(attr, ",", svc))
return true;

return
   (svc != "TBS")
&& (svc != "KtmRm")
&& (svc != "iphlpsvc")
&& (svc != "sppsvc")
&& (svc != "ShellHWDetection")
&& (svc != "ccmsetup")
&& (svc != "SysmonLog")
&& (!(svc ~= "^clr_optimization_.*") )
&& svc != "spupdsvc"
&& svc != "RDSessMgr"
&& svc != "DPS"
&& svc != "FontCache"
&& svc != "MSDTC"
&& svc != "WinRM"
&& svc != "gupdate"
&& svc != "wscsvc"
&& svc != "VSS"
&& svc != "wuauserv"
&& svc != "TrustedInstaller"
&& svc != "BackupExecAgentAccelerator"
&& svc != "CcmExec"
;
}
#8
Hi,

I'm currently trying to get an external parameter on a Windows host working.
NetXMS Version as well as the Agent version is 2.1.

The Agent Policy

ExternalParameter=Ext.grep_count(*):powershell.exe -command "Select-String -Path \"$1\" -Pattern \"$2\" | Measure-Object | Foreach-Object { echo $_.Count }"

gets called, but reports "_.Count" as value of the Parameter.

I assume that the "$_.Count" gets replaced by NetXMS somewhere by "_.Count", so the echo returns this string only.

Is there a way to escape "$" in the Agent Policy ? I already tried to "\$_.Count" (returning \.Count as value).

Kind regards,

Thomas
PS: as the External parameter is called, I think you can cancel https://track.radensolutions.com/issue/NX-1233
#9
Quote
Are you using UNICODE version of netxmsd (you can check by running netxmsd -v)?


NetXMS Server Version 2.1 Build 9012 (2.1-RELEASE) (UNICODE)
NXCP: 4.48.1.11 (AES-256, Blowfish-256, IDEA, 3DES, AES-128, Blowfish-128)
Built with: g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)


Kind regards,
Thomas
#10
Hi,

installing a policy containing german Umlauts might truncate my policy file.

I just added a comment like below:
Query = Query.smv01.Sync.CountExpQError:smv01:3600:SELECT count(*) FROM AKMSync.dbo.expandedqueue with (nolock) WHERE status = 'ERROR'
Query = Query.smv01.Sync.CountSyncQError:smv01:3600:SELECT count(*) FROM AKMSync.dbo.synchronizationqueue with (nolock) WHERE status = 'ERROR'

# Überwachung Backups

Query = Query.TEST_Folio01.Backup.CountNoFull:test_folio01:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.database_name = db.name AND bck.backup_finish_date > dateadd(DAY, -8, current_timestamp) AND bck.type = 'D')
Query = Query.TEST_Folio02.Backup.CountNoFull:test_folio02:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.database_name = db.name AND bck.backup_finish_date > dateadd(DAY, -8, current_timestamp) AND bck.type = 'D')
Query = Query.Folio01.Backup.CountNoFull:prod_folio01:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.database_name = db.name AND bck.backup_finish_date > dateadd(DAY, -8, current_timestamp) AND bck.type = 'D')
Query = Query.Folio02.Backup.CountNoFull:prod_folio02:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.database_name = db.name AND bck.backup_finish_date > dateadd(DAY, -8, current_timestamp) AND bck.type = 'D')
# Query = Query.TEST_Folio02.Backup.CountNoFull:test_folio02:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.database_name = db.name AND bck.backup_finish_date > dateadd(DAY, -8, current_timestamp) AND bck.type = 'D')
# Query = Query.TEST_Folio02.Backup.CountNoFull:test_folio02:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.database_name = db.name AND bck.backup_finish_date > dateadd(DAY, -8, current_timestamp) AND bck.type = 'D')
# Query = Query.TEST_Folio02.Backup.CountNoFull:test_folio02:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.database_name = db.name AND bck.backup_finish_date > dateadd(DAY, -8, current_timestamp) AND bck.type = 'D')


The resulting file in /usr/local/var/lib/netxms/config_ap looks like

...
Query = Query.smv01.Sync.CountSyncQError:smv01:3600:SELECT count(*) FROM AKMSync.dbo.synchronizationqueue with (nolock) WHERE status = 'ERROR'

# berwachung Backups

Query = Query.TEST_Folio01.Backup.CountNoFull:test_folio01:3600:SELECT count(*) FROM sys.sysdatabases db WHERE db.name != 'tempdb' AND not exists(SELECT 1 FROM msdb.dbo.backupset bck WHERE bck.dat


Removing the Umlaut in the comment transfers the entire file.

Kind regards,
Thomas
#11
Announcements / Re: NetXMS 2.1 released
July 25, 2017, 08:09:52 PM
Quote from: Dani@M3T on July 08, 2017, 11:58:33 AM
'Deploy to managed nodes' from the NetXMS console to Windows nodes always reports back FAILED "Agent's version doesn't match package version after upgrade". A configuration poll shows the new agent is installed anyway. So maybe a check error.

I got this message from the centralized deployment on some Linux hosts.

The binary package+NPI ("nxagent-2.1-linux-x86_64") I downloaded today reports after installation a version "2.1-RELEASE", whereas the version in the NPI is "2.1". I got a correct installation on all the hosts after editing the NPI, so it knows we are installing "2.1-RELEASE".

Thanks for the new release.

Kind regards,
Thomas
#12
Hi,

I found this out:

In the template, the "Source Node" is set.
Within the scripts, $node is set to the "Source Node", not to the node where the actual instance discovery happens (see screenshot).
When trying the scripts using "Execute Server Script", $node is the "Discovery Node" and everything is fine.

This is OK, I think, as most of the discovery will be done on the "Source Node" (and it's agent) anyway.

Is there an easy way to get the "discovery" node into the scripts so I have access to the custom attributes of the discovery node ?

I want to create some checks on behalf node A and running on node B, controlled by node A's custom attributes.


Thank you very much,

Thomas





#13
Hi,

I'm using some agent policies to add a bunch of external Parameters for Windows and Linux hosts.

This works well on Linux - policy files get saved in /usr/local/var/lib/netxms/config_ap/, Parameters become visible after Agent restart and Config poll.

On Windows, the policy files appear in C:\Windows\System32\config\systemprofile\AppData\Local\nxagentd\config_ap\, but the Parameters contained here do not show up after restart/config poll.
However, adding the very same Parameters to nxagentd.conf works as expected.

Setting FileStore in nxagentd.conf has no effect.

Agent was installed using the nxagent-2.1-M2-x64.exe file.

Is this a bug or do I miss something ?

Kind regards,
Thomas

#14
insert a line below the "# start daemon" comment:
    sleep 300 # wait 5 minutes


You might want to read a little about shell programming ....

Kind regards,
Thomas
#15
kiki,

obviously the DB startup lasts a little longer than usual when recovering from the unclean shutdown.

I would try to sleep() for a minute or two in the netxmsd startup file (maybe in /etc/init.d/netxmsd).

Kind regards,
Thomas