Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
1- create or copy the create in: /var/db/scripts/op/jlk_ping.slax
2- config: "set system scripts op file jlk_ping.slax"
3- run the script:
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";
}
}