Example #1
0
    def setUp(self):
        '''
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        '''
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]['id']
            self.agentkey = agents[0]['key']
            self.platform = agents[0]['platform']

            self.temp_str = 'test_' + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                'agentkey': self.agentkey,
                'platform': self.platform,
                'free_limit': 2000,
                'free_swap_limit': 1000,
                'buffered_limit': 3000,
                'free_virtual_limit': 3000,
                'cached_limit': 3000,
                'name': self.temp_str,
                'tag': self.temp_str}
            mon = memory.add_memory_monitor(**args)
            self.test_id = mon['data']['testId']
        else:
            self.agent_id = None
Example #2
0
    def setUp(self):
        """
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        """
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]["id"]
            self.agentkey = agents[0]["key"]
            self.platform = agents[0]["platform"]

            self.temp_str = "test_" + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                "agentkey": self.agentkey,
                "idle_min": 0,
                "io_wait_max": 100,
                "kernel_max": 100,
                "nice_max": 100,
                "used_max": 100,
                "name": self.temp_str,
                "tag": self.temp_str,
            }
            mon = cpu.add_cpu_monitor(**args)
            self.test_id = mon["data"]["testId"]
        else:
            self.agent_id = None
Example #3
0
    def setUp(self):
        '''
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        '''
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]['id']
            self.agentkey = agents[0]['key']
            self.platform = agents[0]['platform']

            self.temp_str = 'test_' + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                'agentkey': self.agentkey,
                'free_limit': 50,
                'drive_letter': 'C',
                'name': self.temp_str,
                'tag': self.temp_str
            }
            mon = drive.add_drive_monitor(**args)
            self.test_id = mon['data']['testId']
        else:
            self.agent_id = None
Example #4
0
    def setUp(self):
        '''
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        '''
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]['id']
            self.agentkey = agents[0]['key']
            self.platform = agents[0]['platform']

            self.temp_str = 'test_' + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                'user_agent_id': self.agent_id,
                'url': 'mon.itor.us',
                'max_lost': 2,
                'packets_count': 5,
                'packets_size': 32,
                'timeout': 20000,
                'name': self.temp_str,
                'tag': self.temp_str
            }
            mon = ping.add_internal_ping_monitor(**args)
            self.test_id = mon['data']['testId']
        else:
            self.agent_id = None
Example #5
0
    def setUp(self):
        '''
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        '''
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]['id']
            self.agentkey = agents[0]['key']
            self.platform = agents[0]['platform']

            self.temp_str = 'test_' + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                'user_agent_id': self.agent_id,
                'url': 'mon.itor.us',
                'max_lost': 2,
                'packets_count': 5,
                'packets_size': 32,
                'timeout': 20000,
                'name': self.temp_str,
                'tag': self.temp_str
            }
            mon = ping.add_internal_ping_monitor(**args)
            self.test_id = mon['data']['testId']
        else:
            self.agent_id = None
Example #6
0
    def setUp(self):
        '''
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        '''
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]['id']
            self.agentkey = agents[0]['key']
            self.platform = agents[0]['platform']

            self.temp_str = 'test_' + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                'agentkey': self.agentkey,
                'idle_min': 0,
                'io_wait_max': 100,
                'kernel_max': 100,
                'nice_max': 100,
                'used_max': 100,
                'name': self.temp_str,
                'tag': self.temp_str
            }
            mon = cpu.add_cpu_monitor(**args)
            self.test_id = mon['data']['testId']
        else:
            self.agent_id = None
Example #7
0
    def setUp(self):
        '''
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        '''
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]['id']
            self.agentkey = agents[0]['key']
            self.platform = agents[0]['platform']

            self.temp_str = 'test_' + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                'agentkey': self.agentkey,
                'limit1': 8.2,
                'limit5': 9.3,
                'limit15': 9.5,
                'name': self.temp_str,
                'tag': self.temp_str
            }
            mon = loadavg.add_load_average_monitor(**args)
            self.test_id = mon['data']['testId']
        else:
            self.agent_id = None
Example #8
0
 def setUp(self):
     # if there is an existing agent, we can use it
     agents = agent.agents()
     if len(agents) > 0:
         self.agent_id = agents[0]['id']
         self.agent_key = agents[0]['key']
         self.platform = agents[0]['platform']
     else:
         self.test_agent_id = None
Example #9
0
 def setUp(self):
     # if there is an existing agent, we can use it
     agents = agent.agents()
     if len(agents) > 0:
         self.agent_id = agents[0]['id']
         self.agent_key = agents[0]['key']
         self.platform = agents[0]['platform']
     else:
         self.test_agent_id = None
Example #10
0
    def setUp(self):
        '''
        These tests require an existing agent.  We cannot create one
        so work with test monitors on an existing agent if there is one.
        If none is available, then skip the test.
        '''
        Monitis.debug = True
        agents = agent.agents()
        if len(agents) > 0:
            self.agent_id = agents[0]['id']
            self.agentkey = agents[0]['key']
            self.platform = agents[0]['platform']

            self.temp_str = 'test_' + b2a_hex(urandom(4)).upper()

            # need to create a test monitor on the agent
            args = {
                'user_agent_id': self.agent_id,
                'url': 'mon.itor.us',
                'name': self.temp_str,
                'tag': self.temp_str,
                'timeout': 30000,
                'redirect': 1,
                'post_data': 'apiKey%3Dkldfjeur84dfh%26user%3Dmon_user',
                'load_full': 1,
                'http_method': 1,
                'content_match_flag': 1,
                'content_match_string': 'OK',
                'over_ssl': 1,
                'user_auth': 'monUser',
                'pass_auth': 'monPass11'
            }
            mon = http.add_internal_http_monitor(**args)
            self.test_id = mon['data']['testId']
        else:
            self.agent_id = None
Example #11
0
 def test_agents(self):
     # don't have a way to create an agent for the test
     # just make sure there's a list returned
     assert isinstance((agent.agents()), list)
Example #12
0
 def test_agents(self):
     # don't have a way to create an agent for the test
     # just make sure there's a list returned
     assert isinstance((agent.agents()), list)