1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Add support for configurable thresholds to nullmailer_queue plugin

This commit is contained in:
Knut Arne Bjørndal 2018-11-28 16:11:02 +01:00
parent e48f0a3b79
commit aa009f6093

View file

@ -18,18 +18,22 @@ will need to run as that user or root.
Additionally, the nullmailer queue directory may vary; in that case you Additionally, the nullmailer queue directory may vary; in that case you
can specify it with the "queuedir" and "errordir" environment variables. can specify it with the "queuedir" and "errordir" environment variables.
To add extra warning or critical thresholds set queue_warning,
failed_critical etc.
Example: Example:
[nullmailer_queue] [nullmailer_queue]
user nullmail user nullmail
env.queuedir /var/spool/nullmailer/queue env.queuedir /var/spool/nullmailer/queue
env.errordir /var/spool/nullmailer/failed env.errordir /var/spool/nullmailer/failed
env.queue_warning 10
=head1 INTERPRETATION =head1 INTERPRETATION
This plugin will draw a stack of 2: the number of emails in the queue, and This plugin will draw a stack of 2: the number of emails in the queue, and
the number of emails that have permanently failed sending. The latter has the number of emails that have permanently failed sending. The latter has
a warning attached, since those should never happen. a warning attached by default, since those should never happen.
=head1 MAGIC MARKERS =head1 MAGIC MARKERS
@ -50,9 +54,13 @@ GPLv2
=cut =cut
. $MUNIN_LIBDIR/plugins/plugin.sh
queuedir=${queuedir:-/var/spool/nullmailer/queue} queuedir=${queuedir:-/var/spool/nullmailer/queue}
errordir=${errordir:-/var/spool/nullmailer/failed} errordir=${errordir:-/var/spool/nullmailer/failed}
failed_warning=${failed_warning:-0:0}
case $1 in case $1 in
autoconf) autoconf)
if command -v nullmailer-queue >/dev/null 2>/dev/null; then if command -v nullmailer-queue >/dev/null 2>/dev/null; then
@ -76,9 +84,12 @@ queue.info Number of emails currently in the queue
failed.label failed failed.label failed
failed.draw AREASTACK failed.draw AREASTACK
failed.warning 0:0
failed.info Number of emails that have permanently failed to send failed.info Number of emails that have permanently failed to send
EOF EOF
print_warning queue
print_critical queue
print_warning failed
print_critical failed
;; ;;
*) *)