Ejemplo n.º 1
0
    def test_ping(self):
        n = NagiosWrapper('test_host')
        result = n.local('check_ping')

        self.assertEquals(len(result), 2, 'Ping check should return a dictionary with 2 items')
        self.assertIn('rta', result, 'Ping check should contain rta key')
        self.assertIn('pl', result, 'Ping check should conain pl key')
Ejemplo n.º 2
0
    def test_snmp(self):
        n = NagiosWrapper('test_host')
        result = n.local('check_snmp_mem_used-cached.pl')

        self.assertEquals(len(result), 3, 'Snmp memory check should return a dictionary with 3 items')
        self.assertIn('ram_used', result, 'Snmp memory check should contain ram_used key')
        self.assertIn('cache_used', result, 'Snmp memory check should contain cache_used key')
        self.assertIn('swap_used', result, 'Snmp memory check should contain swap_used key')
        self.assertTrue(all(isinstance(v, float) for v in result.itervalues()),
                        'Snmp memory check check should containt only float values')