set system scripts op file jlk_ping.slax
root@QFX5110-2> file show /var/db/scripts/op/jlk_ping.slax
version 1.0;
/*
* ping an ip addr
*
* op jlk_ping.slax
*/
ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
import "../import/junos.xsl";
match /
{
<op-script-results>
{
/* execute the 'ping' command and store the result */
var $query = { <command> 'ping 12.12.0.2 routing-instance vrouter1 count 10'; }
var $result = jcs:invoke($query);
/* print a header */
<output>"done";
}
} |