NetXMS Support Forum

English Support => General Support => Topic started by: gkaudewitz on May 26, 2023, 03:23:11 PM

Title: Read parameter value within script
Post by: gkaudewitz on May 26, 2023, 03:23:11 PM
With NXSL it is possible to generate an output with "println" to the client.
Is there a possibility to create an input-window from an nxsl-script where an input can be requested with an individual description (value=readln("Please insert a value:")). Something like You have implemented with objecttools "InputFileds" but even generated as a result of some script-calculation.
Best regards
Georg
Title: Re: Read parameter value within script
Post by: Victor Kirhenshtein on May 29, 2023, 02:22:23 PM
Can you please describe use case for that? Usually NXSL scripts are non-interactive, the only place where user normally invokes NXSL script is script based object tool - but there you can use input fields.

Best regards,
Victor
Title: Re: Read parameter value within script
Post by: gkaudewitz on May 30, 2023, 03:36:47 PM
Having an environmental Control unit where it is not possible to change sensornames via webgui I want to create a form from within netxms-gui where all connected sensors are listed with theire type (temperature, humidity, leakage). Within this form user should have the possibility to name the sensors and the data should be written via SNMP-set to the unit.
For user-convinience this should be done to for all used controller-units, even if there is possibility to change these data via web.
It would bee interesting applying some other data to the sensors like warning temperatur-settings individually per sensor with the same procedure.
Best regards
Georg
Title: Re: Read parameter value within script
Post by: Victor Kirhenshtein on June 13, 2023, 06:34:58 PM
You should be able to do that with object tools. Create tool that will call a script, define necessary input fields, and when user will run the tool he will be asked for additional input. This input will be available in a script.
You can even create context dashboard and add those tools as action buttons.

Best regards,
Victor