示例#1
0
    def __init__(self, *args, **kwargs):
        super(NagiosPluginHTTP, self).__init__(*args, **kwargs)

        self.http = ProbeHTTP(hostaddress=self.options.hostname,
                              port=self.options.port,
                              ssl=self.options.ssl,
                              auth=self.options.auth)

        if 'NagiosPluginHTTP' == self.__class__.__name__:
            logger.debug('=== END PLUGIN INIT ===')
示例#2
0
 def test_xml_find_tag(self):
     """Test fetching a XML file and find a tag in it."""
     http = ProbeHTTP("wweasapp0611.eas.ww.corp")
     response = http.get("/wweasapp0611.xml")
     xml = response.xml()
     self.assertTrue(xml.alert.last_update)
示例#3
0
 def test_xml_parser_init(self):
     """Test fetching a XML file and parsing it."""
     http = ProbeHTTP("wweasapp0611.eas.ww.corp")
     response = http.get("/wweasapp0611.xml")
     self.assertIsInstance(response.xml(), BeautifulSoup)
示例#4
0
 def test_http_post(self):
     """Test HTTP POST request."""
     http = ProbeHTTP("httpbin.org")
     http_get_response = http.post("/post", data={"hello": "world"})
     self.assertTrue(http_get_response.status_code == 200)
示例#5
0
 def test_probe_auth(self):
     """Test HTTP probe auth."""
     http = ProbeHTTP("wwgrpapp0061.ww.corp",
                      auth=('9nagios', 'PassNAD9@!@'))
     http_get_response = http.get("/")
     self.assertTrue(http_get_response.status_code == 200)
示例#6
0
 def setUp(self):
     self.http = ProbeHTTP("monitoring-dc.app.corp")