Displaying results from within Junos Space 13.1R1.6 or later.
Junos Space Release 13.1R1.6 introduced the ability to execute scripts against one or more devices, chassis components, physical or logical interfaces, and so on.
The results of these scripts can then be displayed directly within Junos Space (or within Job Management) in raw format, embedded within <op-script-results> tags, or with a little tweaking inside the script as HTML.
Shown below is a simple slax script that can be imported into Junos Space to display the output of a "show system processes extensive" command.
This particular script does not need to be staged or enabled on a device, as it includes the @ISLOCAL = "true" annotation. It will be executed locally on the Junos Space appliance and the command sent to the selected device via NETCONF. There is no need to enter credentials and so on, this is all managed via Junos Space in this example. It will also work transparently with a device that uses key-based authentication versus one that uses credentials-based authentication.
var $command=<command>"show system processes extensive";
var $results=jcs:execute( $local , $command );
var $close-results=jcs:close( $local);
The results, as displayed within Junos Space, can be seen below.
Note:If you want to quickly supress the results from displaying "Script execution output details" and the <op-script-results> tags, include an empty HTML and body section, as shown below. This has the side effect of still displaying the raw data, but without the extra tags appearing.