add __author__ and __version__, PEP8 fixes
This commit is contained in:
parent
5e299f687e
commit
c8768ae3bd
1 changed files with 8 additions and 3 deletions
11
check_xmpp
11
check_xmpp
|
@ -13,9 +13,12 @@ import ssl
|
||||||
from defusedxml.sax import make_parser
|
from defusedxml.sax import make_parser
|
||||||
import nagiosplugin
|
import nagiosplugin
|
||||||
|
|
||||||
|
__author__ = "Jan Dittberner"
|
||||||
|
__version__ = "0.1"
|
||||||
|
|
||||||
|
|
||||||
NS_IETF_XMPP_SASL = 'urn:ietf:params:xml:ns:xmpp-sasl'
|
NS_IETF_XMPP_SASL = 'urn:ietf:params:xml:ns:xmpp-sasl'
|
||||||
NS_IETF_XMPP_TLS = 'urn:ietf:params:xml:ns:xmpp-tls'
|
NS_IETF_XMPP_TLS = 'urn:ietf:params:xml:ns:xmpp-tls'
|
||||||
NS_IETF_XMPP_STREAMS = 'urn:ietf:params:xml:ns:xmpp-streams'
|
NS_IETF_XMPP_STREAMS = 'urn:ietf:params:xml:ns:xmpp-streams'
|
||||||
NS_JABBER_CAPS = 'http://jabber.org/protocol/caps'
|
NS_JABBER_CAPS = 'http://jabber.org/protocol/caps'
|
||||||
NS_ETHERX_STREAMS = 'http://etherx.jabber.org/streams'
|
NS_ETHERX_STREAMS = 'http://etherx.jabber.org/streams'
|
||||||
|
@ -215,7 +218,8 @@ class Xmpp(nagiosplugin.Resource):
|
||||||
rready, wready, xready = select([self.socket], [], [], timeout)
|
rready, wready, xready = select([self.socket], [], [], timeout)
|
||||||
if self.socket in rready:
|
if self.socket in rready:
|
||||||
data = self.socket.recv(4096)
|
data = self.socket.recv(4096)
|
||||||
if not data: break
|
if not data:
|
||||||
|
break
|
||||||
chunks.append(data)
|
chunks.append(data)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
@ -357,7 +361,8 @@ class DaysValidContext(nagiosplugin.Context):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, name, warndays=0, critdays=0,
|
self, name, warndays=0, critdays=0,
|
||||||
fmt_metric='certificate expires in {value} days'):
|
fmt_metric='certificate expires in {value} days'
|
||||||
|
):
|
||||||
super(DaysValidContext, self).__init__(name, fmt_metric=fmt_metric)
|
super(DaysValidContext, self).__init__(name, fmt_metric=fmt_metric)
|
||||||
self.warning = nagiosplugin.Range('@%d:' % warndays)
|
self.warning = nagiosplugin.Range('@%d:' % warndays)
|
||||||
self.critical = nagiosplugin.Range('@%d:' % critdays)
|
self.critical = nagiosplugin.Range('@%d:' % critdays)
|
||||||
|
|
Loading…
Reference in a new issue