Request user input from nxsl
-
Hi,
no, it's not possible. However, it is possible to create object tools with input fields - depending on what you are trying to achieve it may be good alternative.
Best regards,
Victor -
Hello Victor,
thank's for the tip! But how can I pass the values of the Input Fields to a servercommand that will call nxscript for inserting the values of the Input Fields as Custom Attributes?
The node identified by %n can be passed in the commandline in Object Tools.
Best regards
Georg -
-
Thaks for fast answering my questions to all of you.
I tried all other combinations of brackets and % but not this one...
One more question now: I've tested a script on an other system running on 2.0-RC1 and got a window requesting values for the parmeters. My production system still is running on 1.1.17 there I get no window requesting the values. Is there a difference between 2.0 and 1.1.17 or is there a Problem with my production Environment (Java on the Client or something else..)
-
Sorry I just read that inputfields for object Tools have been implemented with 2.0-RC1....
-
It's confusing....
runnig the following script with
/data/netxms/bin/nxscript /data/scripts/first.nxsl 124 ddd ddddI always get the same error:NetXMS Scripting Host Version 2.0-RC1 Copyright (c) 2005-2015 Victor Kirhenshtein Error 11 in line 4: Function not foundAn object with ID 124 exists in my testdatabase. There is no differencs wether I run the script from objecttools or from Linux commandline.
sub main() { obj = FindObject(null,$1); if (obj == null) { println "Object not found Id:" . $1; return; }; SetCustomAttribute(obj,"Bau",$2); SetCustomAttribute(obj,"Etage",$3); SetCustomAttribute(obj,"Raum",$4); //println "Hello World " . $1 . " " . $2 . " " . $3 . " " . $4 . " " . $5; }Is it necessary to set some path or lib-variables?
I'm using version 2.0-RC1(8035)
-
sub main() { obj = FindObject($1); if (obj == null) { println "Object not found Id:" . $1; return; } SetCustomAttribute(obj,"Bau",$2); SetCustomAttribute(obj,"Etage",$3); SetCustomAttribute(obj,"Raum",$4); //println "Hello World " . $1 . " " . $2 . " " . $3 . " " . $4 . " " . $5; } -
Thank's for the correction concerning the function FindObject. I tried the function FindNodeObject too several times.
But the problem persists.NetXMS Scripting Host Version 2.0-RC1 Copyright (c) 2005-2015 Victor Kirhenshtein Error 11 in line 4: Function not foundBest regards
Georg
-
Hi,
nxscript provides only generic functions, as it is completely independent from server process. You have to run your script within netxmsd, for example using nxadm:
/data/netxms/bin/nxadm -c 'exec /data/scripts/first.nxsl 124 ddd dddd'and if you need to execute NXSL script as reaction to event, you can simply create your script in script library and use "execute script" action.
Best regards,
Victor -
Hi,
Your advise in mind how to call the nxsl-Script everything worked fine for Nodes!
Trying to execute the same script for a Container within the gui does not work at all.
I inserted a println-statement to the script to see the object-Id that is called, but I don't get any Output for a containerobject.
Executing the script directly from commandline on Linux with an id identifying a Container I will get the expected result for that container.Best regards
Georg
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