diff --git a/curlnagios/__main__.py b/curlnagios/__main__.py index b558284..1496605 100644 --- a/curlnagios/__main__.py +++ b/curlnagios/__main__.py @@ -40,7 +40,7 @@ def parse_args(args): parser.add_argument('-u', '--url', dest='url', nargs='?', default=None, const=None, help='url to check \n') - parser.add_argument('-e', '--extra_args', dest='extra_args', nargs='?', default=None, const=None, + parser.add_argument('-e', '--extra_args', dest='extra_args', nargs='?', default='', const=None, help='extra args to add to curl, see curl manpage \n') # Arguments to check using OAuth2 diff --git a/curlnagios/plugin_check.py b/curlnagios/plugin_check.py index e5206d6..0bf5b0c 100644 --- a/curlnagios/plugin_check.py +++ b/curlnagios/plugin_check.py @@ -4,7 +4,7 @@ import subprocess class curlCheck: - def __init__(self, URL, extra_args, auth_args=''): + def __init__(self, URL, extra_args='', auth_args=''): """ :param URL: provide url to get/put data. :param extra_args: any argument for curl command @@ -36,7 +36,7 @@ def collect_data(self): """ ### some code here ### or calling external modules - cmdline = "curl {} {} --fail -s -o /dev/null {} -w \\ {}".format(self.url, self.auth_args, self.extra_args, self.std_args) + cmdline = "curl {} --fail -s -o /dev/null {} -w \\ {} {}".format(self.url, self.extra_args, self.std_args, self.auth_args) retrcode, retroutput = subprocess.getstatusoutput(cmdline) jsonoutput = json.loads(retroutput) diff --git a/upload.sh b/upload.sh old mode 100644 new mode 100755