Code Show ZTE ONTs Status
Code Show ZTE ONTs Status
If ontS = 3 Then
Cells(x + 9, 3).Font.Color = vbGreen
Cells(x + 9, 3).Value = "Working"
ontS = 7
ElseIf ontS = 6 Then
Cells(x + 9, 3).Font.Color = vbRed
Cells(x + 9, 3).Value = "offline"
strMessage = "Warning : " & Cells(4, 1).Value & " " & Cells(x + 9,
1).Value & " " & Cells(x + 9, 2).Value & " : is Offline"
strPostData = "chat_id=" & strChatID & "&text=" & strMessage
SendMessage (strPostData)
ontS = 7
ElseIf ontS = 0 Then
Cells(x + 9, 3).Font.Color = vbBlack
Cells(x + 9, 3).Value = "logging"
ontS = 7
ElseIf ontS = 1 Then
Cells(x + 9, 3).Font.Color = vbBlack
Cells(x + 9, 3).Value = "los"
ontS = 7
ElseIf ps = 2 Then
Cells(x + 9, 3).Font.Color = vbBlack
Cells(x + 9, 3).Value = "syncMib"
ontS = 7
ElseIf ps = 4 Then
Cells(x + 9, 3).Font.Color = vbBlack
Cells(x + 9, 3).Value = "dyinggasp"
ontS = 7
ElseIf ps = 5 Then
Cells(x + 9, 3).Font.Color = vbBlack
Cells(x + 9, 3).Value = "authFailed"
ontS = 7
Else
Cells(x + 9, 3).Value = " "
End If
Next
objSNMP.Close
End Sub
Function SendMessage(strPostData)
Dim objRequest As Object
With objRequest
.Open "POST", "https://api.telegram.org/your_telegram_token/sendMessage?",
False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send (strPostData)
End With
End Function
-----------------------------------------------------------------------------------
---------------------------
ONU Status
Name: zxGponOntPhaseState
OID: .1.3.6.1.4.1.3902.1012.3.28.2.1.4
Description:
INTEGER { logging ( 0 ) , los ( 1 ) , syncMib ( 2 ) , working ( 3 ) , dyinggasp ( 4
) , authFailed ( 5 ) ,
offline ( 6 ) }
-------------------------------------------Frame/Slot/Port
ID---------------------------------------------------
1/1/1 268501248
1/1/2 268501504
1/1/3 268501760
1/1/4 268502016
1/1/5 268502272
1/1/6 268502528
1/1/7 268502784
1/1/8 268503040
1/1/9 268503296
1/1/10 268503552
1/1/11 268503808
1/1/12 268504064
1/1/13 268504320
1/1/14 268504576
1/1/15 268504832
1/1/16 268505088
1/2/1 268566784
1/2/2 268567040
1/2/3 268567296
1/2/4 268567552
1/2/5 268567808
1/2/6 268568064
1/2/7 268568320
1/2/8 268568576
1/2/9 268568832
1/2/10 268569088
1/2/11 268569344
1/2/12 268569600
1/2/13 268569856
1/2/14 268570112
1/2/15 268570368
1/2/16 268570624