Blog Viewer

Scripting How-To: Invoke a command from script that does not have the corresponding RPC defined in Junos OS

By Erdem posted 08-10-2015 12:31

  

If there is no respective RPC for a Junos OS CLI command, then the command can be executed from script using <command> RPC:

1	var $cmd = <command> "show version";
2	var $res = jcs:invoke($cmd);

Piped commands should not be used with <command> RPC. They are not supported. The following is an invalid command:

1	var $cmd = <command> "show version | display detail";

#JunosOS
#cli
#How-To
#ScriptingHow-To

Permalink