Hi,
I got a basis slax script which deletes existing radius-servers on an EX switch.
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";
ns ext = "http://xmlsoft.org/XSLT/namespace";
import "../import/junos.xsl";
match / {
<op-script-results> {
var $config-rpc = <get-configuration> {
<configuration> {
<system>;
}
}
/* Request configuration and assign to $config variable */
var $config = jcs:invoke( $config-rpc );
/* delete all the existing radius-servers */
var $config-changes-1 = {
<configuration> {
<system> {
<radius-server delete="delete"> {
}
}
}
}
var $load-action = "merge";
var $conn_handle = jcs:open();
var $results := {
call jcs:load-configuration( $action=$load-action,$configuration=$config-changes-1, $connection=$conn_handle);
}
}
}
but for some reason, running the same script on an SRX doesn't work, and it won't delete the existing radius-servers.
any reason why it won't work on the SRX?
if( $results//xnm:error ) {
for-each( $results//xnm:error ) {
<output> message;
}
}
}
including the xnm error gives me a 'syntax error"
when I fill in an existing radius-server IP with the <name> stanza , it will work, but it won't just delete the <radius-server> in full.
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";
ns ext = "http://xmlsoft.org/XSLT/namespace";
import "../import/junos.xsl";
match / {
<op-script-results> {
var $config-rpc = <get-configuration> {
<configuration> {
<system>;
}
}
/* Request configuration and assign to $config variable */
var $config = jcs:invoke( $config-rpc );
/* delete all the existing radius-servers */
var $config-changes-1 = {
<configuration> {
<system> {
<radius-server delete="delete">{
<name> "10.9.8.7";
}
}
}
}
var $load-action = "merge";
var $conn_handle = jcs:open();
var $results := {
call jcs:load-configuration( $action=$load-action,$configuration=$config-changes-1, $connection=$conn_handle);
}
if( $results//xnm:error ) {
for-each( $results//xnm:error ) {
<output> message;
}
}
}
}