Server Command Object Tool %OBJECT_IP_ADDR%
-
Hi,
I've created a Server Command under Object Tools that calls a bash script stored locally on the NetXMS server and passes the the %OBJECT_IP_ADDR% variable to the script. The script is very basic and looks something like this:
#!/bin/bash -- /usr/bin/do_something $1 echo `date +"%Y-%m-%d %T : "` Something done on device $1 >> script.logI can run this script manually and the expected output is in the log file and the expected action is completed.
If I run this script using the created Server Command Object Tool, the script is executed but what I see in the log is:
date_and_time: Something done on device BJECT_IP_ADDRIs there a way to pass the %OBJECT_IP_ADDR% variable to a Server Command Object Tool?
-
-
Actually it's an error in documentation. For server commands macros are expanded on server side, and you should use event processing macros (https://www.netxms.org/documentation/adminguide/event-processing.html#macros-for-event-processing).
-
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login