Beispiel #1
0
def main():
    """Process agent data.

    Args:
        None

    Returns:
        None

    """
    # Get configuration
    config_directory = os.environ['INFOSET_CONFIGDIR']
    config = jm_configuration.ConfigServer(config_directory)

    # Do the daemon thing
    while True:
        # Print timestamp
        print(
            datetime.fromtimestamp(
                int(time.time())
            ).strftime('%Y-%m-%d %H:%M:%S')
        )

        # Process Cache
        cache.process(config)
        time.sleep(15)
Beispiel #2
0
    def run(self):
        """Start polling.

        Args:
            None

        Returns:
            None

        """
        # Do the daemon thing
        while True:
            cache.process(self.config)
            time.sleep(60)
Beispiel #3
0
    def query(self):
        """Query all remote hosts for data.

        Args:
            None

        Returns:
            None

        """
        # Do the daemon thing
        while True:
            cache.process(self.agent_name)
            time.sleep(5)

            # Update the PID file timestamp (important)
            update = hidden.Touch()
            update.pid(self.name())