0
我試圖設置一個報警系統,如果有些實例沒有報警,它將發出電子郵件。但對於一些測試實例,我不希望它們包含在內,所以我會在其中添加一個「NoAlarms」標記。我想在我現有的python腳本中添加此功能。如何使用python獲取所有沒有特定標籤的mysql實例?
這基本上是我現在擁有的。
from RDSFunctions import GetListRDSEndpoints
from RDSFunctions import GetListRDSIdentifiers
from boto.ec2.cloudwatch import CloudWatchConnection
from SMTPMail import SendSMTPMail
from boto import ec2
lst_instances = GetListRDSIdentifiers(accesskey, secretkey)
lst_expected_alarms = []
for inst in lst_instances:
if "relprac" not in inst.lower():
lst_expected_alarms.append(inst + ' - ' + 'CPUUtilization')
由於我們使用RDS這些實例並不EC2,我應該怎麼辦,發現沒有「NoAlarms」標籤的所有實例?