home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form frmPopups Caption = "Form1" ClientHeight = 3195 ClientLeft = 3690 ClientTop = 2910 ClientWidth = 4680 LinkTopic = "Form1" MousePointer = 99 'Custom ScaleHeight = 3195 ScaleWidth = 4680 Begin VB.Timer tmrEnd Enabled = 0 'False Interval = 3000 Left = 1800 Top = 1320 End Begin VB.Menu mnuMain Caption = "MainWeb" Begin VB.Menu mnuPing Caption = "Ping Server" End Begin VB.Menu mnuRemserv Caption = "Remove Server" End Begin VB.Menu mnuEdit Caption = "Edit Server Properties.." End Begin VB.Menu mnuOpenWeb Caption = "Open Web Page" End Begin VB.Menu mnuCritical Caption = "Critical" Begin VB.Menu mnuReboot Caption = "Reboot Server" End Begin VB.Menu mnuDead Caption = "Dead Server" End End End Begin VB.Menu mnuQuitMain Caption = "SysTray" Begin VB.Menu mnuQuit Caption = "Quit Application" End Begin VB.Menu mnuSpeak Caption = "Speech" Checked = -1 'True End Begin VB.Menu mnuShowLog Caption = "..Show Log" End Begin VB.Menu mnuToggle Caption = "Toggle" Begin VB.Menu mnuShowGate Caption = "Show Gateway" End Begin VB.Menu mnuShowWeb Caption = "Show Web" End Begin VB.Menu mnuShowpollers Caption = "Show Pollers" End End End Begin VB.Menu mnuGateMain Caption = "MainGateWay" Begin VB.Menu mnuGatePing Caption = "Ping Server" End Begin VB.Menu mnuRemGate Caption = "Remove Server" End Begin VB.Menu mnuEditGate Caption = "Edit Server Properties" End Begin VB.Menu mnuCriticalGate Caption = "Critical" Begin VB.Menu mnuGateReBoot Caption = "Re Boot Server" End Begin VB.Menu mnuGateDie Caption = "dead Server" End End End Attribute VB_Name = "frmPopups" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub mnuDead_Click() If blnRebooting(frmMain.intServClicked) = True Then RebootPC LSetting("IP" & frmMain.intServClicked), False blnRebooting(frmMain.intServClicked) = False Else If MsgBox("Are you sure you want to Die this server", vbOKCancel) = vbOK Then If MsgBox("WARNING!!! This server will not restart and will have to be cycled manually" & vbCrLf & "Are you sure you wish to Die this server?", vbOKCancel) = vbOK Then RebootPC LSetting("IP" & frmMain.intServClicked), True, True blnRebooting(frmMain.intServClicked) = True SayThis "Warning! Killing server " & LSetting("MName" & frmMain.intServClicked) & " This server will not restart" LogIt ("Dead Server " & LSetting("MName" & frmMain.intServClicked) & " This server will not restart") End If End If End If End Sub Private Sub mnuEdit_Click() blnEdit = True frmNewServer.Show End Sub Private Sub mnuEditGate_Click() blnEdit = True frmNewgateWay.Show End Sub Private Sub mnuGateDie_Click() If blnRebooting(intGateClicked) = True Then RebootPC LSetting("GateWayIP" & intGateClicked), False blnRebooting(intGateClicked) = False Else If MsgBox("WARNING!!! This server will not restart and will have to be cycled manually" & vbCrLf & "Are you sure you wish to Die this server?", vbOKCancel) = vbOK Then RebootPC LSetting("gatewayIP" & intGateClicked), True, True blnRebooting(intGateClicked) = True SayThis "Warning! Killing server " & LSetting("GateWayName" & intGateClicked) & " This server will not restart" End If End If End Sub Private Sub mnuGatePing_Click() Dim ECHO As ICMP_ECHO_REPLY FrmGateWay.lblBytesSent = "" FrmGateWay.lblBytesRecieved = "" FrmGateWay.lblTimeMS = "" FrmGateWay.lblPingStatus.Caption = "" FrmGateWay.lblPStats2.Caption = "" FrmGateWay.lblPingStatus.Caption = "Pinging " & LSetting("GateWayIP" & intGateClicked) & _ "with 9 bytes of Data................." Call Ping(LSetting("GateWayIP" & intGateClicked), ECHO) FrmGateWay.lblBytesSent = "9" FrmGateWay.lblBytesRecieved = ECHO.DataSize FrmGateWay.lblTimeMS = ECHO.RoundTripTime FrmGateWay.lblPingStatus.Caption = GetStatusCode(ECHO.status) Select Case Val(GetStatusCode(ECHO.status)) Case 0 FrmGateWay.lblPStats2.Caption = "Successful ping to " & LSetting("GateWayIP" & intGateClicked) SayThis "Pinged the server " & LSetting("GateWayIP" & intGateClicked) & ". The ping was Successful" Case Else SayThis "Couldn't Ping the server " & LSetting("IP" & intGateClicked) & ". The ping was UnSuccessful" FrmGateWay.lblPStats2.Caption = "Unable to ping " & LSetting("GateWayIP" & intGateClicked) End Select End Sub Private Sub mnuGateReBoot_Click() If blnRebooting(intGateClicked) = True Then RebootPC LSetting("GateWayIP" & intGateClicked), False blnRebooting(intGateClicked) = False Else If MsgBox("Are you sure you want to reboot this server", vbOKCancel) = vbOK Then RebootPC LSetting("gatewayIP" & intGateClicked), True blnRebooting(intGateClicked) = True SayThis "Warning! Rebooting server " & LSetting("GateWayName" & intGateClicked) End If End If End Sub Private Sub mnuOpenWeb_Click() If InStr(1, LSetting("URL" & frmMain.intServClicked), "http://") > 0 Then Shell ("start " & LSetting("URL" & frmMain.intServClicked)) Shell ("start http://" & LSetting("URL" & frmMain.intServClicked)) End If End Sub Private Sub mnuPing_Click() Dim ECHO As ICMP_ECHO_REPLY frmMain.lblBytesSent = "" frmMain.lblBytesRecieved = "" frmMain.lblTimeMS = "" frmMain.lblPingStatus.Caption = "" frmMain.lblPStats2.Caption = "" frmMain.lblPingStatus.Caption = "Pinging " & LSetting("IP" & frmMain.intServClicked) & _ "with 9 bytes of Data................." Call Ping(LSetting("IP" & frmMain.intServClicked), ECHO) frmMain.lblBytesSent = "9" frmMain.lblBytesRecieved = ECHO.DataSize frmMain.lblTimeMS = ECHO.RoundTripTime frmMain.lblPingStatus.Caption = GetStatusCode(ECHO.status) Select Case Val(GetStatusCode(ECHO.status)) Case 0 frmMain.lblPStats2.Caption = "Successful ping to " & LSetting("IP" & frmMain.intServClicked) SayThis "Pinged the server " & LSetting("IP" & frmMain.intServClicked) & ". The ping was Successful" Case Else SayThis "Couldn't Ping the server " & LSetting("IP" & frmMain.intServClicked) & ". The ping was UnSuccessful" frmMain.lblPStats2.Caption = "Unable to ping " & LSetting("IP" & frmMain.intServClicked) End Select End Sub Private Sub mnuQuit_Click() If MsgBox("Are you sure you wish to exit ?", vbOKCancel, "Exit Confirm") = vbOK Then FrmExit.Show frmMain.inetWeb.Cancel Unload frmMain Unload FrmGateWay tmrEnd.Enabled = True End If End Sub Private Sub mnuReboot_Click() If blnRebooting(frmMain.intServClicked) = True Then RebootPC LSetting("IP" & frmMain.intServClicked), False blnRebooting(frmMain.intServClicked) = False LogIt ("Abort Reboot " & LSetting("MName" & frmMain.intServClicked)) Else If MsgBox("Are you sure you want to reboot this server", vbOKCancel) = vbOK Then RebootPC LSetting("IP" & frmMain.intServClicked), True blnRebooting(frmMain.intServClicked) = True SayThis "Warning! Rebooting server " & LSetting("MName" & frmMain.intServClicked) LogIt ("Rebooting " & LSetting("MName" & frmMain.intServClicked)) End If End If End Sub Private Sub mnuRemGate_Click() Dim X As Integer Dim strRemovedServer If MsgBox("Are you sure you want to remove this server?", vbOKCancel, "Confirm Remove") = vbOK Then strRemovedServer = LSetting("GateWayName" & intGateClicked) For X = intGateClicked To intNoOfGateServers - 1 SSetting "gateDownSince" & X, LSetting("gateDownSince" & X + 1) SSetting "GateWayIP" & X, LSetting("GateWayIP" & X + 1) SSetting "LGateSend" & X, LSetting("LGateSend" & X + 1) SSetting "LGateFail" & X, LSetting("LGateFail" & X + 1) SSetting "GateWayName" & X, LSetting("GateWayName" & X + 1) SSetting "GateWayPort" & X, LSetting("GateWayPort" & X + 1) Next X intNoOfGateServers = intNoOfGateServers - 1 SSetting "NoOfGateWays", intNoOfGateServers modWeb.refresh SayThis "Server " & strRemovedServer & " has been removed from the server list" End If End Sub Private Sub mnuRemserv_Click() Dim X As Integer Dim strRemovedServer If MsgBox("Are you sure you want to remove this server?", vbOKCancel, "Confirm Remove") = vbOK Then strRemovedServer = LSetting("MName" & frmMain.intServClicked) For X = frmMain.intServClicked To intNoOfServers - 1 SSetting "DownSince" & X, LSetting("DownSince" & X + 1) SSetting "IP" & X, LSetting("IP" & X + 1) SSetting "LCheck" & X, LSetting("LCheck" & X + 1) SSetting "LFail" & X, LSetting("LFail" & X + 1) SSetting "MName" & X, LSetting("MName" & X + 1) SSetting "URL" & X, LSetting("URL" & X + 1) Next X intNoOfServers = intNoOfServers - 1 SSetting "NoOfServers", intNoOfServers modWeb.refresh SayThis "Server " & strRemovedServer & " has been removed from the server list" End If End Sub Private Sub mnuShowGate_Click() frmMain.Hide Set CForm = FrmGateWay SSetting "TOP", frmMain.Top SSetting "LEFT", frmMain.Left FrmGateWay.Show End Sub Private Sub mnuShowLog_Click() On Error GoTo open_log_error If Dir(App.Path & "\" & Format(Now, "dd mmm yyyy") & ".txt") <> "" Then Shell ("Notepad " & App.Path & "\" & Format(Now, "dd mmm yyyy") & ".txt"), vbNormalFocus MsgBox "No logs found", vbExclamation End If Exit Sub open_log_error: MsgBox Err.Description, vbExclamation End Sub Private Sub mnuShowpollers_Click() MsgBox ("Pollers not supported in this beta version") End Sub Private Sub mnuShowWeb_Click() CForm.Hide Set CForm = frmMain frmMain.Show End Sub Private Sub mnuSpeak_Click() If mnuSpeak.Checked = False Then mnuSpeak.Checked = True ElseIf mnuSpeak.Checked = True Then mnuSpeak.Checked = False End If End Sub Private Sub tmrEnd_Timer() tmrEnd.Enabled = False FrmExit.Timer1.Enabled = False Unload Me End End Sub