Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
* [Galene] Munin stats
@ 2025-04-12 23:02 alex
  0 siblings, 0 replies; only message in thread
From: alex @ 2025-04-12 23:02 UTC (permalink / raw)
  To: galene

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"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-12 23:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-12 23:02 [Galene] Munin stats alex

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox