#!/bin/sh : << =cut =head1 NAME file_length_ - Plugin to monitor the length of specified files Useful for things such as lists (white, black, user, ...). =head1 CONFIGURATION [file_length_IDENTIFIER] env.files FILEPATHGLOB1 FILEPATHGLOB2 ... env.category DEFAULTS_TO_system env.title OPTIONAL_TITLE env.logarithmic 1 =head1 AUTHOR Olivier Mehani (based on disk/log_sizes) =head1 LICENSE GPLv2 =head1 MAGIC MARKERS #%# family=manual =cut # needs shellcheck -x /usr/share/munin/plugins/plugin.sh # shellcheck source=/usr/share/munin/plugins/plugin.sh . "$MUNIN_LIBDIR/plugins/plugin.sh" NAME=$(echo "$0" | sed 's/.*_//') TITLE=${title:-File lengths for $NAME} CATEGORY=${category:-system} FILES=${files:-/var/log/messages} # we want globbing to happen here # shellcheck disable=SC2116 disable=SC2086 FILES=$(echo $FILES) if [ "$1" = "config" ] ; then # shellcheck disable=SC2154 if [ "${logarithmic}" = "1" ]; then graph_args="-o" else graph_args="-l 0" fi cat <