A number of people I know have struggled with some of the more "interesting" functions of Foundry's SNMP mibs. Most of the mib works exactly as you expect, but when you try to do more advanced work (the sort of things you might do in a home-grown management system), it always fails.

There turns out to be a trick: Not only do you need to know the write community, but you must also prove to the device you know the enable password!! On top of that, your entire request MUST happen in one SNMP PDU. Fortunately, if you use one net-snmp snmpset command, that happens.

You can also provice a username & pw combo, if the pw has sufficient access rights. You'll want to check the mib (or the pdf docs) for info on how to do that.

Alternately, you can remove this restriction via the CLI command: no snmp-server pw-check. I don't really recommend this; this extra level of security is pretty nice, once you get used to it.

You can download the Foundry Mib (via Somix's excellent mib archive).


Write the running config to tftp

For example, if you want to write the config to tftp via snmp, you need to set all of the following in one packet:

WhatSymbolicOIDcontent
Set an enable passwordsnAgGblPassword .1.3.6.1.4.1.1991.1.1.2.1.15.0 your enable password
target tftp serversnAgTftpServerIp .1.3.6.1.4.1.1991.1.1.2.1.5.0ip address
tftp file namesnAgCfgFname .1.3.6.1.4.1.1991.1.1.2.1.8.0file name
actionsnAgCfgLoad .1.3.6.1.4.1.1991.1.1.2.1.9.0set to 22 (uploadFromDramToServer)
(note: netsnmp requires the trailing .0's on all the following OIDs. If these OIDs don't work for you, try striping the trailing .0)

For example, the following netsnmp command line might work for you (assuming a write community of private, and netsnmp v5):

snmpset -v2c -c private switch .1.3.6.1.4.1.1991.1.1.2.1.15.0 s enable .1.3.6.1.4.1.1991.1.1.2.1.5.0 a 127.0.0.1 .1.3.6.1.4.1.1991.1.1.2.1.8.0 s subdir/targetfile .1.3.6.1.4.1.1991.1.1.2.1.9.0 i 22

While this is running, you can poll snAgCfgLoad for status. Values for snAgCfgLoad include:

  1. normal status,ro
  2. flashPrepareReadFailure status,ro
  3. flashReadError status,ro
  4. flashPrepareWriteFailure status,ro
  5. flashWriteError status,ro
  6. tftpTimeoutError status,ro
  7. tftpOutOfBufferSpace status,ro
  8. tftpBusy status,ro
  9. tftpRemoteOtherErrors status,ro
  10. tftpRemoteNoFile status,ro
  11. tftpRemoteBadAccess status,ro
  12. tftpRemoteDiskFull status,ro
  13. tftpRemoteBadOperation status,ro
  14. tftpRemoteBadId status,ro
  15. tftpRemoteFileExists status,ro
  16. tftpRemoteNoUser status,ro
  17. operationError status,ro
  18. loading status,ro
  19. apparently, no value?
  20. uploadFromFlashToServer command,settable
  21. downloadToFlashFromServer command,settable
  22. uploadFromDramToServer command,settable
  23. downloadToDramFromServer command,settable
  24. uploadFromFlashToNMS command,settable
  25. downloadToFlashFromNMS command,settable
  26. uploadFromDramToNMS command,settable
  27. downloadToDramFromNMS command,settable
  28. operationDoneWithNMS command,settable
  29. tftpWrongFileType command,settable
In the above,

Commanding a device to save the running config to NVRAM

Writing a config to memory ("wr mem") is accomplished by setting the following, all in one PDU:

WhatSymbolicOIDcontent
Set an enable passwordsnAgGblPassword .1.3.6.1.4.1.1991.1.1.2.1.15.0 your enable password
Write config to nvramsnAgWriteNVRAM .1.3.6.1.4.1.1991.1.1.2.1.3 set to 3 (write)
Snmpget the contents of snAgWriteNVRAM to see the status of your request:


Uploading or downloading a new code image via SNMP

Copying an OS image to flash, primary or secondary: (again, all in one pdu!)

WhatSymbolicOIDcontent
Set an enable passwordsnAgGblPassword .1.3.6.1.4.1.1991.1.1.2.1.15.0 your enable password
target tftp serversnAgTftpServerIp .1.3.6.1.4.1.1991.1.1.2.1.5.0ip address
tftp file namesnAgImgFname .1.3.6.1.4.1.1991.1.1.2.1.6.0file name
command to download/upload imagesnAgImgLoad .1.3.6.1.4.1.1991.1.1.2.1.7.0set to your requested command, 20 == download file to primary flash

As before, read from snAgImgLoad to get status of your request. Values can be:

  1. normal status,ro
  2. flashPrepareReadFailure status,ro
  3. flashReadError status,ro
  4. flashPrepareWriteFailure status,ro
  5. flashWriteError status,ro
  6. tftpTimeoutError status,ro
  7. tftpOutOfBufferSpace status,ro
  8. tftpBusy status,ro
  9. tftpRemoteOtherErrors status,ro
  10. tftpRemoteNoFile status,ro
  11. tftpRemoteBadAccess status,ro
  12. tftpRemoteDiskFull status,ro
  13. tftpRemoteBadOperation status,ro
  14. tftpRemoteBadId status,ro
  15. tftpRemoteFileExists status,ro
  16. tftpRemoteNoUser status,ro
  17. operationError status,ro
  18. loading status,ro
  19. uploadPrimary command,settable, copy primary flash to server
  20. downloadPrimary command,settable, copy server to primary flash
  21. uploadSecondary command,settable, copy secondary flash to server
  22. downloadSecondary command,settable, copy secondary to primary flash
  23. tftpWrongFileType status,ro