#author(“2019-07-04T02:56:36+00:00”,“default:kazuma”,“kazuma”) mackerel

スクリプト [#c039dc34]

 $ sudo cat /etc/mackerel-agent/conf.d/mail_count_sent.sh
 #!/bin/bash
 name="mail.count.sent"
 monitor_time=$(date +%s)
 count=$(sudo cat /var/log/maillog| grep 'status=sent' | awk '{print $12}' | wc -l)
 echo -e "${name}\t${count}\t${monitor_time}"

mackerel-agent.confの設定 [#jfe12502]

 [plugin.metrics.mail_count_sent]
 command = "/etc/mackerel-agent/conf.d/mail_count_sent.sh"