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 - Benjamin Dill

#31
Windows Server 2022 and PowerShell-7.4.4-win-x64.msi
#32
Sure, but the script does almost nothing.
Start-Transcript -Path "$($PSScriptRoot)\$(Split-Path $PSCommandPath -Leaf).log" | Out-Null
Start-Sleep -Seconds 15
Stop-Transcript | Out-Null

On the system is the most recent version of PowerShell installed, currently 7.4.4 (I'm not using Windows PowerShell).
https://github.com/PowerShell/PowerShell
#33
Yes, the problem still happens with one script (second ExternalMetricProvider removed).
No, the process pwsh.exe is not running after the script is finished in this test-setup. The PowerShell-file was empty before and I added 10 seconds of delay, but it does not change the behavior.
#34
I created a minimal test-setup and it still happens. It seems the agent crashes on stopping the Windows service.
#35

I recently upgraded to NetXMS 5.0.6 (from 4.5.6) and it seems there is a problem with "ExternalMetricProvider" on the agent: I'm calling a few PowerShell-scripts with different execution intervals. After restart of the agent service everything seems fine and the scripts are executed as expected, but on the second call it is behaving strange: PowerShell stops executing in the middle of the script and in the agent log I find that the external command is killed because of ExternalMetricProviderTimeout, but actually the PowerShell process is still running in the background. The external command is not exected again after that.
I downgraded the agent to 4.5.6 and it is working as expected again.

#36
General Support / Icon color in new console
March 18, 2024, 08:06:15 AM
Hi, the icons on the left navigation have a strange color on my systems. I tested it on two different computers and I'm pretty sure I did not make any special configuration.
I'm on Windows 11.
#37
It would be nice to have custom actions for the user agent which runs in every user session. Especially for terminal servers an option "Logoff user session" would be helpful but I can think of many others.
These custom actions could be called then on the "User Sessions" view using a new type of Object tool.
#38
Feature Requests / Node.js subagent
March 17, 2024, 10:11:26 PM
Recently I implemented a solution for monitoring various external APIs using oauth authentication with multiple different credentials (for different customers). This solution is implemented on a single NetXMS agent for data collection and customer nodes in NetXMS console can query their metrics using "source node" of the DCI with this single agent.

First I started implementing the solution using PowerShell scripts for ExternalMetric and ExternalTable. This implementation had several problems, the main issue was performance: Some metrics are requested every 30 seconds, for several hundred different parameter values. Calling the PowerShell runtime for every requested metric caused a huge load on the central agent's system. Also, some metrics / external APIs do not return their value immediently and need some time for response, which does not work very well for ExternalMetric.

So I consolidated some of the metrics and wrote scripts for ExternalMetricProvider which did improve the system load, but I still had no solution for ExternalTable as this do not have a provider option.

Finally I dropped everything I had and re-implemented the PowerShell scripts as JavaScript and started running all of them in a single Node.js instance. The system load dropped to an insignificant level as the gathering of the metrics and tables is not very CPU intensive and Node.js handles asychronous calls to external APIs very well. Also, the single Node.js process is running continously in contrast to frequently starting and terminating PowerShell runtime processes.
The collected metrics and tables are stored in a SQLite database. This way the NetXMS agent can query the metrics and tables using the built-in SQLite driver and the DBQUERY subagent which is also very lightweight and super-fast without any significant load on the CPU. This works a bit similar to Push parameters using the local cache.

All in all, everything is running pretty smoothly at the moment but is quite cumbersome to set up. This can be considered as an idea for a subagent which embeds scripting ability within the NetXMS agent using Node.js and extends the function of ExternalMetric, ExternalTable and ExternalMetricProvider.
#39
General Support / Re: Source node override with templates
November 08, 2023, 08:47:04 AM
Thank you, that's how we are doing it at the moment ;)
#40
General Support / Source node override with templates
November 07, 2023, 07:59:02 PM
Is it possible to assign the source node override of some DCI differently on nodes with the same template? I could not find anything about thr DCI's source node in NXSL.
I can imagine setting the DCI's origin to "Script" and query the DCI from a different node by script but maybe there is an easier way?
#41
Wow, thanks, that will work: These nodes are up for about 15 minutes. If I set the custom attribute to 10 minutes every node should get one poll per uptime  :)
#42
Following situation: We have nodes which are only a few minutes online every day, used for running a few scripts. These scripts are deployed by templates in NetXMS and are updated from time to time, but as these nodes are virtually never online for a configuration poll and updated files from the templates get never deployed.

Is there a way to trigger a configuration poll of these nodes by script, using one of the hooks? I studied the NXSL reference but I found nothing helpful.

Thank you!
#43
General Support / Re: nxaevent with object id
September 25, 2023, 03:06:37 PM
Thank you very much!
#44
General Support / nxaevent with object id
September 21, 2023, 12:29:50 AM
I'm trying to send events from one agent in behalf of some other nodes using the nxaevent.exe tool, specifying the node id by --object command line option.
Is this function is broken? I checked the servers source code and it seems that the node id within the message is never extracted and instead the node id of the tunnel is always used.
https://github.com/netxms/netxms/blob/8934498acae116f32ada3ecc439255dd75ae5fb9/src/server/core/agent.cpp#L94

Thanks in advance,
Ben
#45
Announcements / Re: NetXMS 4.4 patch release 1
August 31, 2023, 10:13:30 AM
I uninstalled the WebUI, removed all remaining files and did a reinstall, now it is working. Seems something wasn't updated properly.
Thanks for your help,
Ben