2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/powermta/powermta_vmta_recpients
Lars Kruse 17f784270a Whitespace cleanup
* remove trailing whitespace
* remove empty lines at the end of files
2018-08-02 02:33:25 +02:00

43 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
vmta="208-97-205-153"
# Lets run the command to pull the vmta's in
queues=(`pmta show queue */$vmta | awk -F" " '{print $1}'`) # Pull in top queues
# Now we need to do some further cleanup for blank or erroneous array items
unset queues[0]
unset queues[${#queues[@]}]
case $1 in
config)
echo "graph_title RGMTA2 PMTA VMTA $vmta Recipents"
echo "graph_vlabel recipents"
echo "graph_scale no"
echo "graph_category mail"
for i in ${queues[@]};do
queue=(`pmta show queue $i`)
unset queue[0]
unset queue[${#queue[@]}]
domain=`echo "${queue[7]}" | awk -F" " '{print $1}' | cut -d/ -f1 | sed -e 's/[\.]/_/g'`
domain2=`echo "${queue[7]}" | awk -F" " '{print $1}' | cut -d/ -f1`
echo $domain'.label '$domain2
echo $domain'.draw STACK'
done
exit 0;;
esac
for i in ${queues[@]};do
queue=(`pmta show queue $i`)
unset queue[0]
unset queue[${#queue[@]}]
domain=`echo "${queue[7]}" | awk -F" " '{print $1}' | cut -d/ -f1 | sed -e 's/[\.]/_/g'`
recpts=${queue[8]}
conns=${queue[10]}
echo $domain'.value '$recpts
done