The following is the GNU All-permissive License as recommended in https://www.gnu.org/licenses/license-recommendations.en.html

Copyright (C) 2024 Free Software Foundation sysadmin@fsf.org

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See https://savannah.gnu.org/maintenance/fsf/.

munin install for client

set up according to:

http://cluestick/wiki/Munin#Munin

on client (using jabserver2p.fsf.org as an example):

apt-get install munin-node

vim /etc/munin/munin-node.conf
+host_name jabserver2p.fsf.org
+#bernie/sudoman: office NAT gateway for monitor.office.fsf.org
+allow ^74\.94\.156\.210$

cd /etc/munin/plugins
rm -f threads if_err_eth0 fw_packets swap users exim_* entropy open_files open_inodes

vim /etc/munin/plugin-conf.d/munin-node
+[diskstats]
+user root
+env.graph_width 640

service munin-node restart

on monitor.office.fsf.org:

nc jabserver2p.fsf.org 4949
^D

vim /etc/munin/munin-conf.d/domU_jabserver2p.fsf.org.conf
[domU;jabserver2p.fsf.org]
        address jabserver2p.fsf.org

custom graphs

ssh'd into the target machine, in a script like: /etc/munin/plugins/foo_bar with permissions 750 and ownership root:munin if it contains a password:

#! /bin/bash

function config() {
        cat <<'EOM'
graph_title CiviCRM Contact Count
graph_vlabel contacts
civicrm_contacts.label CiviCRM contacts
EOM
        exit 0
}

# don't use the leading backslash for the source code version of this line. it's just for ikiwiki formatting
[[ $1 == "config" ]] && config

count="$(echo "select count(*) from civicrm_contact;" | mysql -u munin -pFOO civicrm | tail -n +2)"

echo "civicrm_contacts.value ${count}"

Give the munin user select access on the id column of the table you're accessing:

...
GRANT SELECT (id) ON civicrm_contact TO munin@localhost;
...

Start using the new script:

systemctl restart munin-node.service
systemctl status munin-node.service

vim /var/log/munin/munin-node.log

Script

There is a script in /home/common that can download all of the graphs with day, week, month, and year views.

/home/common/sysadmin/munin-year.sh

This is helpful for getting a wider view or sharing data with an external community admin.