Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(40)  |  Call(40)  |  Derive(0)  |  Import(0)

src/n/a/Nagstamon-HEAD/Nagstamon/Nagstamon/Server/Centreon.py   Nagstamon(Download)
                                         "o":"ah",\
                                         "host_name":host})
            result = self.FetchURL(self.monitor_cgi_url + "/main.php?" + cgi_data, giveback="obj")
            html, error = result.result, result.error
            if error == "":
                                    "time":0})
 
        result = self.FetchURL(self.monitor_cgi_url + "/include/monitoring/status/Hosts/" + self.XML_NDO + "/hostXML.php?"\
                              + cgi_data, giveback="xml")
        xmlobj = result.result
        try:
            if str(self.use_autologin) == "True":
              raw = self.FetchURL(self.monitor_cgi_url + "/index.php?p=101&autologin=1&useralias=" + self.username + "&token=" + self.autologin_key, giveback="raw")
              #p=101&autologin=1&useralias=foscarini&token=8sEvwyEcMt
            else:
              login_data = urllib.urlencode({"useralias" : self.username, "password" : self.password, "submit" : "Login"})
              raw = self.FetchURL(self.monitor_cgi_url + "/index.php",cgi_data=login_data, giveback="raw")
        """
        cgi_data = urllib.urlencode({"p":201})
        result = self.FetchURL(self.monitor_cgi_url + "/main.php?" + cgi_data, cgi_data=urllib.urlencode({"sid":self.SID}), giveback="raw")
        raw, error = result.result, result.error
 

src/n/a/Nagstamon-HEAD/Nagstamon/Nagstamon/Server/Ninja.py   Nagstamon(Download)
        values.update({"cmd_param[_force]": "1"})
 
        self.FetchURL(self.commit_url, cgi_data=urllib.urlencode(values), giveback="raw")
 
 
        values.update({"cmd_param[comment]": comment})
 
        self.FetchURL(self.commit_url, cgi_data=urllib.urlencode(values), giveback="raw")
 
 
        values.update({"cmd_param[duration]": str(hours) + "." + str(minutes)})
 
        self.FetchURL(self.commit_url, cgi_data=urllib.urlencode(values), giveback="raw")
 
 

src/n/a/Nagstamon-HEAD/Nagstamon/Nagstamon/Server/Opsview.py   Nagstamon(Download)
        """
        try:
            result = self.FetchURL(self.monitor_cgi_url + "/cmd.cgi?" + urllib.urlencode({"cmd_typ":"55", "host":host}))
            html = result.result
            start_time = dict(result.result.find(attrs={"name":"starttime"}).attrs)["value"]
            cgi_data = urllib.urlencode({"cmd_typ":"56", "host":host, "service":service})
        url = self.monitor_cgi_url + "/cmd.cgi"
        result = self.FetchURL(url, giveback="raw", cgi_data=cgi_data)
        html = result.result
        # which opsview form action to call
        action = html.split('" enctype="multipart/form-data">')[0].split('action="')[-1]
        # this time cgi_data does not get encoded because it will be submitted via multipart
        # to build value for hidden form field old cgi_data is used
        cgi_data = { "from" : url + "?" + cgi_data, "comment": comment, "starttime": start_time, "endtime": end_time }
        self.FetchURL(self.monitor_url + action, giveback="raw", cgi_data=cgi_data)
                                         "plugin_state":{"up":"0", "down":"1", "unreachable":"2"}[state], "plugin_output":check_output,\
                                         "performance_data":performance_data, "btnSubmit":"Commit"})
            self.FetchURL(url, giveback="raw", cgi_data=cgi_data)
 
        if service != "":
                                         "comment":comment, "submit":"Commit"})
            # running remote cgi command
            self.FetchURL(url, giveback="raw", cgi_data=cgi_data)
 
 

src/n/a/Nagstamon-HEAD/Nagstamon/Nagstamon/Server/Icinga.py   Nagstamon(Download)
    def get_server_version(self):
        """
        Try to get Icinga version for different URLs and JSON capabilities
        """
        result = self.FetchURL("%s/tac.cgi?jsonoutput" % (self.monitor_cgi_url), giveback="raw")
        try:
            for status_type in "hard", "soft":
                result = self.FetchURL(self.cgiurl_hosts[status_type], giveback="raw")
                # purify JSON result of unnecessary control sequence \n
                jsonraw, error = copy.deepcopy(result.result.replace("\n", "")), copy.deepcopy(result.error)
        try:
            for status_type in "hard", "soft":
                result = self.FetchURL(self.cgiurl_services[status_type], giveback="raw")
                # purify JSON result of unnecessary control sequence \n
                jsonraw, error = copy.deepcopy(result.result.replace("\n", "")), copy.deepcopy(result.error)
        try:
            for status_type in "hard", "soft":
                result = self.FetchURL(self.cgiurl_hosts[status_type])
                htobj, error = result.result, result.error
 
        try:
            for status_type in "hard", "soft":
                result = self.FetchURL(self.cgiurl_services[status_type])
                htobj, error = result.result, result.error
                #if error != "": return Result(result=copy.deepcopy(htobj), error=error)

src/n/a/Nagstamon-HEAD/Nagstamon/Nagstamon/Server/Multisite.py   Nagstamon(Download)
    def _get_url(self, url):
        result = self.FetchURL(url, 'raw')
        content, error = result.result, result.error
 
        if error != "":
            if len(self.Cookie) == 0:
                self._get_cookie_login()
                result = self.FetchURL(url, 'raw')
                content, error = result.result, result.error
                if content.startswith('<'):
            self.Debug(server=self.get_name(), debug ="Rechecking all action: " + url + '&' + urllib.urlencode(params))
 
        result = self.FetchURL(url + '&' + urllib.urlencode(params), giveback = 'raw')
 
    """

src/n/a/Nagstamon-HEAD/Nagstamon/Nagstamon/Server/Thruk.py   Nagstamon(Download)
        try:
            # JSON experiments
            result = self.FetchURL(self.cgiurl_hosts, giveback="raw")
            jsonraw, error = copy.deepcopy(result.result), copy.deepcopy(result.error)
            if error != "": return Result(result=jsonraw, error=error)
 
            # JSON experiments
            result = self.FetchURL(self.cgiurl_services, giveback="raw")
            jsonraw, error = copy.deepcopy(result.result), copy.deepcopy(result.error)
 

src/n/a/Nagstamon-HEAD/Nagstamon/Nagstamon/Server/op5Monitor.py   Nagstamon(Download)
 
            # Fetch Host info
            result = self.FetchURL(self.monitor_url + self.api_count + self.api_default_host_query, giveback="raw")
            data = json.loads(result.result)
            if data['count']:
                count = data['count']
                result = self.FetchURL(self.monitor_url + self.api_query + self.api_default_host_query + '&limit=' + str(count), giveback="raw")
 
            # Fetch services info
            result = self.FetchURL(self.monitor_url + self.api_count + self.api_default_svc_query, giveback="raw")
            data = json.loads(result.result)
            if data['count']:
                count = data['count']
                result = self.FetchURL(self.monitor_url + self.api_query + self.api_default_svc_query + '&limit=' + str(count), giveback="raw")