Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fogbow
doctor
Commits
178eef38
Commit
178eef38
authored
Dec 01, 2014
by
abmargb
Browse files
added initial bits for diagnostics
parent
b3f3a2c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
178eef38
config
config.example
0 → 100644
View file @
178eef38
[xmpp]
jid=abc@domain.com
password=passpass
host=127.0.0.1
port=5222
[doctor]
components=manager1.domain.com,manager2.domain.com,rendezvous1.domain.com
run.py
0 → 100644
View file @
178eef38
import
sleekxmpp
import
logging
import
traceback
import
ConfigParser
config
=
ConfigParser
.
ConfigParser
()
config
.
read
(
'config'
)
logging
.
basicConfig
(
level
=
logging
.
DEBUG
,
format
=
'%(levelname)-8s %(message)s'
)
xmpp
=
sleekxmpp
.
ClientXMPP
(
config
.
get
(
'xmpp'
,
'jid'
),
config
.
get
(
'xmpp'
,
'password'
))
xmpp
.
connect
((
config
.
get
(
'xmpp'
,
'host'
),
(
config
.
getint
(
'xmpp'
,
'port'
))))
xmpp
.
process
(
block
=
False
)
components
=
config
.
get
(
"doctor"
,
"components"
)
for
component
in
components
.
split
(
','
):
try
:
iq
=
xmpp
.
make_iq_get
(
queryxmlns
=
'http://jabber.org/protocol/disco#info'
,
ito
=
component
,
ifrom
=
xmpp
.
boundjid
)
response
=
iq
.
send
(
block
=
True
,
timeout
=
10
)
except
Exception
,
e
:
xmpp
.
disconnect
()
raise
e
xmpp
.
disconnect
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment