# Script to delete controller wireless access points sub config_cisco_delete_controllers_waps { my @controllers_waps_to_be_deleted; # Name of controllers whose waps needs to be deleted # Controller names are space separated # Replace cisco-ctrl-4 cisco-ctrl-5 cisco-ctrl-6 cisco-ctrl-7 with the controller whose WAPs needs to be deleted @controllers_waps_to_be_deleted = qw (cisco-ctrl-4 cisco-ctrl-5 cisco-ctrl-6 cisco-ctrl-7); if (scalar (@controllers_waps_to_be_deleted) > 0 ){ # Create a group of Controllers WAPs that needs to be deleted my $delete_ctrl_waps_group = "delete_controller_access_points"; adb_send (sprintf ("add device group %s", $delete_ctrl_waps_group)); for my $ctrl_name (@controllers_waps_to_be_deleted) { for my $line (adb_result (sprintf ("mget * * * SNMP.proxy value %s", $ctrl_name))) { my ($ap_name, undef, undef, undef, undef) = split (" ", $line, 5); # Assign WAPs to group adb_send (sprintf ("assign device %s = %s", $ap_name, $delete_ctrl_waps_group)); } } # Delete waps belonging to controller adb_send (sprintf ("mdelete * * any group %s ", $delete_ctrl_waps_group)); # Delete group adb_send (sprintf ("delete device group %s ", $delete_ctrl_waps_group)); } }