SumoLogic-Labs / collector-management-client

A Python script for quickly managing a subset of installed Collectors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The -addSource fails

marklaw2022 opened this issue · comments

Issue 1: The -addSource method fails

Traceback (most recent call last):
File "/root/collector-management-client-main/env/lib64/python3.6/site-packages/requests/models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "../sumo_mgmt.py", line 748, in
add_source(collectors)
File "../sumo_mgmt.py", line 464, in add_source
collector['description'] = r.json()['message']
File "/root/collector-management-client-main/env/lib64/python3.6/site-packages/requests/models.py", line 917, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value]

<title>502 Bad Gateway</title>

502 Bad Gateway

: 0

Issue 2: The -addSource doesn't not support the -filter option

-addSource /root/collector-management-client-main/json/windows_eventlog_vdi.json -filter name=AP
usage: sumo_mgmt.py [-h] [-upgrade] [-batchSize] [-addSource] [-accessid]
[-accesskey] [-url] [-filter] [-listVersions]
[-getSources] [-updateSource ]
[-listOfflineCollectors [1-100]]
[-deleteOfflineCollectors [1-100]] [-assignBudget] [-y]
sumo_mgmt.py: error: argument -filter: expected 1 argument