Hello
Like to ha have control over saved config like old HP's and if all units
are up to date with updates (bios/boot_image and other programmables)
Added this as separated subroutines to not interfere with old parts.
arubaoscx;command;arubaoscx::ShowNeededUpdate;show needed-update next-boot
arubaoscx;command;arubaoscx::CheckpointOutout;checkpoint diff
startup-config running-config
Just have 6200 device to test on but seems to work.
/Peo
----------------------------------------------------------
Per-Olof Olsson Email: [email protected]
Chalmers tekniska högskola IT-avdelningen
Sven Hultins gata 9C 412 96 Göteborg
Tel: 031/772 6738 Mob: 0707 88 3708
----------------------------------------------------------
149a150,250
>
>
> ## This routine processes general output of "show needed-updates" commands
> sub ShowNeededUpdate {
> my($INPUT, $OUTPUT, $cmd) = @_;
> my $sub_name = (caller(0))[3];
> print STDERR " In $sub_name: $_" if ($debug);
>
> my $part = 0;
>
> chomp;
>
> # Display the command we're processing in the output:
> ProcessHistory("COMMENTS", "", "", "!\n! '$cmd':\n!\n");
>
> while (<$INPUT>) {
> tr/\015//d;
>
> # If we find the prompt, we're done
> last if (/^$prompt/);
> chomp;
>
> # filter out some junk
> $_ = filter_lines($_);
> return(1) if command_not_valid($_);
> return(-1) if command_not_auth($_);
> next if skip_pattern($_);
>
> if ( /-----------------------------/ ) {
> $part = 1;
> next;
> }
> if ( /==========================/ ) {
> $part = 0;
> next;
> }
> # Add the processed lines to the output buffer:
>
> next if /\sModel info :/;
> next if /\sWrite-protected :/;
> next if /\sImage timestamp :/;
> next if /\sImage size :/;
> next if /\sUpdate deferred/;
> next if /\sSimulation only, /;
> # next if /\sNon-failsafe device updates not enabled!/;
> next if /Would have updated 0 device/;
> if ( $part ) {
> ProcessHistory("COMMENTS","","","! $_\n");
> }
> }
>
> # Add a blank comment line to the output buffer
> ProcessHistory("COMMENTS", "", "", "!\n");
> return(0);
> }
>
>
> ## This routine processes general output of "checkpoint" commands
> sub CheckpointOutout {
> my($INPUT, $OUTPUT, $cmd) = @_;
> my $sub_name = (caller(0))[3];
> print STDERR " In $sub_name: $_" if ($debug);
>
> my $ansver="CX: The running configuration has been modified and not yet saved.";
>
> chomp;
>
> # Display the command we're processing in the output:
> ProcessHistory("COMMENTS", "", "", "!\n! '$cmd':\n!\n");
>
> while (<$INPUT>) {
> tr/\015//d;
>
> # If we find the prompt, we're done
> last if (/^$prompt/);
> chomp;
>
> # filter out some junk
> $_ = filter_lines($_);
> return(1) if command_not_valid($_);
> return(-1) if command_not_auth($_);
> next if skip_pattern($_);
>
> next if /\s\/tmp\/running-config/;
> if ( /\s\/tmp\/startup-config/ ) {
> ProcessHistory("COMMENTS","","","! $ansver\n");
> next;
> }
>
> # Add the processed lines to the output buffer:
> ProcessHistory("COMMENTS","","","! $_\n");
> }
>
> # Add a blank comment line to the output buffer
> ProcessHistory("COMMENTS", "", "", "!\n");
> return(0);
> }
>
>
>
>
_______________________________________________
Rancid-discuss mailing list
[email protected]
https://www.shrubbery.net/mailman/listinfo/rancid-discuss