1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| '本脚本使用前必须创建一下文件夹 D:cacticacti图形月流量CA-双线 及D: emps图形月
'其中D:cacticacti图形月流量CA-双线 为脚本最后拷贝目的文件夹,根据需求可以更改
'
'By:Fenei
'mail:fengf@xipunet.com
'
'使用此脚本文件时,需要将CACTI中:/cacti/graph_xport.php文件修改如下
' //include("./include/auth.php");
' include("./include/global.php");
'注释掉autp.php 使用global.php验证
'这样才能免登录下载文件
'定义下载脚本文件
Sub download(url,target)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Dim http,ado
Set http = CreateObject("Msxml2.XMLHTTP")
http.open "GET",url,False
http.send
Set ado = createobject("Adodb.Stream")
ado.Type = adTypeBinary
ado.Open
ado.Write http.responseBody
ado.SaveToFile target
ado.Close
End Sub
'下载列表,可根据list.xls修改
download "http://192.168.10.11/cacti/graph_image.php?local_graph_id=1156&rra_id=3","D: emps图形月总带宽.png"
download "http://192.168.10.11/cacti/graph_image.php?local_graph_id=1137&rra_id=3","D: emps图形月大客户.png"
download "http://192.168.10.11/cacti/graph_image.php?local_graph_id=1191&rra_id=3","D: emps图形月一米科技.png"
download "http://192.168.10.11/cacti/graph_image.php?local_graph_id=1192&rra_id=3","D: emps图形月科创网络.png"
'拷贝文件并以月期命名,清空temp文件夹
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFolder "D: emps数据月","D:cacticacti数据月流量CA-双线\"&FormatDateTime(Date, 1),true
fso.DeleteFile "D: emps数据月* "
|