Пример #1
0
    def add_heartbeat(self, heartbeat, host=None):
        """ create a heartbeat unique metric to send to zagg """

        if not host:
            host = self.host

        hb_metric = UniqueMetric.create_heartbeat(host,
                                                  heartbeat.templates,
                                                  heartbeat.hostgroups,
                                                 )
        self.unique_metrics.append(hb_metric)
Пример #2
0
    def add_heartbeat(self, heartbeat, host=None):
        """ create a heartbeat unique metric to send to zagg """

        if not host:
            host = self.host

        hb_metric = UniqueMetric.create_heartbeat(host,
                                                  heartbeat.templates,
                                                  heartbeat.hostgroups,
                                                 )
        self.unique_metrics.append(hb_metric)
    def run(self):
        """Runs through each defined target in the config file and sends a heartbeat

        Args: None
        Returns: None
        """
        for target in self.config['targets']:
            mm = MetricManager(target['path'])

            hostname = socket.gethostname()
            myhb = UniqueMetric.create_heartbeat(hostname, ['Template Heartbeat'], ['Linux servers'])

            print 'Writing heartbeat to %s/%s' % (target['path'], myhb.filename)
            mm.write_metrics(myhb)
    def run(self):
        """Runs through each defined target in the config file and sends a heartbeat

        Args: None
        Returns: None
        """
        for target in self.config["targets"]:
            mm = MetricManager(target["path"])

            hostname = socket.gethostname()
            myhb = UniqueMetric.create_heartbeat(hostname, self.config["templates"], self.config["hostgroups"])

            print "Writing heartbeat to %s/%s" % (target["path"], myhb.filename)
            mm.write_metrics(myhb)
    def run(self):
        """Runs through each defined target in the config file and sends a heartbeat

        Args: None
        Returns: None
        """
        for target in self.config['targets']:
            mm = MetricManager(target['name'])

            hostname = socket.gethostname()
            myhb = UniqueMetric.create_heartbeat(hostname,
                                                 self.config['templates'],
                                                 self.config['hostgroups'])

            print 'Writing heartbeat to %s' % (target['name'])
            mm.write_metrics(myhb)