[j-nsp] ifl and ifd list
Phil Shafer
phil at juniper.net
Wed Jun 9 16:34:41 EDT 2010
Richard A Steenbergen writes:
>But speaking of feature requests related to viewing stuff in the pfe,
>I'd love to get something to run a single command on a remote shell and
>then exit (i.e. invoke cprod -c rather than vty). Similar to how Cisco
>gives you "remote login" (i.e. start shell pfe) and "remote command".
"request pfe execute" aka <request-pfe-execute>. I think it
first appeared in 9.x, but it may have been 8.x.
cli> request pfe execute ?
Possible completions:
+ command Command line to execute
pic-slot PIC slot number (0..3)
target Component on which command is executed
Bad news is that the text comes back as raw text, so a script
needs jcs:break-lines and jcs:regex to parse it:
var $rpcNpez0 = <request-pfe-execute> {
<target> $fpc;
<command> "show npez 0 structure config";
}
var $result = jcs:invoke($rpcNpez0);
var $lines = jcs:break-lines($result);
for-each ($lines) {
var $pattern = "VC direct table entries[^0-9]+([0-9]+)";
var $res = jcs:regex($pattern, .);
if($res[1]) {
<npez0> $res[2];
}
}
Thanks,
Phil
More information about the juniper-nsp
mailing list