nagios: Remove check for supybot fedmsg plugin
Zodbot no longer has fedmsg plugin installed - supybot-fedmsg package is not installed on value02 (RHEL 8) and supybot-fedmsg upstream project on GitHub has been archived.
This commit is contained in:
parent
b7fb1b1faf
commit
26c38caafa
6 changed files with 0 additions and 235 deletions
|
@ -1,111 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
""" check_supybot_plugin -- ensure that a plugin is loaded by supybot.
|
||||
|
||||
Run like:
|
||||
|
||||
check_supybot_plugin --target fedmsg
|
||||
check_supybot_plugin --target koji --debug
|
||||
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
from builtins import str
|
||||
from builtins import map
|
||||
import argparse
|
||||
import sys
|
||||
import socket
|
||||
import string
|
||||
import uuid
|
||||
|
||||
|
||||
def process_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'-t', '--target', default=None, dest='target',
|
||||
help="Required. The plugin we're looking for."
|
||||
)
|
||||
parser.add_argument(
|
||||
'-n', '--nick', default=None, dest='nick',
|
||||
help="NICK to use when connecting to irc.",
|
||||
)
|
||||
parser.add_argument(
|
||||
'-d', '--debug', default=False, action='store_true',
|
||||
help='Print out debug information.', dest='debug',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-H', '--host', default='irc.libera.chat',
|
||||
help='Host to connect to.', dest='host',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-p', '--port', default=6667, type=int,
|
||||
help='Host to connect to.', dest='port',
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
args = process_args()
|
||||
|
||||
# Use a random nick so people can't mess with us
|
||||
if not args.nick:
|
||||
args.nick = 'nrpe-' + str(uuid.uuid4()).split('-')[0]
|
||||
|
||||
name = "NRPE Bot"
|
||||
readbuffer = ""
|
||||
|
||||
if not args.target:
|
||||
print("UNKNOWN: No 'target' specified.")
|
||||
sys.exit(3)
|
||||
|
||||
args.target = args.target.lower()
|
||||
|
||||
if args.debug:
|
||||
print("connecting to %s/%i" % (args.host, args.port))
|
||||
|
||||
try:
|
||||
s = socket.socket()
|
||||
s.connect((args.host, args.port))
|
||||
|
||||
if args.debug:
|
||||
print("as %s/%s (%s)" % (args.nick, args.nick, name))
|
||||
|
||||
s.send(("nick %s\r\n" % args.nick).encode())
|
||||
s.send(("USER %s %s bla :%s\r\n" % (args.nick, args.host, name)).encode())
|
||||
|
||||
while 1:
|
||||
readbuffer = readbuffer+s.recv(1024).decode()
|
||||
temp = readbuffer.split("\n")
|
||||
readbuffer = temp.pop()
|
||||
|
||||
for line in temp:
|
||||
line = line.rstrip()
|
||||
|
||||
if args.debug:
|
||||
print(" * ", line)
|
||||
|
||||
line = line.split()
|
||||
|
||||
if line[1] == 'MODE':
|
||||
msg = "privmsg zodbot :list\r\n".encode()
|
||||
if args.debug:
|
||||
print("sending:")
|
||||
print(" ->", msg)
|
||||
s.send(msg)
|
||||
|
||||
if line[0] == ':zodbot!supybot@fedora/bot/zodbot':
|
||||
if args.debug:
|
||||
print("Got our response..")
|
||||
|
||||
plugins = list(map(str.lower, ' '.join(line[3:][1:]).split(', ')))
|
||||
|
||||
if args.target in plugins:
|
||||
print("OK")
|
||||
s.send("QUIT".encode())
|
||||
sys.exit(0)
|
||||
else:
|
||||
print("CRITICAL: %r not loaded by supybot" % args.target)
|
||||
s.send("QUIT".encode())
|
||||
sys.exit(2)
|
||||
except Exception as e:
|
||||
print("UNKNOWN: ", str(e))
|
||||
if args.debug:
|
||||
raise
|
||||
sys.exit(3)
|
|
@ -38,7 +38,6 @@
|
|||
- check_fedmsg_consumer_exceptions.py
|
||||
- check_fedmsg_producer_last_ran.py
|
||||
- check_fedmsg_producers_consumers.py
|
||||
- check_supybot_plugin
|
||||
- check_rabbitmq_size
|
||||
- check_datanommer_timesince.py
|
||||
- check_memcache_connect
|
||||
|
@ -144,7 +143,6 @@
|
|||
- check_fedmsg_composer_proc.cfg
|
||||
- check_redis_proc.cfg
|
||||
- check_fedmsg_consumers.cfg
|
||||
- check_supybot_fedmsg_plugin.cfg
|
||||
- check_datanommer_history.cfg
|
||||
- check_memcache.cfg
|
||||
- check_lock_file_age.cfg
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
command[check_supybot_fedmsg_plugin]={{libdir}}/nagios/plugins/check_supybot_plugin -t fedmsg
|
|
@ -1,111 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
""" check_supybot_plugin -- ensure that a plugin is loaded by supybot.
|
||||
|
||||
Run like:
|
||||
|
||||
check_supybot_plugin --target fedmsg
|
||||
check_supybot_plugin --target koji --debug
|
||||
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
from builtins import str
|
||||
from builtins import map
|
||||
import argparse
|
||||
import sys
|
||||
import socket
|
||||
import string
|
||||
import uuid
|
||||
|
||||
|
||||
def process_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'-t', '--target', default=None, dest='target',
|
||||
help="Required. The plugin we're looking for."
|
||||
)
|
||||
parser.add_argument(
|
||||
'-n', '--nick', default=None, dest='nick',
|
||||
help="NICK to use when connecting to irc.",
|
||||
)
|
||||
parser.add_argument(
|
||||
'-d', '--debug', default=False, action='store_true',
|
||||
help='Print out debug information.', dest='debug',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-H', '--host', default='irc.libera.chat',
|
||||
help='Host to connect to.', dest='host',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-p', '--port', default=6667, type=int,
|
||||
help='Host to connect to.', dest='port',
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
args = process_args()
|
||||
|
||||
# Use a random nick so people can't mess with us
|
||||
if not args.nick:
|
||||
args.nick = 'nrpe-' + str(uuid.uuid4()).split('-')[0]
|
||||
|
||||
name = "NRPE Bot"
|
||||
readbuffer = ""
|
||||
|
||||
if not args.target:
|
||||
print("UNKNOWN: No 'target' specified.")
|
||||
sys.exit(3)
|
||||
|
||||
args.target = args.target.lower()
|
||||
|
||||
if args.debug:
|
||||
print("connecting to %s/%i" % (args.host, args.port))
|
||||
|
||||
try:
|
||||
s = socket.socket()
|
||||
s.connect((args.host, args.port))
|
||||
|
||||
if args.debug:
|
||||
print("as %s/%s (%s)" % (args.nick, args.nick, name))
|
||||
|
||||
s.send(("nick %s\r\n" % args.nick).encode())
|
||||
s.send(("USER %s %s bla :%s\r\n" % (args.nick, args.host, name)).encode())
|
||||
|
||||
while 1:
|
||||
readbuffer = readbuffer+s.recv(1024).decode()
|
||||
temp = str.split(readbuffer, "\n")
|
||||
readbuffer = temp.pop()
|
||||
|
||||
for line in temp:
|
||||
line = str.rstrip(line)
|
||||
|
||||
if args.debug:
|
||||
print(" * ", line)
|
||||
|
||||
line = str.split(line)
|
||||
|
||||
if line[1] == 'MODE':
|
||||
msg = "privmsg zodbot :list\r\n".encode()
|
||||
if args.debug:
|
||||
print("sending:")
|
||||
print(" ->", msg)
|
||||
s.send(msg)
|
||||
|
||||
if line[0] == ':zodbot!supybot@fedora/bot/zodbot':
|
||||
if args.debug:
|
||||
print("Got our response..")
|
||||
|
||||
plugins = list(map(str.lower, ' '.join(line[3:][1:]).split(', ')))
|
||||
|
||||
if args.target in plugins:
|
||||
print("OK")
|
||||
s.send("QUIT".encode())
|
||||
sys.exit(0)
|
||||
else:
|
||||
print("CRITICAL: %r not loaded by supybot" % args.target)
|
||||
s.send("QUIT".encode())
|
||||
sys.exit(2)
|
||||
except Exception as e:
|
||||
print("UNKNOWN: ", str(e))
|
||||
if args.debug:
|
||||
raise
|
||||
sys.exit(3)
|
|
@ -82,15 +82,6 @@ define service {
|
|||
#}
|
||||
|
||||
|
||||
# Odd one, check for the supybot fedmsg plugin
|
||||
define service {
|
||||
host_name value02.iad2.fedoraproject.org
|
||||
service_description Check supybot fedmsg plugin
|
||||
check_command check_by_nrpe!check_supybot_fedmsg_plugin
|
||||
use defaulttemplate
|
||||
}
|
||||
|
||||
|
||||
# BEGIN, check datanommer history
|
||||
define service {
|
||||
host_name busgateway01.iad2.fedoraproject.org
|
||||
|
|
|
@ -335,7 +335,6 @@ command[check_fedmsg_irc_proc]=/usr/lib64/nagios/plugins/check_procs -c 1:1 -C '
|
|||
command[check_fedmsg_tweet_proc]=/usr/lib64/nagios/plugins/check_procs -c 1:1 -C 'fedmsg-tweet' -u fedmsg
|
||||
command[check_fedmsg_composer_proc]=/usr/lib64/nagios/plugins/check_procs -c 1:1 -C 'fedmsg-hub-3' -u apache
|
||||
command[check_fedmsg_odcs_celery_proc]=/usr/lib64/nagios/plugins/check_procs -c 1:1 -C 'odcs-celery-backend ' -u odcs
|
||||
command[check_supybot_fedmsg_plugin]=/usr/lib64/nagios/plugins/check_supybot_plugin -t fedmsg
|
||||
command[check_haproxy_conns]=/usr/lib64/nagios/plugins/check_haproxy_conns.py
|
||||
command[check_redis_proc]=/usr/lib64/nagios/plugins/check_procs -c 1:1 -C 'redis-server' -u redis
|
||||
command[check_openvpn_link]=/usr/lib64/nagios/plugins/check_ping -H 192.168.1.41 -w 375.0,20% -c 500,60%
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue