Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Wie kann ein OmniSwitch (AOS R6) per SNMPv3 abgefragt werden oder per SNMPv3 rebootet werden?
In diesem kurzen Artikel geht es darum wie ein OmniSwitch mit AOS Release 6 per SNMPv3 abgefragt werden kann und wie man einen Reboot durchführen könnte.
Einen snmpwalk per SNMPv3 durchführen
Dies setzt einen entsprechenden Benutzer auf dem OmniSwitch voraus.
-> user snmpv3 password $testing123 sha+des read-write all
Das hinterlegte Passwort auf dem OmniSwitch ist „$testing123“ aber es muss im Folgenden \$testing123 für den Abruf von der Mac/Linux Shell (Bash) angegeben werden, damit dieser Wert wegen dem $-Zeichen nicht als Variable verwendet wird. (Stichwort: Sonderzeichen escapen!)
BennyE$ snmpwalk -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 SNMPv2-MIB::sysDescr.0 = STRING: Alcatel-Lucent OS6450-P10 6.7.1.86.R03 GA, August 10, 2016. SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.6486.800.1.1.2.1.12.1.2 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (814000) 2:15:40.00 SNMPv2-MIB::sysContact.0 = STRING: Alcatel-Lucent, http://alcatel-lucent.com/wps/portal/enterprise SNMPv2-MIB::sysName.0 = STRING: vxTarget SNMPv2-MIB::sysLocation.0 = STRING: Unknown SNMPv2-MIB::sysServices.0 = INTEGER: 78 IF-MIB::ifNumber.0 = INTEGER: 14 IF-MIB::ifIndex.1001 = INTEGER: 1001 IF-MIB::ifIndex.1002 = INTEGER: 1002 IF-MIB::ifIndex.1003 = INTEGER: 1003 IF-MIB::ifIndex.1004 = INTEGER: 1004 IF-MIB::ifIndex.1005 = INTEGER: 1005 IF-MIB::ifIndex.1006 = INTEGER: 1006 IF-MIB::ifIndex.1007 = INTEGER: 1007 IF-MIB::ifIndex.1008 = INTEGER: 1008 IF-MIB::ifIndex.1009 = INTEGER: 1009 IF-MIB::ifIndex.1010 = INTEGER: 1010 IF-MIB::ifIndex.1011 = INTEGER: 1011 IF-MIB::ifIndex.1012 = INTEGER: 1012 ....
snmpwalk ohne AOS 6.7.1.R03 MIBs
BennyE$ snmpwalk -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.1.65 = INTEGER: 3 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.2.65 = INTEGER: 0 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.3.65 = INTEGER: 1 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.4.65 = Gauge32: 0 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.5.65 = INTEGER: 2 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.6.65 = INTEGER: 2 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.7.65 = INTEGER: 2 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.8.65 = INTEGER: 2
snmpwalk mit AOS 6.7.1.R03 MIBs
BennyE$ snmpwalk -v3 -m ALL -M +/Users/BennyE/Downloads/MIB/671_R03_MIB -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1 ALCATEL-IND1-CHASSIS-MIB::chasControlRunningVersion.65 = INTEGER: certified(3) ALCATEL-IND1-CHASSIS-MIB::chasControlActivateTimeout.65 = INTEGER: 0 ALCATEL-IND1-CHASSIS-MIB::chasControlVersionMngt.65 = INTEGER: notSignificant(1) ALCATEL-IND1-CHASSIS-MIB::chasControlDelayedActivateTimer.65 = Gauge32: 0 ALCATEL-IND1-CHASSIS-MIB::chasControlCertifyStatus.65 = INTEGER: needCertify(2) ALCATEL-IND1-CHASSIS-MIB::chasControlSynchronizationStatus.65 = INTEGER: monoControlModule(2) ALCATEL-IND1-CHASSIS-MIB::chasControlAcrossCmmWorkingSynchroStatus.65 = INTEGER: monoCMM(2) ALCATEL-IND1-CHASSIS-MIB::chasControlAcrossCmmCertifiedSynchroStatus.65 = INTEGER: monoCMM(2)
write memory flash-synchro
Die Konfiguration kann natürlich auch über SNMPv3 gespeichert und zertifiziert werden. Dabei ist zu beachten dass man wissen muss ob es sich um ein redundantes System (VC/Stack/redundante CMMs) handelt oder um eine „standalone“-Komponente. In meinem Fall ist es ein einzelner OS6450-P10.
1.3.6.1.4.1.6486.800.1.2.1.11.1.1.1.43.0 configWriteMemory OBJECT-TYPE SYNTAX INTEGER (0..1) MAX-ACCESS read-write STATUS current DESCRIPTION "A set of this object causes the entire switch snap-shot configuration to be stored in the boot.cfg file in the working directory." DEFVAL { 0 } ::= { configManager 43 }
BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.2.1.11.1.1.1.43.0 i 1 SNMPv2-SMI::enterprises.6486.800.1.2.1.11.1.1.1.43.0 = INTEGER: 1 alternativ BennyE$ snmpset -v3 -m ALL -M +/Users/BennyE/Downloads/MIB/671_R03_MIB -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 ALCATEL-IND1-CONFIG-MGR-MIB::configWriteMemory.0 i 1 ALCATEL-IND1-CONFIG-MGR-MIB::configWriteMemory.0 = INTEGER: 1
1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.3.65 chasControlVersionMngt OBJECT-TYPE SYNTAX INTEGER { notSignificant(1), certifySynchro(2), certifyNoSynchro(3), flashSynchro(4), restore(5), activate(6) } MAX-ACCESS read-write STATUS current DESCRIPTION "For the primary this means: notSignificant - No command applied. certifySynchro - Copy the file from the working to the certified directory and from the primary to the secondary (reboot of the secondary). certifyNoSynchro - Copy the file from the working to the certified directory. flashSynchro - Copy the file from the primary to the secondary (reboot of the secondary). restore - Copy the file from the certified directory to the working directory. activate - Reload from the working directory. Activate can be scheduled. " ::= { chasControlModuleEntry 3 }
- Für ein „standalone“ OmniSwitch gilt also der Wert „3“
BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.3.65 i 3 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.3.65 = INTEGER: 3 alternativ BennyE$ snmpset -v3 -m ALL -M +/Users/BennyE/Downloads/MIB/671_R03_MIB -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 ALCATEL-IND1-CHASSIS-MIB::chasControlVersionMngt.65 i 3 ALCATEL-IND1-CHASSIS-MIB::chasControlVersionMngt.65 = INTEGER: certifyNoSynchro(3)
reload working no rollback-timeout
Folgende SNMP-Kommandos starten den OmniSwitch sofort aus dem „working“-Verzeichnis neu. Bitte mit entsprechender Vorsicht/Planung einsetzen/testen.
BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.3.65 i 6 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.3.65 = INTEGER: 6 BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.2.65 i 0 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.2.65 = INTEGER: 0 BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.4.65 u 0 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.4.65 = Gauge32: 0
reload working rollback-timeout 5 in 10
Folgende SNMP-Kommandos starten den OmniSwitch in 10 Minuten aus dem „working“-Verzeichnis neu und lassen diesen erneut starten (aus „certified“-Verzeichnis) wenn 5 Minuten nach dem Boot der weitere Neustart nicht administrativ abgebrochen wird. Bitte mit entsprechender Vorsicht/Planung einsetzen/testen.
BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.3.65 i 6 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.3.65 = INTEGER: 6 BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.2.65 i 300 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.2.65 = INTEGER: 300 BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.1.1.4.65 u 600 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.1.1.4.65 = Gauge32: 600
Einen Reboot in X Sekunden planen
Folgendes SNMP-Kommando starten den OmniSwitch neu. Bitte mit entsprechender Vorsicht/Planung einsetzen/testen.
BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.2.1.2.65 u 1 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.2.1.2.65 = Gauge32: 1
Einen geplanten Reboot abbrechen
BennyE$ snmpset -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 1.3.6.1.4.1.6486.800.1.1.1.3.1.1.2.1.2.65 u 0 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.2.1.2.65 = Gauge32: 0