Hi All,
Here below is my slax script for show services nat source pool all command.
version 1.0;
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> {
var $rpc = {
<retrieve-srv-source-nat-pool-information> {
<all>;
}
}
var $out = jcs:invoke($rpc);
/*expr jcs:output($out);*/
for-each ($out/source-nat-pool-info-entry) {
var $poolname = ./pool-name;
var $poolusers = ./source-pool-users;
expr jcs:output("Pool-name: ", $poolname);
expr jcs:output("Users Count: ", $poolusers);
}
}
}
The output of the script is:
Pool-Name: Pool-1
Users Count: 5
Pool-Name: Pool-2
Users Count: 2
I want to get the total users count, for ex. pool-1+pool-2... any idea on how to execute using slax. Thanks.
------------------------------
GERALD NICOLE RODRIGUEZ
------------------------------