ca-apm / ca-apm-fieldpack-docker Goto Github PK
View Code? Open in Web Editor NEWRestful EPAgent script (python) to monitor Docker via Remote API.
License: Apache License 2.0
Restful EPAgent script (python) to monitor Docker via Remote API.
License: Apache License 2.0
Hi,
We are using the fieldpack on RHEL7.1 with Docker 1.8.2-el7 on epagent 10.1
It appears to be producing an invalid metric value error:
Response:
{
"errorCode": 1010,
"validCount": 387,
"invalidCount": 1,
"errorMessage": "One or more metric specifications were invalid",
"metricErrors": [
{
"metricErrorCode": 1013,
"metricErrorMsg": "Invalid metric value",
"metricErrorIndex": 1,
"metricName": "Docker|<<OUR HOSTNAME>>:Total Memory"
}
]
}
If i enable the the debug line in writeMetrics :
print('type of {} is {}, name = {}, value = {}'.format(key, type(values[key]), name, values[key]))
It prints out what you would expect:
type of MemTotal is <type 'int'>, name = :Total Memory, value = 7835488256
However, it continues to print the above error.
The metric is greyed out in the webview investigator.
Any thoughts?
Script exits with Index out of range when it encounters an empty "Names" field in the JSON response.
Example JSON snippet:
"Mounts": [],
"Names": [],
I'm attempting the docker fieldpack on RHEL7.1 connecting to the EPAgent version 10.3.0
Docker is configured correctly as per your guidance. I'm using Python 3.5.
I'm issuing the command:
python3.5 docker.py -H 127.0.0.1 -p 8080 -d localhost -r 2376 -c /etc/docker/cert.pem -k /etc/docker/key.pem -v
I'm seeing the following error:
`Verbose enabled
Submitting to: http://127.0.0.1:8080/apm/metricFeed
/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py:838: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
InsecureRequestWarning)
/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py:838: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
InsecureRequestWarning)
/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py:838: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
InsecureRequestWarning)
Response:
Traceback (most recent call last):
File "docker.py", line 326, in
main(sys.argv)
File "docker.py", line 312, in main
sendMetrics(url, headers, metricDict, options.verbose)
File "docker.py", line 254, in sendMetrics
response = json.loads(r.text)
File "/usr/local/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.5/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)
`
Script used to work with boot2docker on MacOS. Recently I got SSL verification errors for the boot2docker server certificate. I haven't found a simple solution for this because there are so many dependencies: requests -> urllib3 -> ssl -> openssl -> certificate handling in OS X.
If anyone has a solution or if certificates are not needed on most docker installations I will gladly change that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.