cabot/cabotapp/models.py
def format_error_message(self, failure_value, actual_hosts, actual_failures):
        """
        A summary of why the check is failing for inclusion in short alert messages
        Returns something like:
        "5.0 > 4 | 1/2 hosts"
        """
        if isinstance(failure_value, (list, tuple)):
            failure_value = ', '.join([u'%0.1f' % v for v in failure_value])
        else:
            failure_value = u'%0.1f' % failure_value
        hosts_string = u''
        failures_string = u''
        if self.expected_num_hosts > 0:
            hosts_string = u' | %s/%s hosts' % (actual_hosts,
                                                self.expected_num_hosts)
            if self.expected_num_hosts > actual_hosts:
                return u'Hosts missing%s' % hosts_string
        if self.allowed_num_failures and actual_failures:
            failures_string = u' | %s/%s series failing (%s allowed)' % (
                actual_failures,
                actual_hosts,
                self.allowed_num_failures,
            )
        if failure_value is None:
            return "Failed to get metric from Graphite"
        return u"%s %s %0.1f%s%s" % (
            failure_value,
            self.check_type,
            float(self.value),
            hosts_string,
            failures_string,
        )

        A summary of why the check is failing for inclusion in short alert messages
        Returns something like:
        "5.0 > 4 | 1/2 hosts"
        
A summary of why the check is failing for inclusion in short alert messages
Returns something like:
"5.0 > 4 | 1/2 hosts"
A summary of why the check is failing for inclusion in short alert messages Returns something like : " 5 . 0 > 4 | 1 / 2 hosts "
def format_error_message(self, failure_value, actual_hosts, actual_failures):
        if isinstance(failure_value, (list, tuple)):
            failure_value = ', '.join([u'%0.1f' % v for v in failure_value])
        else:
            failure_value = u'%0.1f' % failure_value
        hosts_string = u''
        failures_string = u''
        if self.expected_num_hosts > 0:
            hosts_string = u' | %s/%s hosts' % (actual_hosts,
                                                self.expected_num_hosts)
            if self.expected_num_hosts > actual_hosts:
                return u'Hosts missing%s' % hosts_string
        if self.allowed_num_failures and actual_failures:
            failures_string = u' | %s/%s series failing (%s allowed)' % (
                actual_failures,
                actual_hosts,
                self.allowed_num_failures,
            )
        if failure_value is None:
            return "Failed to get metric from Graphite"
        return u"%s %s %0.1f%s%s" % (
            failure_value,
            self.check_type,
            float(self.value),
            hosts_string,
            failures_string,
        )
def format_error_message ( self , failure_value , actual_hosts , actual_failures ) : if isinstance ( failure_value , ( list , tuple ) ) : failure_value = ', ' . join ( [ u'%0.1f' % v for v in failure_value ] ) else : failure_value = u'%0.1f' % failure_value hosts_string = u'' failures_string = u'' if self . expected_num_hosts > 0 : hosts_string = u' | %s/%s hosts' % ( actual_hosts , self . expected_num_hosts ) if self . expected_num_hosts > actual_hosts : return u'Hosts missing%s' % hosts_string if self . allowed_num_failures and actual_failures : failures_string = u' | %s/%s series failing (%s allowed)' % ( actual_failures , actual_hosts , self . allowed_num_failures , ) if failure_value is None : return "Failed to get metric from Graphite" return u"%s %s %0.1f%s%s" % ( failure_value , self . check_type , float ( self . value ) , hosts_string , failures_string , )
A summary of why the check is failing for inclusion in short alert messages
Returns something like:
"5.0 > 4 | 1/2 hosts"
A summary of why the check is failing for inclusion in short alert messages Returns something like : " 5 . 0 > 4 | 1 / 2 hosts "
"""
        A summary of why the check is failing for inclusion in short alert messages
        Returns something like:
        "5.0 > 4 | 1/2 hosts"
        """
self
failure_value
actual_hosts
actual_failures