Created
February 14, 2013 02:09
-
-
Save BlueSkyDetector/4950116 to your computer and use it in GitHub Desktop.
Revisions
-
BlueSkyDetector created this gist
Feb 14, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/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()