Пример #1
0
    def _poll(self):
        """Query all remote hosts for data.

        Args:
            None

        Returns:
            None

        """
        # Initialize key variables
        pollers = []

        # Create a list of polling objects
        hostnames = self.config.agent_hostnames()

        for hostname in hostnames:
            # Only poll hosts that exist in the database
            if db_host.hostname_exists(hostname) is False:
                log_message = (
                    'Agent "%s": Hostname %s in the configuration file '
                    'does not exist in the database. '
                    'Run the snmp_evaluate_hosts.py script.'
                    '') % (self.agent_name, hostname)
                log.log2warn(1095, log_message)
                continue

            # Add poller
            poller = Poller(hostname, self.agent_name)
            pollers.append(poller)

        # Start threaded polling
        if bool(pollers) is True:
            Agent.threads(self.agent_name, pollers)
Пример #2
0
    def _poll(self):
        """Query all remote hosts for data.

        Args:
            None

        Returns:
            None

        """
        # Initialize key variables
        pollers = []

        # Create a list of polling objects
        hostnames = self.agent_config.agent_hostnames()

        for hostname in hostnames:
            # Add poller
            poller = Poller(
                hostname, self.agent_config,
                self.server_config, self.snmp_config)
            pollers.append(poller)

        # Start threaded polling
        if bool(pollers) is True:
            Agent.threads(self.agent_name, pollers)