LoginSignup
2
0

More than 3 years have passed since last update.

AWS SESの送信クオータ監視

Last updated at Posted at 2019-06-10

問題

Zabbixを3.0から4.2にアップグレートしてから、SESの送信クオータ監視アイテムが「取得不可」になっていた。
4.2へアップはOS自体が古かったため、そのままではできず最新AMIから構築した。

Amazon Linuxでは基本設置だった「/opt/aws/bin/ses-get-stats.pl 」がAmazon Linux2では見当たらない。
復元が目的だったのでses-get-stats.pl をなんとか復活しようとperlライブラリを入れたり(相当インストール)したが、また足りないメッセージが出る。
やめときなさいことですー

ses-get-stats.plの検索で古い情報しか出てこないところで気づくべきだった。
Amazon Linux2が進化したか他の理由で不用になったはずだと。

# aws ses get-send-quota
{
    "Max24HourSend": 50000.0,
    "MaxSendRate": 14.0,
    "SentLast24Hours": 0.0
}

bash

事前にprofileを設定しておく

#!/bin/bash

export AWS_DEFAULT_REGION="us-east-1"

prm=$1
ret=0

case $1 in
"1")
  ret=`aws ses get-send-quota --profile aws4 | jq '.Max24HourSend'`;;
"2")
  ret=`aws ses get-send-quota --profile aws4 | jq '.SentLast24Hours'`;;
"3")
  ret=`aws ses get-send-quota --profile aws4 | jq '.MaxSendRate'`;;
esac

echo $ret

#aws ses get-send-quota | jq '.SentLast24Hours / .Max24HourSend * 100'

これで余計なスクリプト(perl)は不用になった。

メモ

しかし、これもすでに4年前の書き込み。ということは・・・
ま、いいでしょう。素敵な先輩と出会えたことで。

参照

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0