SNMP::...oConfig(3pm)

πŸ’– SNMP::Info::CiscoConfig πŸ’–

okay bestie so this is a page from the User Contributed Perl Documentation, and it's section 3pm of the manual, and the module itself is called SNMP::Info::CiscoConfig. it's a manpage. it's perl. it's giving network admin realness. let's go 🫢


✨ NAME ✨

SNMP::Info::CiscoConfig β€” an SNMP interface to Cisco configuration files, i.e. the thing that lets you poke at your switch's config from Perl instead of, like, physically being there. iconic behavior honestly.


πŸŽ€ AUTHOR πŸŽ€

Justin Hunter, Eric Miller. say thank you πŸ‘‘βœ¨


🌸 SYNOPSIS 🌸

here's the whole vibe, verbatim, no cap:

my $ciscoconfig = new SNMP::Info(
                      AutoSpecify => 1,
                      Debug       => 1,
                      DestHost    => 'myswitch',
                      Community   => 'public',
                      Version     => 2
                    )

or die "Can't connect to DestHost.\n";

my $class = $ciscoconfig->class();
print " Using device sub class : $class\n";

okay and also, <italic>or die</italic> when you can't connect, bestie. that part matters. the die is not optional energy. πŸ’€


πŸ¦‹ DESCRIPTION πŸ¦‹

so SNMP::Info::CiscoConfig is a subclass of SNMP::Info, and what it does is give you an interface to three whole MIBs:

  • CISCO-CONFIG-COPY-MIB
  • CISCO-FLASH-MIB
  • OLD-CISCO-SYS-MIB

and these MIBs are the ones that make writing configuration files possible. that's the whole point. that's the assignment. ✨

bestie, listen: use or create a subclass of SNMP::Info that inherits this one. do NOT use it directly. that's not a suggestion, that's the rule. πŸ™ˆ

Inherited Classes

None. zero. empty. it inherits nothing extra, it's standing on its own two feet. πŸ’…

Required MIBs

  • CISCO-CONFIG-COPY-MIB
  • CISCO-FLASH-MIB
  • OLD-CISCO-SYS-MIB

⭐ GLOBALS ⭐

these are methods that return a scalar value straight from SNMP. pure single-value energy.

  • $ciscoconfig->old_write_mem() β€” maps to "writeMem".
  • $ciscoconfig->old_write_net() β€” maps to "writeNet".

πŸ’œ TABLE METHODS πŸ’œ

these are methods that return whole tables of info, and they hand it back to you as a reference to a hash. a hash! a big ol' hash. πŸ“

Config Copy Request Table ("ccCopyTable")

  • $ciscoconfig->config_protocol() β€” maps to "ccCopyProtocol".
  • $ciscoconfig->config_source_type() β€” maps to "ccCopySourceFileType".
  • $ciscoconfig->config_dest_type() β€” maps to "ccCopyDestFileType".
  • $ciscoconfig->config_server_addr() β€” maps to "ccCopyServerAddress".
  • $ciscoconfig->config_filename() β€” maps to "ccCopyFileName".
  • $ciscoconfig->config_username() β€” maps to "ccCopyUserName".
  • $ciscoconfig->config_password() β€” maps to "ccCopyUserPassword".
  • $ciscoconfig->config_notify_complete() β€” maps to "ccCopyNotificationOnCompletion".
  • $ciscoconfig->config_copy_state() β€” maps to "ccCopyState".
  • $ciscoconfig->config_copy_start_time() β€” maps to "ccCopyTimeStarted".
  • $ciscoconfig->config_copy_complete_time() β€” maps to "ccCopyTimeCompleted".
  • $ciscoconfig->config_fail_cause() β€” maps to "ccCopyFailCause".
  • $ciscoconfig->config_row_status() β€” maps to "ccCopyEntryRowStatus".

Flash Copy Table ("ciscoFlashCopyTable")

it's a table of Flash copy operation entries. flash copy. entries. you got it. 🌈

  • $ciscoconfig->flash_copy_cmd() β€” maps to "ciscoFlashCopyCommand".
  • $ciscoconfig->flash_copy_protocol() β€” maps to "ciscoFlashCopyProtocol".
  • $ciscoconfig->flash_copy_address() β€” maps to "ciscoFlashCopyServerAddress".
  • $ciscoconfig->flash_copy_source() β€” maps to "ciscoFlashCopySourceName".
  • $ciscoconfig->flash_copy_dest() β€” maps to "ciscoFlashCopyDestinationName".
  • $ciscoconfig->flash_copy_row_status() β€” maps to "ciscoFlashCopyEntryStatus".

πŸ‘‘ SET METHODS πŸ‘‘

these are the methods that actually give you SNMP set functionality β€” either for methods that got overridden, or as a way simpler interface to set operations that are honestly kinda complex. for the general lore on set operations, go read "SETTING DATA VIA SNMP" in SNMP::Info. πŸ“š

  • $ciscoconfig->copy_run_tftp (tftpserver, tftpfilename ) β€” stores the running configuration onto a TFTP server. it's equivalent to the CLI commands copy running-config tftp or write net.

here's the tea on how it works: this method tries the newer copy running-config tftp procedure first, and only falls back to the older write net procedure if that fails. the newer procedure is supported by Cisco devices that have the CISCO-CONFIG-COPY-MIB available β€” that's Cisco IOS software release 12.0, or on some devices as early as release 11.2P. the older procedure has been depreciated by Cisco and only exists to support devices running older code revisions. (depreciated! watch out. πŸ‘€)

Example, verbatim:

$ciscoconfig->copy_run_tftp('1.2.3.4', 'myconfig')
   or die "Couldn't save config. ",$ciscoconfig->error(1);
  • $ciscoconfig->copy_run_start() β€” copies the running configuration over to the startup configuration. equivalent to the CLI command copy running-config startup-config or write mem.

same energy as above: it tries the newer copy running-config startup-config procedure first, then falls back to the older write mem procedure if that fails. the newer one needs Cisco devices with the CISCO-CONFIG-COPY-MIB available, Cisco IOS software release 12.0, or on some devices as early as release 11.2P. the older procedure has been depreciated by Cisco and is only there to support devices on older code revisions. ✨

Example, verbatim:

$ciscoconfig->copy_run_start()
   or die "Couldn't save config. ",$ciscoconfig->error(1);

okay that's the whole page bestie!! every flag, every method, every MIB, every mapping survived the vibe check. nothing was skipped. we ate and left no crumbs. πŸ’…

this gorgeous little document is perl v5.40.1, dated 2026-02-28, and it lives in the manpage SNMP::...oConfig(3pm). mwah. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from