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

#1
General Support / Script to activate unsupported DCIs
December 12, 2017, 03:22:02 AM
My goal is the write a script that I can run from the server console that will walk through a group of nodes in a particular container and activate DCIs that are currently disabled and showing as unsupported.

My first question, is this possible?

Second, I'd like to write a script that can run even with CheckTrustedNodes set 1.  My first problem is retrieving the root object.  I know I am suppose to use:

$r = FindObject("1",$object);

but $r is always null, and my thought is that I don't have permission to access the root object.  My user is part of the admins group.  Am I missing something here?  Andrew
#2
General Support / Re: Using custom attribute in a DCI
November 10, 2017, 12:57:22 AM
I must be doing something wrong, mu last values are coming back 2, server unreachable.  Here are my custom attributes:
https://drive.google.com/open?id=1sTdSdAnl19PE1s9tEyblDoFBWsB8pF9M
and my parameter:
https://drive.google.com/open?id=1nX1--Or_tzzb6dCwTeKRg5UfoejWbu9e

Quote from: Victor Kirhenshtein on November 02, 2017, 10:14:42 AM
Macros within parameter name expanded only when you apply template to node. If it is fine, you can use script macro, and read custom attribute in script. But if you want that DCI will use current value of custom attribute immediately after your change it, themn the only option is to switch to script DCI and use AgentReadParameter function. For example:


return AgentReadParameter($node, "ServiceCheck.Custom(" . GetCustomAttribute($node, "IP") . ",80)");


Best regards,
Victor
#3
General Support / Using custom attribute in a DCI
October 30, 2017, 08:33:34 PM
I am trying to use a custom attribute inside a DCI.  I have a data parameter ServiceCheck.Custom(%IP%,80) and a custom attribute IP = 192.168.0.1.  I am trying to poll the web port of a device from this node, but I want to specify the IP as a custom attribute.  Is this possible? and what is the correct syntax?  Thanks, Andrew
#4
General Support / Unsupported DCIs change to disabled
October 20, 2016, 07:21:17 PM
I have a situation where a DCI  becomes disabled on many nodes due to an unsupported value, because I am pushing out an updated script.  Up to this point, I have been using the management console to re-enable the DCI on each node, which resolves the issue, but is very time consuming because I have to drill down into each node.  Is there a way to have a node recover from an unsupported value on it's own (automatically re-enable the DCI), or be able to select many nodes at one time and re-enable the DCI?  Thanks, Andrew
#5
General Support / Re: Agent not creating log file
September 08, 2016, 08:21:23 PM
Here is the output when I specify the aforementioned config file and the -D6 switch.  I'm a little concerned about the lines

[08-Sep-2016 16:21:15.618] ?????????
and
[08-Sep-2016 16:21:35.119] External parameters providers poller thread will not start

I don't think I see anything that relates to the logging issue, but I the line "[08-Sep-2016 16:21:35.119] External parameters providers poller thread will not start" seems to be my original issue, and the reason I was trying to examine the log.  There is an external script, which if you run it from a command line returns legitimate value, but the DCI that calls it comes back as unsupported.

Do you have any insight into these two issues given the output?

---output---
[08-Sep-2016 16:21:15.431] Additional configs was loaded from C:\ProgramData\NetXMS\netxmsa
[08-Sep-2016 16:21:15.446] Debug level set to 6
[08-Sep-2016 16:21:15.446] Data directory: C:\ProgramData\NetXMS
[08-Sep-2016 16:21:15.446] Subagent API initialized
[08-Sep-2016 16:21:15.446] Validating ciphers
[08-Sep-2016 16:21:15.618]    AES-256 enabled
[08-Sep-2016 16:21:15.618]    Blowfish-256 disabled (config)
[08-Sep-2016 16:21:15.618]    IDEA disabled (config)
[08-Sep-2016 16:21:15.618]    3DES disabled (config)
[08-Sep-2016 16:21:15.618]    AES-128 disabled (config)
[08-Sep-2016 16:21:15.618]    Blowfish-128 disabled (config)
[08-Sep-2016 16:21:15.618] Crypto library initialized
[08-Sep-2016 16:21:15.618] ?????????
[08-Sep-2016 16:21:15.618] DB Library: Database driver "sqlite.ddr" loaded and initialized successfully
[08-Sep-2016 16:21:15.618] New DB connection opened: handle=00000000008C11B0
[08-Sep-2016 16:21:15.634] Local database opened successfully
[08-Sep-2016 16:21:15.634] Subagent "WINNT.NSM" loaded successfully
[08-Sep-2016 16:21:15.634] Subagent "portcheck.nsm" loaded successfully
[08-Sep-2016 16:21:16.523] WinPerf: 2857 counter indexes read
[08-Sep-2016 16:21:16.554] WinPerf: 2857 counter translations read
[08-Sep-2016 16:21:16.772] WinPerf: "\Memory\Free & Zero Page List Bytes" is supported
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A waiting for set change
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_B waiting for set change
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_C waiting for set change
[08-Sep-2016 16:21:17.880] Subagent "winperf.nsm" loaded successfully
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: set changed
[08-Sep-2016 16:21:17.880] Subagent "wmi.nsm" loaded successfully
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\System\Processor Queue Length" added to query
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\System\Processor Queue Length" added to query
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\System\Processor Queue Length" added to query
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\Processor(_Total)\% Processor Time" added to query
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\Processor(_Total)\% Processor Time" added to query
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\Processor(_Total)\% Processor Time" added to query
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\PhysicalDisk(_Total)\Avg. Disk Queue Length" added to query
[08-Sep-2016 16:21:17.880] WINPERF: CollectorThread_A: Counter "\PhysicalDisk(_Total)\% Disk Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(0)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(0)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(0)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(1)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(1)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(1)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(2)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(2)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(2)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(3)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(3)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(3)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(4)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(4)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(4)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(5)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(5)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(5)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(6)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(6)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(6)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(7)\% Processor Time" added to query
[08-Sep-2016 16:21:17.896] WINPERF: CollectorThread_A: Counter "\Processor(7)\% Processor Time" added to query
[08-Sep-2016 16:21:17.911] WINPERF: CollectorThread_A: Counter "\Processor(7)\% Processor Time" added to query
[08-Sep-2016 16:21:17.911] WINPERF: CollectorThread_A entered data collection loop
WAIT [................]
[08-Sep-2016 16:21:35.119] External parameters providers poller thread will not start
[08-Sep-2016 16:21:35.119] Data collection scheduler thread started
[08-Sep-2016 16:21:35.119] Data sender thread started
[08-Sep-2016 16:21:35.119] Database writer thread started
[08-Sep-2016 16:21:35.119] Thread pool DATACOLL initialized (min=1, max=64)
[08-Sep-2016 16:21:35.119] Data reconciliation thread started
[08-Sep-2016 16:21:35.119] PushConnector: named pipe created, waiting for connection
[08-Sep-2016 16:21:35.119] StorageDiscoveryConnector: named pipe created, waiting for connection
[08-Sep-2016 16:21:35.119] Trying to bind on 0.0.0.0:4700
[08-Sep-2016 16:21:35.119] Trying to bind on 127.0.0.1:28180
[08-Sep-2016 16:21:35.119] Trying to bind on [::]:4700
[08-Sep-2016 16:21:35.119] Session agent connector listening on port 28180
[08-Sep-2016 16:21:35.119] Listening on socket 0.0.0.0:4700
[08-Sep-2016 16:21:35.119] Listening on socket [::]:4700
[08-Sep-2016 16:21:36.133] NetXMS Agent started
Agent running. Press ESC to shutdown.
Agent shutting down...
[08-Sep-2016 16:21:39.939] Shutdown() called
[08-Sep-2016 16:21:39.955] WINPERF: Collector thread for counter set C terminated
[08-Sep-2016 16:21:39.955] Waiting for data collector thread termination
[08-Sep-2016 16:21:39.955] WINPERF: Collector thread for counter set B terminated
[08-Sep-2016 16:21:39.955] Stopping threads in thread pool DATACOLL
[08-Sep-2016 16:21:39.955] WINPERF: Collector thread for counter set A terminated
[08-Sep-2016 16:21:39.955] Maintenance thread for thread pool DATACOLL stopped
[08-Sep-2016 16:21:39.955] Data reconciliation thread stopped
[08-Sep-2016 16:21:39.955] Thread pool DATACOLL destroyed
[08-Sep-2016 16:21:39.955] Data collection scheduler thread stopped
[08-Sep-2016 16:21:39.955] Waiting for data sender thread termination
[08-Sep-2016 16:21:39.955] Data sender thread stopped
[08-Sep-2016 16:21:39.955] Waiting for database writer thread termination
[08-Sep-2016 16:21:39.970] Database writer thread stopped
[08-Sep-2016 16:21:39.970] Waiting for data reconciliation thread termination
[08-Sep-2016 16:21:39.970] Trap sender thread terminated
[08-Sep-2016 16:21:40.189] Session agent connector thread terminated
[08-Sep-2016 16:21:41.141] Session Watchdog thread terminated
[08-Sep-2016 16:21:41.141] Listener thread terminated
[08-Sep-2016 16:21:41.141] DB connection 00000000008C11B0 closed
[08-Sep-2016 16:21:41.141] NetXMS Agent stopped
#6
General Support / Agent not creating log file
September 08, 2016, 01:41:42 AM
Hello, I have a server running NetXMS version 2.0.5, and a client running 2.0.4 with the following config file:

##
## netxmsa.conf
##
MasterServers = 10.2.23.208,10.1.23.208,10.2.25.172,10.1.25.172
DataDirectory = C:\ProgramData\NetXMS
EnabledCiphers = 1
ExecTimeout = 300000
FileStore = C:\Users\Public\Downloads
ConfigIncludeDir = C:\ProgramData\NetXMS\netxmsa
LogFile = C:\ProgramData\NetXMS\netxmsa\var\netxmsa.log
# LogFile = {syslog}
RequireAuthentication = no
StartupDelay = 16
SubAgent = portcheck.nsm
SubAgent = winperf.nsm
SubAgent = wmi.nsm

The client agent starts, but doesn't not generate the log file C:\ProgramData\NetXMS\netxmsa\var\netxmsa.log.  The directory exists, and has the correct permissions.  Is there some other way I can get diagnostic information to find out why it is not writing out this file?  Thanks, Andrew
#7
General / Re: Help with Java API
August 10, 2016, 07:42:57 PM
Quote from: tomaskir on August 09, 2016, 02:41:33 PM
Just a side note:
If you just need to modify GeoLocation data, consider using just a NXSL script, the "Node" object in NXSL has methods for GeoLocation retrieval and manipulation.

https://wiki.netxms.org/wiki/NXSL:Node

The 'setGeoLocation' method doesn't seem to work in NXSL, but I was able to successfully use a simple Java program to export the node names with their latitude and longitude from an older NetXMS server to a newer one.  Thank you for all your help!  Andrew
#8
General / Re: Help with Java API
August 09, 2016, 03:00:20 AM
Quote from: tomaskir on August 09, 2016, 02:32:22 AM
You need to call "s.syncObjects();" after login, so it syncs server objects to the local client.

Also, please use [code] tags when pasting code next time :)
THANK YOU!!! that was the pierce to the puzzle I was looking for, and I will use the code tag in the future.

Second question, I see a getGeolocation() method for getting the geolocation, but how does one go about setting the geolocation?  Andrew
#9
General / Help with Java API
August 09, 2016, 12:33:31 AM
Hello, I am trying write a simple Java program to help automate some tasks, and I am having some difficulty working with the API.  I wrote this test program:

// NetXMS API Version 2.0.4

import org.netxms.client.*;
import org.netxms.base.*;
import org.netxms.client.objects.*;

public class xmstool
{
    public static void main(String[] args)
   {
      
      try
      {
         NXCSession s = new NXCSession("NetXMS server");
         s.connect();
         s.login("user", "password");
         
         if(s.isConnected())
         {
            System.out.println("Connected");
         }
         else
         {
            System.out.println("Not connected");
         }
         
         AbstractObject node = s.findObjectByName("name of node");
         
         if(node == null)
         {
            System.out.printf("Did not find node\n");
         }
                  
      } catch(Exception e)
      {
         System.out.println("Fail");
         
      }      
    }   
}

I the program runs, and connects to the server, but I am not able to get a valid node object no matter what name I search for.  Am I missing something? Andrew