Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
From: alex@alexschroeder.ch
To: galene@lists.galene.org
Subject: [Galene] Munin stats
Date: Sat, 12 Apr 2025 23:02:32 +0000	[thread overview]
Message-ID: <67179dbc55aec8f225e3c4ea57078ec1594a995e@alexschroeder.ch> (raw)

OK, this made me laugh:

~ $ curl https://campaignwiki.org:8443/galene-api/v0/.stats
Haha!

It would be better to tell people to authenticate as a user in data/config.json, however. It took me a moment to understand why I was seeing the message.

In any case, I'm currently experimenting with writing Munin plugin for Galène.
Munin is a networked resource monitoring tool. https://munin-monitoring.org/

If you run the following plugin using "munin-run galene", it will print something like the following:

channels.value 1
clients.value 2

curl and jq are required.




#!/bin/sh
# -*- sh -*-

: <<=cut

=head1 NAME

galene - Munin plugin to monitor number of rooms and clients on a Galène server.

=head1 USAGE

This plugin connects to a Galène server.

It requires curl and jq.

=head1 CONFIGURATION

There is no default configuration.  This is an example:

    [galene]
    env.host campaignwiki.org
    env.port 8443
    env.user root
    env.password secret

=head1 AUTHOR

Alex Schroeder

=head1 LICENSE

CC0, dedicated to the public domain

=head1 MAGIC MARKERS

  #%# family=manual

=cut

. "$MUNIN_LIBDIR/plugins/plugin.sh"

if [ "$1" = "autoconf" ]; then
	if [ -z "$host" ]; then
		echo "no (Configuration required)"
		exit 0
	fi

	echo yes
	exit 0
fi

if [ -z "$host" ] || [ -z "$port" ] || [ -z "$user" ] || [ -z "$password" ]; then
  echo "Configuration required"
  exit 1
fi

if [ "$1" = "config" ]; then

        echo "graph_title Galène status - $host:$port"
        echo "graph_category chat"
        echo "graph_order clients channels"
        echo "graph_args -l 0"
        echo "clients.label clients"
        echo "clients.draw LINE2"
        echo "channels.label channels"
        echo "channels.draw LINE2"
	exit 0
fi

data=$(curl --silent --user "$user:$password" "https://$host:$port/galene-api/v0/.stats")
channels=$(echo "$data" | jq '.|length')
echo "channels.value $channels"
clients=$(echo "$data" | jq '[.[].clients|length]|add')
echo "clients.value $clients"

                 reply	other threads:[~2025-04-12 23:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.galene.org/postorius/lists/galene.lists.galene.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67179dbc55aec8f225e3c4ea57078ec1594a995e@alexschroeder.ch \
    --to=alex@alexschroeder.ch \
    --cc=galene@lists.galene.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox