Skip to content
Snippets Groups Projects
Commit 972ee450 authored by drebs's avatar drebs
Browse files

remove all traces of mumble

refs nbits/ea/org#853
parent 56b02b16
Branches
No related tags found
Loading
Checking pipeline status
#!/usr/bin/env python3
# Based in: https://wiki.mumble.info/wiki/Protocol
import argparse
import os
import socket
import struct
import sys
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('host', help='the mumble host to check')
parser.add_argument('port', type=int, nargs='?', default=64738, help='the port where mumble is listening')
args = parser.parse_args()
return args
def main(host, port):
sent_id = struct.unpack('q', os.urandom(8))[0]
data = struct.pack(">iq", 0, sent_id)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(5)
try:
sock.sendto(data, (host, port))
response = sock.recv(24)
version, recv_id, users, max, bw = struct.unpack(">iqiii", response)
assert sent_id == recv_id, "sent and received ids don't match"
output = "Version: {}".format(version)
output += ", Current users: {}".format(users)
output += ", Max users: {}".format(max)
output += ", Max bw: {}".format(bw)
print(output)
except Exception as e:
print("Error: {}".format(str(e)))
sys.exit(2)
if __name__ == "__main__":
args = parse_args()
main(args.host, args.port)
......@@ -159,39 +159,6 @@ class profile::monitoring::checkcommands {
require => File['/usr/local/bin/check_borg_log'],
}
### Mumble
file { '/usr/local/bin/check_mumble':
ensure => file,
source => 'puppet:///modules/profile/monitoring/check_mumble',
owner => 'root',
group => 'root',
mode => '0755',
}
icinga2::object::checkcommand{ 'mumble':
command => [ '/usr/local/bin/check_mumble' ],
arguments => {
'-a' => {
value => '$address$',
order => 1,
required => true,
repeat_key => false,
skip_key => true,
},
'-p' => {
value => '$port$',
order => 2,
required => true,
repeat_key => false,
skip_key => true,
},
},
vars => { port => '64738', },
target => '/etc/icinga2/conf.d/checkcommands.conf',
require => File['/usr/local/bin/check_mumble'],
}
### needrestart
ensure_packages([ 'needrestart' ])
......
# Install Mumble
class profile::mumble {
ensure_packages(['mumble-server'])
service { 'mumble-server':
ensure => 'running',
}
include profile::mumble::firewall
}
# Allow inbound Mumble traffic
class profile::mumble::firewall () {
['tcp', 'udp'].each | String $proto | {
firewall { "100 accept inbound ${proto.upcase()} on Mumble port":
dport => [ 64738 ],
proto => $proto,
action => 'accept',
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment