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 - Sack-C-Fix

#16
Okay,

tried a few things and found following behaviour.
As mentioned above, executing action from CLI/CMD via nxaction on Agent (Windows) works from server (Windows and Linux).

Executing the action via EPP only works on Windows-Server, seems Linux-Server can't find the correct action.
Log-Files are attached, the first lines show command executed on server, followed by reaction on agent.

Thanks
Andreas
#17
Hello,

forgot to reply to your answer.
With the new version at least the entry in the log-file seems correct, but executing the action is still not working.

Has someone a working example of executing a script via nxagent?

Thanks
Andreas
#18
Hmm,
maybe related to the problem (or i'm too stupid to use parameters correctly).

If i execute a internal script via GUI's Server Console and pass multiple parameters, strings are split at blanks, even if enquoted by "".

Example: exec myScript 123 456 "Hello World"
So for this i get $1 = 123, $2 = 456, $3 = "Hello, $4 = World", i was expecting to get the complete string for $3.

Any thoughts on this?

Andreas
#19
Hello,

Configs are in the files attached, I there also tried to escape ("", '', \", \') the parameters.
Results stay the same, on Windows i get the correct parameter per string, on Linux the parameters are passed multiple times.

Thanks
#20
Hi everyone,

I have a problem with executing an agent“s action via EPP and found also some strange behaviour on Linux, systems are:

  • Server-Linux: Debian 9, NetXMS-Server 3.0.2357
  • Server-Windows: Server 2012 R2, NetXMS-Server 2.2.16
  • Agent-Windows: Server 2012 R2, NetXMS-Agent 3.0.2357

What i want is to execute a cmd-Script (send message) on the Windows-Agent, tested it with following config (nxagentd.conf)

...
EnableActions = yes
Action = notify: C:\\Local\\Binw\\Notify_V3.cmd -S $1 -D $2 -M $3 -G $4 -L $5
...


Using parameters for the action, things get strange on the Linux-Server:
/bin/# ./nxaction -o 192.168.9.40 notify Test2 NetXMS E NetXMS2 LinNXACTION

Working, i get mail:
Executing action C:\\Local\\Binw\\Notify_V3.cmd -S Test -D NetXMS -M E -G NetXMS2 -L LinNXACTION of type 1

Via Action + EPP, not working:
Executing action C:\\Local\\Binw\\Notify_V3.cmd -S Test NetXMS E NetXMS2 LinEPP -D NetXMS E NetXMS2 LinEPP -M E NetXMS2 LinEPP -G NetXMS2 LinEPP -L LinEPP of type 1

I tried almost 50 different versions of the config (using " or ' around single parameters, all parameters, escaping the parameters with \" an \' and so on), but i always get a result like the above.
Seems there is an problem transmitting and escaping the string from Linux to Windows, because if i use same config from within Windows-Server i get (which is also not working):
Executing action C:\\Local\\Binw\\Notify_V3.cmd -S Test -D NetXMS -M E -G NetXMS2 -L WinEPP of type 1

So, is this a known problem or am i doing it wrong?
And, has someone a working example of using an action with multiple parameters?

Thanks

Andreas
#21
General Support / Add Image to Library via Java-API
July 04, 2017, 09:44:01 AM
Hi there,
first of all, thanks for this awesome Software.

I am trying to add some Icons to the ImageLibrary via Java-API but i am not sure how to do this.
What I have already tried:

  • Upload png to Server with uuid as Filename, this works, file is in /var/files/
  • Instantiate new LibraryImage(uuid, Name, category,...), works also, except for empty Image
  • createImage adds Image to Library with desired Name, but then I get a NullPointerException because of the empty image :-\

So, can someone help me on how to get an png-File on the Server into the ImageLibrary?

Thanks
Andy

Edit:

Ok, got it working.
String objectName = (String)object1.getObjectName();
String fileName = "C:/Users/xxx/Images/" + objectName + ".PNG";
UUID uuid = UUID.randomUUID();
ProgressListener listener = null;
byte[] array = Files.readAllBytes(new File(fileName).toPath());      

LibraryImage newImg = new LibraryImage(uuid, objectName, "Default", "image/png", false);
newImg.setBinaryData(array);
s.createImage(newImg, listener);


Only Problem now, it takes some time until i can assign the new Image to a Node.