Check_MK和空白寻呼机通知

我正在使用这个脚本 (见下面的代码片段)从Check_MK发送短信到Twilio。 我已经成功通过手动input一个电话号码进行了testing,但发送到一个组时,没有发送文本。

#!/usr/bin/env python # Send Notifications via SMS (twilio) import os import logging from twilio.rest import TwilioRestClient ACCOUNT_SID = "<<YOUR SID>>" AUTH_TOKEN = "<<YOUR TOKEN>>" if __name__ == '__main__': message = """%(item_type)s - %(type)s %(short_date)s Host: %(host_name)s - %(host_state)s""" % { 'item_type': "SERVICE" if os.environ["NOTIFY_SERVICEDESC"] != '$SERVICEDESC$' else "HOST", 'type': os.environ["NOTIFY_NOTIFICATIONTYPE"], 'short_date': os.environ["NOTIFY_SHORTDATETIME"], 'host_name': os.environ["NOTIFY_HOSTNAME"], 'host_state': os.environ["NOTIFY_HOSTSTATE"] } if os.environ["NOTIFY_SERVICEDESC"] == '$SERVICEDESC$': message = message + "\nOutput: " + os.environ["NOTIFY_HOSTOUTPUT"] else: message = message + "\nService: " + os.environ["NOTIFY_SERVICEDESC"] + " - " + os.environ["NOTIFY_SERVICESTATE"] message = message + "\nOutput: " + os.environ["NOTIFY_SERVICEOUTPUT"] client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN) message = client.messages.create(to=os.environ['NOTIFY_CONTACTPAGER'], from_="<<YOUR FROM NUMBER>>", body=message) 

我使用电子邮件进行testing,向我发送所有variables。 即使我已经在CMK中设置了寻呼机电子邮件,该variables在电子邮件中显示为空白。

  u'larryw': {'alias': u'Larry G. Wapnitsky', 'contactgroups': ['SEV1', 'TWILIO_TEST'], 'disable_notifications': False, 'email': u'[email protected]', 'fallback_contact': False, 'pager': '12125551212'}, 

来自通知的变量