Сен 292011
В этой заметке дам короткую информацию о том, как сделать сохранение конфигурации и перезагрузку коммутатора ZyXEL ES-3124-4F средствами snmpset
Немного теории и выдержка man 1 snmpset
snmpset is an SNMP application that uses the SNMP SET request to set information on a network entity. One or more object identifiers (OIDs) must be given as arguments on the command line. A type and a value to be set must accompany each object identifier. Each variable name is given in the format specified in variables(5). The TYPE is a single character, one of: i INTEGER u UNSIGNED s STRING x HEX STRING d DECIMAL STRING n NULLOBJ o OBJID t TIMETICKS a IPADDRESS b BITS Most of these will use the obvious corresponding ASN.1 type. 's', 'x', 'd' and 'b' are all different ways of specifying an OCTET STRING value, and the 'u' unsigned type is also used for handling Gauge32 values. If you have the proper MIB file loaded, you can, in most cases, replace the type with an '=' sign. For an object of type OCTET STRING this will assume a string like the 's' type notation. For other types it will do "The Right Thing".
Также стоит отметить, что у коммутаторов серии ZyXEL ES/GS есть несколько конфигураций — 1 и 2.
Вводные данные таковы:
- использоваться будет версия протокола v2c
- community на запись — public-w
- IP-адрес подопытного — 10.10.10.10
Перезагрузка коммутатора: snmpset -v2c -c public-w 10.10.10.10 .1.3.6.1.4.1.890.1.5.8.26.12.2.0 i 1 //i 1 - послать команду на перезагрузку Сохранение конфигурации - #1 и #2: snmpset -v2c -c public-w 10.10.10.10 .1.3.6.1.4.1.890.1.5.8.26.12.1.0 i 1 snmpset -v2c -c public-w 10.10.10.10 .1.3.6.1.4.1.890.1.5.8.26.12.1.0 i 2 Перезагрука с выбором конфигураций - #1 или #2: snmpset -v2c -c public-w 10.10.10.10 .1.3.6.1.4.1.890.1.5.8.26.12.2.0 i 1 snmpset -v2c -c public-w 10.10.10.10 .1.3.6.1.4.1.890.1.5.8.26.12.2.0 i 2