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

Topics - AP_ops

#1
General Support / Maintenance column in db after upgrade
November 15, 2018, 03:36:16 PM
Hello,

Last week i did an upgrade to version 2.2.10

We used to had a daily report through a db query that we check for systems that are in maintenance mode.

the query is this one:

USE netxms_db

DECLARE @OBJECT_ID INT, @NAME VARCHAR(63), @ITEM_ID INT, @DESCRIPTION VARCHAR(255)
SET @OBJECT_ID = 0
SET @ITEM_ID = 0

DECLARE @UNMANAGED_SYSTEMS TABLE(
    System VARCHAR(63)
)

WHILE (1 = 1)
BEGIN 

    SELECT TOP 1 @OBJECT_ID = object_id
    ,@NAME = name
    FROM netXMS.object_properties
    WHERE object_id > @OBJECT_ID AND maint_mode=1
    ORDER BY object_id

/* Exit loop if no more entries */
IF @@ROWCOUNT = 0 BREAK;

INSERT INTO @UNMANAGED_SYSTEMS SELECT @NAME AS System FROM [netxms_db].[netxms].[items] WHERE node_id = @OBJECT_ID

END

SELECT * FROM @UNMANAGED_SYSTEMS GROUP BY System ORDER BY System ASC


After the upgrade the query is not working. I see some changes in the names but i cannot find a value for the maint_mode.
Have you move it to different table?

thanks
#2
Hi

I'm struggeling to get the Action Configuration "execute command on management server" working as it should. I'd like to have the %m Message forwarded as a String to my script. What happens is that only the first word gets forwarded.

My command:
powershell C:\\NetXMS\\send_sms.ps1 \-recipients "00417xxxxxxxx" \-msg %m

if i use "%m" nothing works also if i use single quotes. But if I use ' [%[get_first_parent]][%n] [%S]: [%[get_event_name]] ' it gets forwarded..

The same behavior was discussed in the topic in 2011 but not solved:
https://www.netxms.org/forum/configuration/parameters-with-spaces-on-execute-command-on-management-server/

Where is my mistake?

Thanks for your help!

#3
General Support / Advanced Schedule
April 10, 2013, 11:58:40 AM
Hello,

I want to configure a custom file.count schedule (to check a specific folder daily between 7:00 AM to 1:00 AM  every 5 minutes) and i want this folder to be empty (0 files) between the specific period and if i have file to trigger an alarm (only between this period).

So i tried several combinations and it doesn`t work.
Here is my examples that i tried

1st.
*/5 7-1 * * * *

it doesn`t work

2nd. (combination of 2 schedules)
* 7-1 * * * *
*/5 * * * * *

it works every 5 minutes but i get an alert all the time

3rd. (combination of 3 schedules)
* 7-0 * * * *
* 0-1 * * * *
*/5 * * * * *

it works every 5 minutes but i get an alert all the time


Can you please someone advice/help me with the correct schedule that i have to specify?

Thanks in advance

Regards,
Andreas
#4
Hi

I recognized that the length of ExternalParametersProvider values have to be less or equal the default width of cmd.exe because the line wraps and your value can be cut off in the end.
this is not much of an issue, you can simply change the default console width of cmd.exe, but maybe you find a better solution to it. In larger environments it could b a pain if you, for whatever reason, need to have a larger return value.

regards
#5
Hi

We recognized, that the default Parameters that come with the NetXMS Agent have a certain Data Type and Description which makes it easy to create to DCIs.
When using Values from a ExternalParametersProvider you always have to check both but they are always the same.
maybe you could add this information to the return value
before:
ParameterName=Value
after:
ParameterName:DataType:Description=Value

what do you think?

regards
#6
Hi

Windows Batch Scripts executed by the ExternalParametersProvider seem to have issues when they execute other applications. In Powershell Scripts only xcopy.exe doesn't work.
We are using Windows 2008 R2 as Server and Agent.
NetXMS Server and Agent is on 1.2.4

in cmd.exe scripts it seems like it stops executing after the first exe-application was started. this only happens when run by NetXMS Agent, when run manually in cmd.exe it always runs through

@echo off
echo ---- MARK >> d:\log_files\netxms_rpc_debug_cmd.log 2>&1
c:\WINDOWS\System32\ping.exe localhost -n 1 >> d:\log_files\netxms_rpc_debug_cmd.log 2>&1
c:\WINDOWS\System32\findstr.exe csax d:\csaxtext?.txt >> d:\log_files\netxms_rpc_debug_cmd.log 2>&1
c:\WINDOWS\System32\robocopy.exe d:\ c:\ csaxtext3.txt /NJH /NP >> d:\log_files\netxms_rpc_debug_cmd.log 2>&1
c:\WINDOWS\System32\xcopy.exe d:\csaxtext3.txt c:\ /Y >> d:\log_files\netxms_rpc_debug_cmd.log 2>&1
echo DEBUG_CMD=SOMEVALUE >> d:\log_files\netxms_rpc_debug_cmd.log 2>&1

when you change order of commands, the first one is executed with proper output, the rest is not.
interestingly, xcopy does not work at all, no output, no copy but still stops execution
the output of the above script is:
Quote
---- MARK 

Pinging localhost [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

in powershell all but xcopy work. xcopy won't stop the execution of the hole script but it doesn't do anything and does not show any output. If run manually, it works as expected.
"---- MARK" | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\ping.exe localhost -n 1 | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\xcopy.exe d:\csaxtext3.txt c:\ /Y | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\findstr.exe csax d:\csaxtext?.txt | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\robocopy.exe d:\ c:\ csaxtext3.txt /NJH /NP | ac d:\log_files\netxms_rpc_debug_ps.log
"DEBUG_PS=SOMEVALUE"| ac d:\log_files\netxms_rpc_debug_ps.log


output
Quote---- MARK

Pinging app01.intra.arcplace.ch [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
d:\csaxtext3.txt:csax-test

                      1   d:\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         1         0         1         0         0         0
   Bytes :        11         0        11         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

   Ended : Wed Nov 14 15:58:30 2012
DEBUG_PS=SOMEVALUE

Agent Config:

LogFile = D:\log_files\netxms_agent.log
DebugLevel = 9
FileStore = C:\NetXMS\var
SubAgent = ecs.nsm
SubAgent = ping.nsm
SubAgent = logwatch.nsm
SubAgent = portcheck.nsm
SubAgent = winperf.nsm
SubAgent = wmi.nsm
ExternalParametersProvider=powershell.exe d:\cmd_files\netxms_rpc_debug.ps1:5
ExternalParametersProvider=d:\cmd_files\netxms_rpc_debug.cmd:5


In the Agent Debug(level 9) logs i was unable to find detailed information about the execution of ExternalParamtersProvider only the DCIs requesting their parameters.
i tested this on two Windows 2008 R2 systems with same agent version. one is part of a domain, the other is not.

i appreciate any ideas.
in the end, i need the xcopy in powershell to generate a list of remote files older than a specific date (xcopy /L /D:DATE)
#7
Hi

we are experiencing a strange issue since we upgraded from 1.0.11 to 1.2.3. when the configuration poll checks the capabilities of a system it seems to be unable to find the NetXMS agent AND the snmp agent together.
if NetXMS Agent Service is running, it recognizes the Agent but not SNMP. if you stop the service, it recognizes SNMP again.
this means, when we run the NetXMS Agent we are unable to check SNMP values on our systems!

we experienced this on several Windows 2008 R2 systems, an issue we didn't have before.
most of the systems still work, but on every one i run the configuration poll, the SNMP stops working as it doesn't show up in the capabilities anymore.

edit: it seems to be only an issue with manual configuration polls. we upgraded yesterday and we were not yet flodded by errors ;)

any idea on this?
thanks!