Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#36 Switch changes are not commited to NVRAM

Back-End (61)
Max Baker

When netdisco makes a change to a port or device, such
as turns off the port or changes its VLAN the change is
not then commited to the NVRAM of the device.

Requires that SNMP::Info can issue the correct command
to tell the device to commit changes to NVRAM.

Some discussion and device support already done, need
to dig that up...


  • Justin Hunter
    Justin Hunter

    Logged In: YES

    I think it's the 'old' way, but you can set writeMem
    ( to 1 to write mem, 0 to erase mem

    the 'new' way looks to piggyback on write net, in that it
    can do both. ccCopyEntry (

  • Bill Fenner
    Bill Fenner

    Logged In: YES

    Another place to investigate is CISCO-CONFIG-MAN-MIB - in
    particular it may be able to tell us if the config is
    modified but not saved, ccmHistoryRunningLastChanged vs.

    Looks like you can create a random row in ccCopyTable, with
    ccCopySourceFileType = runningConfig and ccCopyDestFileType
    = startupConfig, and ccCopyEntryRowStatus = createAndGo;
    then poll ccCopyState and/or ccCopyFailCause...

    I think this should all be abstracted, since we don't want
    it to only work for Ciscos - perhaps "does the config need
    to be saved?" and "do the save" operations with
    per-device-type operations behind the scenes.

    And I vote to bail on OLD-CISCO-SYS-MIB::writeMem until we
    find a device that can't use CISCO-CONFIG-COPY-MIB.

  • Justin Hunter
    Justin Hunter

    Logged In: YES

    not sure where this should be added, but here's the Cisco
    way, tested by adding to
    'CISCO-CONFIG-COPY-MIB' => 'ccCopyTable',
    to %MIBS

    'config_protocol' => 'ccCopyProtocol',
    'config_source_type' =>
    'config_dest_type' => 'ccCopyDestFileType',
    'config_server_addr' =>
    'config_filename' => 'ccCopyFileName',
    'config_username' => 'ccCopyUserName',
    'config_password' => 'ccCopyUserPassword',
    'config_notify_complete' =>
    'config_copy_state' => 'ccCopyState',
    'config_copy_start_time' => 'ccCopyTimeStarted',
    'config_copy_complete_time' =>
    'config_fail_cause' => 'ccCopyFailCause',
    'config_row_status' =>
    to %FUNCS

    sub writeNet($$)
    ## expecting an ip & config filename
    ## should probably regexp the $tftphost
    ## and convert it to ip if it's not
    my ($info, $tftphost, $tftpfile) = @_;

    srand(time() ^ ($$ + ($$ << 15)));
    my $rand = int(rand(1 << 24));

    $info->set_config_protocol(1, $rand);
    $info->set_config_source_type(4, $rand);
    $info->set_config_dest_type(1, $rand);
    $info->set_config_server_addr($tftphost, $rand);
    $info->set_config_filename($tftpfile, $rand);
    $info->set_config_row_status(1, $rand);

    sub writeMem
    my $info = shift;
    srand(time() ^ ($$ + ($$ << 15)));
    my $rand = int(rand(1 << 24));

    $info->set_config_source_type(4, $rand);
    $info->set_config_dest_type(3, $rand);
    $info->set_config_row_status(1, $rand);

    obviously, you could do all 5 or 3 set_'s 'manually', but
    writeNet & writeMem methods do it all in one step.

  • Eric A. Miller
    Eric A. Miller

    Logged In: YES

    Justin, this looks good. I'm going add a copy state check
    to validate the success and a return code for the
    subroutines as appropriate based upon the state check.
    Also, even though the the device should delete the row
    itself, we should delete it before leaving the subroutine.

  • Eric A. Miller
    Eric A. Miller

    • assigned_to: nobody --> jeneric
  • Justin Hunter
    Justin Hunter

    Logged In: YES

    I noticed that 'delete' issue after I posted this code. our
    1210 waps do not support this method. guess i'll have to
    write some deprecated writeMem & writeNet. should just put
    them in as %FUNCS and run set_'s on them

  • Justin Hunter
    Justin Hunter

    Logged In: YES

    I take that back about our 1210's. it was just an issue with
    not deleting. I created a So far, it's
    worked when including it like CiscoVTP, which I would assume
    is cisco-centric and other vendors have a * (or whatever)

    seems like a lot of legwork to add an additional module, but
    for something this specific, it looks like that is necessary.

    sadly (or luckily?), I only deal with Cisco eq (phasing out

    since I cannot attach to this 'bug', it is available at