From 9b8623381f803b97f99570362b8dfbd1053113fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Fri, 20 Mar 2020 11:44:40 +0100 Subject: [PATCH] Add munin plugin for monitoring --- CHANGELOG.md | 4 +++ munin/mm-plugin | 61 ++++++++++++++++++++++++++++++++++++++++++++ munin/mm-plugin-conf | 2 ++ munin/munin.md | 42 ++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100755 munin/mm-plugin create mode 100644 munin/mm-plugin-conf create mode 100644 munin/munin.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 3372233..7124931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### Next Version + * Add munin plugin + * Add muted=true search param to disble audio by deffault + ### 3.1 * Browser session storage * Virtual lobby for rooms diff --git a/munin/mm-plugin b/munin/mm-plugin new file mode 100755 index 0000000..d319ad1 --- /dev/null +++ b/munin/mm-plugin @@ -0,0 +1,61 @@ +#!/bin/sh + +# -*- sh -*- + +: << =cut + +=head1 NAME + +turn - Plugin to monitor the turn server test probe. + +=head1 CONFIGURATION + +No configuration + +=head1 AUTHOR + +Unknown author + +=head1 LICENSE + +GPLv2 + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + +=cut + +. "$MUNIN_LIBDIR/plugins/plugin.sh" + +if [ "$1" = "autoconf" ]; then + if [ -r /proc/sys/kernel/random/entropy_avail ]; then + echo yes + exit 0 + else + echo no + exit 0 + fi +fi + +if [ "$1" = "config" ]; then + echo 'graph_title MM stats' + #echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel Actual Seesion Count' + echo 'graph_category other' + echo 'graph_info This graph shows the mm stats.' + echo 'rooms.label rooms' + echo 'rooms.info The count of rooms.' + echo 'peers.label peers' + echo 'peers.info The count of peers.' + exit 0 +fi + +ROOMS=`docker exec -t mm_mm_1 /opt/multiparty-meeting/server/connect.js --stats | grep 'rooms' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | sed -E 's/rooms:([0-9]+)/\1/g'` +PEERS=`docker exec -t mm_mm_1 /opt/multiparty-meeting/server/connect.js --stats | grep 'peers' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | sed -E 's/peers:([0-9]+)/\1/g'` + +echo "rooms.value ${ROOMS}" +echo "peers.value ${PEERS}" + +: diff --git a/munin/mm-plugin-conf b/munin/mm-plugin-conf new file mode 100644 index 0000000..3053f56 --- /dev/null +++ b/munin/mm-plugin-conf @@ -0,0 +1,2 @@ +[mm] +user root diff --git a/munin/munin.md b/munin/munin.md new file mode 100644 index 0000000..a964e2f --- /dev/null +++ b/munin/munin.md @@ -0,0 +1,42 @@ +# Install a munin plugin, as a very basic monitoring + +## munin-node + +* install on your docker host munin-node on mm.example.com + + ``` + apt install munin-node + ``` + +* Copy mm-plugin from this directory to plugins dir as mm + + cp mm-plugin /usr/share/munin/plugins/mm + + ``` + sudo ln -s /usr/share/munin/plugins/mm /etc/munin/plugins/mm + ``` + +Copy mm-plugin-conf from this directory to munin plugins conf dir as mm + +copy mm-plugin-conf as to /etc/munin/plugin-conf.d +``` +cp mm-plugin-conf /etc/munin/plugin-conf.d/mm +``` + +Restart munin +``` +systemctl restart munin-node +``` + +# munin master +Install a munin master on different host if you don't have munin already. +``` +apt install munin +``` + +On your munin master configure the new node +edit and add to /etc/munin.conf +``` +[mm] + mm.example.com +``` \ No newline at end of file