Benutzer-Werkzeuge

Webseiten-Werkzeuge


aos_r6_abfrage_mit_snmpv3_und_reboot

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
aos_r6_abfrage_mit_snmpv3_und_reboot [2016/08/29 18:59] – angelegt bennyaos_r6_abfrage_mit_snmpv3_und_reboot [2016/08/30 20:27] (aktuell) benny
Zeile 1: Zeile 1:
-====== Wie kann ein OmniSwitch per SNMPv3 abgefragt werden oder per SNMPv3 rebootet werden? ======+====== Wie kann ein OmniSwitch (AOS R6) per SNMPv3 abgefragt werden oder per SNMPv3 rebootet werden? ======
  
-In diesem kurzen Artikel geht es darum wie ein Switch per SNMPv3 abgefragt werden kann und wie man einen Reboot durchführen könnte.+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 ===== ===== Einen snmpwalk per SNMPv3 durchführen =====
Zeile 11: Zeile 11:
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
-Das hinterlegte Passwort auf dem OmniSwitch ist "$testing123" aber es muss hier \$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!)+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!)
 </WRAP> </WRAP>
  
-<code>+<code bash>
 BennyE$ snmpwalk -v3 -a SHA -A \$testing123 -u snmpv3 -x DES -X \$testing123 -l authPriv 192.168.5.104 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::sysDescr.0 = STRING: Alcatel-Lucent OS6450-P10 6.7.1.86.R03 GA, August 10, 2016.
Zeile 37: Zeile 37:
 IF-MIB::ifIndex.1012 = INTEGER: 1012 IF-MIB::ifIndex.1012 = INTEGER: 1012
 .... ....
 +</code>
 +
 +<WRAP center round tip 60%>
 +Einige OIDs enden auf .65 und funktionieren im snmpset auch nur wenn diese .65 dort steht. Diese ominöse .65 ist das primäre Chassis-Management-Module (CMM), das teilweise natürlich virtuell abgebildet ist!
 +</WRAP>
 +
 +==== snmpwalk ohne AOS 6.7.1.R03 MIBs ====
 +<code bash>
 +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
 +</code>
 +
 +==== snmpwalk mit AOS 6.7.1.R03 MIBs ====
 +<code bash>
 +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)
 +</code>
 +
 +
 +===== 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.
 +
 +<code bash>
 +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 }
 +</code>
 +
 +<code bash>
 +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
 +
 +</code>
 +
 +<code bash>
 +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 }
 +</code>
 +
 +  * Für ein "standalone" OmniSwitch gilt also der Wert "3"
 +
 +<code bash>
 +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)
 +
 +</code>
 +
 +
 +===== reload working no rollback-timeout =====
 +
 +<WRAP center round alert 60%>
 +Folgende SNMP-Kommandos starten den OmniSwitch sofort aus dem "working"-Verzeichnis neu. Bitte mit entsprechender Vorsicht/Planung einsetzen/testen.
 +</WRAP>
 +
 +<code bash>
 +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
 +</code>
 +
 +===== reload working rollback-timeout 5 in 10 =====
 +
 +<WRAP center round alert 60%>
 +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.
 +</WRAP>
 +
 +<code bash>
 +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
 </code> </code>
  
 ===== Einen Reboot in X Sekunden planen ===== ===== Einen Reboot in X Sekunden planen =====
 +
 <WRAP center round alert 60%> <WRAP center round alert 60%>
-Folgendes SNMPv3 plant einen nahezu sofortigen Neustart des OmniSwitch. Bitte mit entsprechender Vorsicht/Planung testen.+Folgendes SNMP-Kommando starten den OmniSwitch neu. Bitte mit entsprechender Vorsicht/Planung einsetzen/testen.
 </WRAP> </WRAP>
-<code>+ 
 +<code bash>
 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 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 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.2.1.2.65 = Gauge32: 1
Zeile 49: Zeile 194:
  
 ===== Einen geplanten Reboot abbrechen ===== ===== Einen geplanten Reboot abbrechen =====
-<code>+<code bash>
 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 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 SNMPv2-SMI::enterprises.6486.800.1.1.1.3.1.1.2.1.2.65 = Gauge32: 0
 </code> </code>
aos_r6_abfrage_mit_snmpv3_und_reboot.1472497166.txt.gz · Zuletzt geändert: 2016/08/29 18:59 von benny

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki