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

#211
General Support / Re: cant get powershell script to run
January 14, 2020, 07:52:15 PM
Debug 7 gave one extra line:
2020.01.14 19:49:10.356 *D* [                   ] ProcessExecutor::execute(): process "CMD.EXE /C powershell.exe C:\NetXMS\script\test.ps1" started
2020.01.14 19:49:10.356 *D* [                   ] ParamProvider::poll(): started command "powershell.exe C:\NetXMS\script\test.ps1"
2020.01.14 19:49:10.357 *I* [                   ] NetXMS Agent started
2020.01.14 19:49:15.569 *D* [                   ] ProcessExecutor::readOutput(): stopped on GetOverlappedResult (The pipe has been ended.)
2020.01.14 19:49:15.569 *D* [                   ] ParamProvider::poll(): command "powershell.exe C:\NetXMS\script\test.ps1" execution completed, 0 values read
#212
General Support / Re: cant get powershell script to run
January 14, 2020, 09:45:19 AM
Thanks for suggestion, i tested that config parameter but no joy. I think it must be somthing else, because according to logs, script dont even have time to run 30s before '0 value' is returned according to netxms agent.

From agent log:
2020.01.14 09:33:34.573 *I* [                   ] NetXMS Agent started
2020.01.14 09:33:34.575 *D* [                   ] ProcessExecutor::execute(): process "CMD.EXE /C powershell.exe C:\NetXMS\script\test.ps1" started
2020.01.14 09:33:34.575 *D* [                   ] ParamProvider::poll(): started command "powershell.exe C:\NetXMS\script\test.ps1"
2020.01.14 09:33:39.852 *D* [                   ] ParamProvider::poll(): command "powershell.exe C:\NetXMS\script\test.ps1" execution completed, 0 values read


Agent conf file:
#
# NetXMS agent configuration file
# Created by agent installer at Wed Sep  4 14:38:01 2019
#

MasterServers = ip
ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
LogFile = C:\NetXMS\log\netxms-agent.log
FileStore = C:\NetXMS\var
SubAgent = winperf.nsm
SubAgent = filemgr.nsm
DebugLevel = 5
ExternalParameterProviderTimeout = 60

ExternalParametersProvider=powershell.exe C:\NetXMS\script\test.ps1:300


Script after updating PowerShell to ver 4:
$folder = Get-ChildItem 'D:\a8becad8-6be2-4164-a405-dea4052b3720' -Directory |
    Sort LastWriteTime |
    Select -First 1

$age = ([datetime]::Now - $folder.LastWriteTime).TotalHours
#$age = ([datetime]::Now - $folder.LastWriteTime).Days


if($age -ige 1)
{

    $Output = 'Parameter1=' + $age

}else{

    $Output = 'Parameter1=1'

}

echo $Output


When i change path variable in script to count smaller folder where result will be instant, instead of few seconds then agent gets the value.

Even updated to latest version today.
#213
General Support / Re: cant get powershell script to run
January 13, 2020, 02:38:28 PM
Bump, Any suggestions what could be the issue here ? :)

#214
At the moment it seems "stable" with 2 identical nodes, even after restart, but it would still be nice to have only one. :)

Node A Overview: 
Node A Interfaces: 

---

Node B Overview: 
Node B Interfaces: 
#215
General Support / Re: cant get powershell script to run
January 12, 2020, 07:24:57 PM
Attempt #2

This time i tryed with ExternalParametersProvider:

Agent Conf

MasterServers = ip
ExecTimeout = 10000
ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
LogFile = C:\NetXMS\log\netxms-agent.log
FileStore = C:\NetXMS\var
SubAgent = winperf.nsm
SubAgent = filemgr.nsm
DebugLevel = 5

ExternalParametersProvider=powershell.exe C:\NetXMS\script\test2.ps1:60


Script: Get-ChildItem 'D:\test\609920fa-6243-4587-b33c-b73961130e04' | Where { $_.PSIsContainer } | Sort LastWriteTime | Select -First 1 | Foreach-Object {$age = (New-TimeSpan ($_.LastWriteTime) $(Get-Date)); $out = 'Parameter1=' + $age.days; echo $out}

Agent Debug log:2020.01.12 19:17:10.703 *D* [                   ] ProcessExecutor::execute(): process "CMD.EXE /C powershell.exe C:\NetXMS\script\test2.ps1" started
2020.01.12 19:17:10.703 *D* [                   ] ParamProvider::poll(): started command "powershell.exe C:\NetXMS\script\test2.ps1"
2020.01.12 19:17:22.825 *D* [                   ] ParamProvider::poll(): command "powershell.exe C:\NetXMS\script\test2.ps1" execution completed, 0 values read


When i run command manualy i get response Parameter1=114
CMD.EXE /C powershell.exe C:\NetXMS\script\test2.ps1

Why doesent netxms get that value ?

EDIT: when testing with smaller ammount of files it does return a value. When testing folder with ~82000 sub folders where script runs about ~6 seconds then agent gets result 0, manualy running script works ? Any fix for that ?

#216
General Support / cant get powershell script to run
January 11, 2020, 07:55:38 PM
Hello

i made a small powershell query to return oldest folder age in days. But i cant get it to run with netxms agent, i get error:
Process "powershell -Command "& SCRIPT"" killed because of execution timeout


Agent conf file:
MasterServers = ip
ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
LogFile = C:\NetXMS\log\netxms-agent.log
FileStore = C:\NetXMS\var
SubAgent = winperf.nsm

ExternalParameter = Custom.Script:powershell -Command "& {Get-ChildItem 'path' | Where { $_.PSIsContainer } | Sort CreationTime | Select -First 1 | Foreach-Object {$dtdiff = (New-TimeSpan ($_.LastWriteTime) $(Get-Date))}; write-host $dtdiff.days}"

#217
Hello

For some reason NetXms keeps discoverying and adding one specific node over and over. Node itself is Ubiquiti gen 2 nanobeam and not only one, i have multiple of them and it happens only with one node. So far i have tried to delete all instances of that ip but that did not help. All nodes will get auto added under same /24 network, only difference is id.

#218
General Support / Re: Netxms Agent - get oldest folder
January 09, 2020, 08:29:22 AM
Got that part working. Any suggestions for template use case when i have different servers with different age value ? Or do i need to create them all manualy ?

Most simplest thing would be to get just 1 folder thats also the oldes one and return its age, then it could be compared in threshhold with %{customAttribute:50}
#219
General Support / Netxms Agent - get oldest folder
January 08, 2020, 01:56:36 PM
How can i use NetXms agent "File.FolderCount" to get folders that are older than x ammount of time ? Is it possbile to specify time with "%{customAttribute:50}"? If not is it possbile to just get the date of oldest folder and then use "%{customAttribute:50}" in threshold ?

#220
Thanks for the info. :)

#221
Hello

When using node custom attribute in threshold value i get wrong warning message.

Example:

Threshold value: %{dci-CpuTemperature:60}
dci-CpuTemperature = 61
event template message: High %2! Current: %4, Allowed: %3

Warning message: High Cpu Temperature! Current: 61, Allowed: %{dci-CpuTemperature:60}

How could i display proper value after "Allowed:" ?

#222
Thanks that seems to be the solution. Usualy monitoring softwares show caps in data when polling was unavailable, not delete entire history. With costum instance retension set to same as data retention time it does exactly this.
#223
Hello

I am having litle bit of trouble with template monitoring. With template auto apply rule device is added to template, for example wireless ap. Inside template there are few dcis, some for ap itself, some for ap clients. Problem is when some client disconnects its dci wil turn into unsupported and is automaticaly removad and once it connects again new dci is auto generated. That effectivly deletes all collected history and fills alarm windows with "status of dci xxx changed to unsupported". How could it be awoided, once dicovered keep it until user deletes?

#224
General Support / Few questions about syslog
November 23, 2019, 10:58:21 PM
Hello

How well does NetXms handle large amount of syslog messages (~5GB per month, retention ~90 days)? Database in use is MS Sql server. Currently i am collecting them with splunk but curiose if netxms could handle it.

Is it possible to save pre defined searches for later use ?

How would one search for some key words from syslog (using text field). Example log:

23.11.2019 22:41:23 Juniper Default 1 6 Juniper 1 1 2019-11-23T22:41:23.389+02:00 SRX1 RT_FLOW - RT_FLOW_SESSION_DENY [[email protected] source-address="192.168.1.2" source-port="50295" destination-address="8.8.8.8" destination-port="53" connection-tag="0" service-name="junos-dns-udp" protocol-id="17" icmp-type="0" policy-name="default-deny(global)" source-zone-name="Vlan-2" destination-zone-name="Internet" application="UNKNOWN" nested-application="UNKNOWN" username="N/A" roles="N/A" packet-incoming-interface="ge-2/0/1.2" encrypted="UNKNOWN" reason="policy deny"]
#225
General Support / Re: Node placed under wrong subnet
November 07, 2019, 01:26:02 PM
Found out what made the subnets, unders each 10.0.0.0/8 there is 1 juniper srx router with em0.0 interface and netxms discovers networks 10.0.0.1/8, 10.0.0.4/28, 128.0.0.1/2 and ipv6 address. None of those addresses are configured by me (they dont exist in configuration). Would it be possible to ignore auto creating of such large networks? Or what could be fix for that ?