Ejemplo n.º 1
0
    def get(self):
        if controllers.urlCheck() == "UP" and controllers.lastStatus() == "down" or controllers.lastStatus() == None:
            Report(status = "up").put()
            controllers.sendMail(config.SUBJECT_STATUS_UP)
        elif controllers.urlCheck() == "UP" and controllers.lastStatus() == "up":
            pass
        elif controllers.urlCheck() == "DOWN" and controllers.lastStatus() == "up" or controllers.lastStatus() == None:
            Report(status = "down").put()
            controllers.sendMail(config.SUBJECT_STATUS_DOWN)
        elif controllers.urlCheck() == "DOWN" and controllers.lastStatus() == "down":
            pass

        return webapp2.redirect('/')
Ejemplo n.º 2
0
    def get(self):
        template_values = {
            'url_check': controllers.urlCheck(),
            'last_status': controllers.lastStatus()
        }

        template = jinja_environment.get_template('views/index.html')
        self.response.out.write(template.render(template_values))