Пример #1
0
 def _send_monitor_email(self, anti_item_content):
     local_ip = get_localhost_ip()
     # send email
     subject = "[%s] Auti-Item existed in MySQL according to Galera way" % options.sitename
     body = anti_item_content + "\nip:" + local_ip
     if options.send_email_switch:
         send_email(options.admins, subject, body)
    def _send_log_info_email(self, subject, content):
        local_ip = get_localhost_ip()
        # send email
        #         body = self.render_string("errors/500_email.html", exception=content)

        body = content + "\nip:" + local_ip

        if options.send_email_switch:
            send_email(options.admins, subject, body)
 def _send_error_email(self, exception):
     try:
         # send email
         subject = "[%s]Internal Server Error" % options.sitename
         host_ip = get_localhost_ip()
         version_str = '{0}-{1}'.format(__app__, __version__)
         exception += "\n" + version_str + "\nhost ip :" + host_ip
         if options.send_email_switch:
             send_email(options.admins, subject, exception + '')
     except Exception:
         logging.error(traceback.format_exc())
Пример #4
0
    def _send_error_email(self, exception):
        try:
            # send email
            subject = "[%s]Internal Server Error" % options.sitename
            #            body = self.render_string("errors/500_email.html", exception=exception)

            #            email_from = "%s <noreply@%s>" % (options.sitename, options.domain)
            if options.send_email_switch:
                send_email(options.admins, subject, exception)
        except Exception:
            logging.error(traceback.format_exc())
Пример #5
0
    def _send_error_email(self, exception):
        try:
            local_ip = get_localhost_ip()
            version_str = '{0}-{1}'.format(__app__, __version__)
            logging.info("version_str :" + str(version_str))
            # send email
            subject = "[%s]Internal Server Error " % options.sitename
            body = "{0}\n{1}\nip:{2}".format(exception, version_str, local_ip)

            #            email_from = "%s <noreply@%s>" % (options.sitename, options.domain)
            if options.send_email_switch:
                send_email(options.admins, subject, body)
        except Exception:
            logging.error(traceback.format_exc())