Module: check_mk
Branch: master
Commit: 09efcd7e48b1860a2749ce708e906a9100118f1a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=09efcd7e48b186…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Oct 7 16:53:48 2013 +0200
First (not working) try with Fritz.Box Agent.
---
agents/special/agent_fritz | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/agents/special/agent_fritz b/agents/special/agent_fritz
new file mode 100755
index 0000000..140524b
--- /dev/null
+++ b/agents/special/agent_fritz
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+from lxml import etree
+import hashlib
+import inspect, pprint
+
+address = "http://fritz.box"
+username = ''
+password = "test123"
+
+url = '%s/login_sid.lua' % address
+login_page = etree.parse(url).getroot()
+sid = login_page.findtext('SID')
+block = login_page.findtext('BlockTime')
+if sid == "0000000000000000":
+ challenge = login_page.findtext('Challenge')
+ response = challenge + '-' + hashlib.md5(challenge + '-' + password
).hexdigest()
+
+ login_page = etree.parse(url+"?username=%s&response=%s" % (username,
response)).getroot()
+ print url+"?username=%s&response=%s" % (username, response)
+ sid = login_page.findtext('SID')
+ block = login_page.findtext('BlockTime')
+
+print "SID: %s, Block: %s" % ( sid, block )
+