Created
February 14, 2013 02:09
-
-
Save BlueSkyDetector/4950116 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
### setting start ### | |
import urllib2, cookielib | |
login_url = 'http://192.168.0.16/zabbix/index.php' | |
graph_url = 'http://192.168.0.16/zabbix/chart2.php' | |
name = 'Admin' | |
password = 'zabbix' | |
graphid = 388 | |
output_file = 'out_graph.jpg' | |
### setting end ### | |
c = cookielib.CookieJar() | |
ch = urllib2.HTTPCookieProcessor(c) | |
op = urllib2.build_opener(ch) | |
r = op.open(login_url,"form_refresh=1&name;=%s&password;=%s&enter=Enter" % (name, password)) | |
r = op.open(graph_url + "?graphid=" + str(graphid)) | |
f = open(output_file,'wb') | |
f.write(r.read()) | |
f.close() | |
r.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment