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

#1
General / Can't make AppAgent work
November 05, 2020, 05:20:21 PM
I'm trying to integrate AppAgent into a small C app. I'm doing a successful AppAgentInit, and then a AppAgentStart call. There are no obvious indications that it doesn't work, except that "nxappget" says "ERROR: Cannot connect to application agent" when I run it with the app name supplied in the APPAGENT_INIT struct. When configuring the local nxagentd with an AppAgent, it outputs the same error message in the logs periodically.

I've narrowed it down to the fact that it doesn't create a named pipe in /tmp as I would expect from reading the source. But I get no indication as to why. I've tried as root as well without success, so it doesn't seem to be a permission issue.

There's no helpful log output anywhere.

I'm using the libraries from NetXMS 3.5.152 source package on a Ubuntu 18.04 machine.

Init data:

static APPAGENT_INIT m_info =
{
        _T("VRECLIENT"),
        _T("root"),
        handleMessage,
        logger,
        1,
        m_parameters,
        0,
        NULL,
        0,
        NULL
};


The call in main():
        printf("Initializing AppAgent...\n");
        if (!AppAgentInit(&m_info))
        {
                printf("Init failed!\n");
        }
        printf("Starting AppAgent...\n");
        AppAgentStart();


At this point I start the rest of the application logic, which works well. But the AppAgent part just won't work. I'm not even sure that the pipe listener thread is running at all, and I'm not sure how to check it.

Do you have any hints on where to look for faults?

Thank you in advance!
#2
I just got a new Macbook which I upgraded to macOS 10.13 High Sierra before installing anything else.

Then I downloaded NetXMS Console 2.1.1. At first start it prompted me to install Java 6, which I did. After that, startup fails with a generic "An error has occurred" message and a reference to a log file (attached).

Am I missing a dependency or something? I can't remember needing anything else than Java for my previous machine.

Thank you in advance!
#3
General Support / Powershell commands in Agent config
January 18, 2017, 11:46:36 AM
I need to monitor a java process on some Windows hosts with the NetXMS Agent installed and running. The regular Process.Count and Process.CountEx only work for the process name, which is "java". This is not enough for my needs, since I need to make sure that java is run with certain arguments.

In linux, I would simply to a ps aux | grep <Java class or jar name> | wc -l which works for all user permissions.

I'm not very familiar with neither Windows nor Powershell, but I did manage to construct this one-liner for doing (sort of) the same thing:

(WMIC path win32_process get Commandline | select-string <Java class name>).Matches.count

This command returns the number of matches, or null if none were found.

This works when I manually start a powershell with elevated permissions. It does not work through an ExternalParameter in the Agent though. When querying in the DCI config it returns "" even when the process is running. Is this because powershell commands are not run with elevated privileges? The agent itself is run elevated as far as I know.

The full external parameter line in the config looks like this:
ExternalParameter = ProcMon.SymmetricLauncher:powershell -Command "& {(WMIC path win32_process get Commandline | select-string <Java class name>).Matches.count}"

I also tried ExternalParameterShellExec, but it didn't work either.

Are there any simple solutions to my problem?
#4
General / Contributing code
September 02, 2013, 01:44:49 PM
I have been using NetXMS for a long time, and I think it's a great piece of software! As is customary in the open source community, I'd love to show my appreciation by contributing code to the project. So my questions are:

1) Do you have any established routines/workflow for submitting patches, documentation or otherwise?

2) Have you considered migrating to GitHub (or equivalent) for easier collaboration and broader project visibility?

Thanks in advance!
#5
First of all, thank you for a great piece of software!

I have a problem with the nxalarm tool. It does list the active alarms, but all macros for displaying information about the source node expand to the empty string. I have tried it with 1.0.12 as well as older versions, and the result is the same.

Example:

A simple test setup with an active alarm with the alarm string "Alarm is active".

markus@ubuntu:~$ nxalarm localhost list -u admin -P xxxx -o "%a:%n %m"
: Alarm is active

1 active alarms
markus@ubuntu:~$


Is this a bug, or am I doing something wrong?