My own plugins for Munin
This small repository contains some tiny plugins (written in Bash or Python), for the Munin monitoring tool.
Despite a very rich plugin collection, I found some that could be missing to someone (well, at least to me), so I decided to write them. See below for a list of the plugins I wrote (tiny, and probably bugged), and how to install them.
In a classic Ubuntu or Debian Linux environment, with Munin correctly installed with the default folder configuration, the following commands will git clone my repository:
cd ~/.local/etc/munin/ # A certain directory, you can use some place else
git clone https://github.com/Naereen/My-Munin-plugins ./My-Munin-plugins.git/ # Clone my repo
cd ./My-Munin-plugins.git/ # Go to this directory
2. Then install or activate the plugins you want
Then, pick the plugins you like in this folder, and install them or activate them.
For instance, if you want to intall the plugin number_of_plugins.sh
, then in the good folder (see step 1) do:
# Be sure it is executable
chmod 755 number_of_plugins.sh # By default they should all be executable
# Then symlink it to /etc/munin/plugins/
sudo ln -s ${PWD}/number_of_plugins.sh /etc/munin/plugins/nb_of_plugins
You can (and should) then check that the plugin works:
$ munin-run nb_of_plugins # Gives the number of plugin currently activated
plugins.value 34
myplugins.value 5
You can repeat these two steps for every plugins you want to install.
Note: you can also use the provided Makefile
to install one or all plugins:
make install__tmux # Ask for sudo password and install tmux.sh to /etc/munin/plugins/tmux
make install_all # Ask for sudo password and install all my plugins to /etc/munin/plugins/
- Number of open tabs, windows and panes in tmux ? Done, see
tmux.sh
, it works but works even better ifuser
is well configured (see below). - Number of open graphical programs and open windows in your window manager ? Done, see
gui_windows.sh
, it works only ifuser
is well configured (see below). - Number of open tabs, windows and panes in Sublime Text 3 ? It was harder... I created this tiny ST3 plugin (
number_tabs.py
, to install in yourPackages/User
directory), in order to have a ST3 commandnumber_tabs
. Then the scriptnumber_st3_tabs.sh
calls it withsubl --background --command number_tabs
from the command line... FIXME do it better? - Number of documents and number of pages printed by my laptop ? In progress, see
nb_printed_documents.sh
. FIXME Should already be available from this list! - Number of channels, users, groups and active users for a Slack team ? Done with this Python file that accesses the Slack API and this Bash file that prints the config or values.
Edit your munin-node
configuration file to specify the configuration.
Currently, tmux.sh
and gui_windows.sh
need to be ran from the user $USER
(ie, you) and not munin
:
[tmux]
user lilian # adapt to your own username
[gui_windows]
user lilian # adapt to your own username
I would like to be able to use Munin to monitor:
-
Number of songs played from morning and number of songs currently in the waiting list, for my music player GMusicBrowser ? (by @squentin)It seems impossible... (I explored the cli API of GMusicBrowser and it seems unachievable) -
Number of open tabs and windows in Firefox ?It seems impossible... - Volume of the main sound card? Seems possible. But useless?
- Number of USB peripherics connected? Completely useless.
- Local weather, or temperature of my home?
- ... And you, do you have any other idea?
- For more details on Munin, see the official website, www.munin-monitoring.org, and the documentation, guide.munin-monitoring.org.
- A good introductory page is plugin/writing.html on the new Munin guide.
- Fore more details on Munin plugins, see first this page (wiki/plugins), then the reference, and if needed the older pages PluginShell, or PluginConcise or HowToWritePlugins on the Munin wiki.
Other self-quantified projects ?
- uLogMe: keep track of your computer activity throughout the day: visualize your active window titles and the number and frequency of keystrokes, in beautiful and responsive HTML timelines.
selfspy
: log everything you do on the computer, for statistics, future reference and all-around fun. I also worked a little bit on selfspy-vis, some tools to visualize the data collected byselfspy
.- My minimalist dashboard, generated every hour (with a
crontab
file), with this bash scriptGenerateStatsMarkdown.sh
.
MIT Licensed (file LICENSE). ยฉ Lilian Besson, 2016.