Monitoring WebSite State
Const EVENT_SUCCESS=0
Const EVENT_ERROR=1
Const EVENT_WARNING=2
Const EVENT_INFORMATION=4
Const EVENT_AUDIT_SUCCESS=8
Const EVENT_AUDIT_FAILURE=16
Const ForReading = 1
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("web.txt", ForReading)
i = 0
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
objDictionary.Add i, strNextLine
i = i + 1
loop
For Each objItem in objDictionary
strLine = objDictionary.Item(objItem)
send_request(strLine)
Next
function send_request(url)
set http_request = CreateObject( "Msxml2.XMLHTTP")
'http_request.setRequestHeader "Content-Type","text/html;charset=gb2312"
http_request.open "GET ", url, false
sub_echo=""
code="0"
fname=Replace(Replace(Replace(Replace(url,"/","_"),"","_"),":","_"),".","_")
On Error Resume Next
http_request.send(null)
If Err.Number <> 0 Then
sub_echo="Unavailable"
If Not objFSO.Fileexists(fName) Then
Call EventLogingError(url,sub_echo,code)
Set f1= objFSO.Createtextfile(fName, true)
End If
Err.Clear
Else
If http_request.statusText="OK" Then
If objFSO.Fileexists(fName) Then
sub_echo="OK"
code=http_request.Status
Call EventLogingSuccess(url,sub_echo,code)
set f2 = objFSO.getfile(fName)
f2.delete
End If
Else
sub_echo="BAD"
code=http_request.Status
If Not objFSO.Fileexists(fName) Then
Call EventLogingError(url,sub_echo,code)
Set f1= objFSO.Createtextfile(fName, true)
End If
End If
End If
set http_request=nothing
end function
Function EventLogingError(url,textstate,code)
Set objShell = CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_ERROR, _
"Error: There URL OF "&url&" Current State is "&textstate&" With Return Code "&code&" !"
End Function
Function EventLogingSuccess(url,textstate,code)
Set objShell = CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS, _
"Success: There URL OF "&url&" Current State is "&textstate&" With Return Code "&code&" !"
End Function
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12262773/viewspace-1048922/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- godaddy 的 Monitoring performance to make your website fasterGoORMWebAST
- STREAMS MONITORING
- useful websiteWeb
- Oracle:TABLE MONITORINGOracle
- torrent cache websiteWeb
- Go: sysmon, Runtime MonitoringGo
- how to build a website like apkmirrorUIWebAPK
- PostgreSQL DBA(77) - Locks(Lock Monitoring)SQL
- cpp website資源彙總Web
- PostgreSQL DBA(189) - PG 14 Monitoring ImprovementsSQL
- PostgreSQL DBA(142) - PG 12(Monitoring PostgreSQL VACUUM processes)SQL
- Design and implementation of database anomaly monitoring system based on AI algorithmDatabaseAIGo
- Flink狀態專題:keyed state和Operator state
- PostgreSQL DBA(143) - pgAdmin(Monitoring PostgreSQL VACUUM processes#2)SQL
- Vuex之stateVue
- [Vue] Sharing StateVue
- demoValue: state => state.demoValue是什麼語法呢?
- 感謝你給我推薦這個websiteWeb
- 網站內容監控工具:Website Watchman for Mac網站WebMac
- Missing key(s) in state_dict: Unexpected key(s) in state_dict
- React 手稿 – Component stateReact
- react 之 state 物件React物件
- 元件、Prop 和 State元件
- Simple state transition 3
- [Vue Pinia] Mutating StateVue
- torch.save(),torch.load(),state_dict(),load_state_dict()
- 網站優化Link-Assistant WebSite Auditor Enterprise for Mac網站優化WebMac
- 如何在 SAP Hybris WCMS cockpit 裡建立新的 websiteKPIWeb
- DRIVER_POWER_STATE_FAILUREAI
- Vuex之state和gettersVue
- [譯] 元件、Prop 和 State元件
- Widget 中的 State 解析
- swiftUI-@State 的作用SwiftUI
- Flutter Widget中的StateFlutter
- 圖解JanusGraph系列 - JanusGraph指標監控報警(Monitoring JanusGraph)圖解指標
- 什麼是 ecommerce 的 distributor 概念以及如何實現 website redirectWeb
- props設定state誤區
- 說說React元件的StateReact元件
- You Probably Dont Need Derived State