Skip to content

Instantly share code, notes, and snippets.

@marianogg9
Created February 14, 2014 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianogg9/8999583 to your computer and use it in GitHub Desktop.
Save marianogg9/8999583 to your computer and use it in GitHub Desktop.
$ curl -v -H "X-Auth-Token: my_token" https://rackspace_api.url/current | python -m json.tool
* Adding handle: conn: 0xe08fb0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0xe08fb0) send_pipe: 1, recv_pipe: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to rackspace_api.url port 443 (#0)
* Trying 174.143.139.141...
* Connected to rackspace_api.url (ip) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using SSL_RSA_WITH_RC4_128_SHA
* Server certificate:
* subject: CN=rackspace_api.url,OU=Domain Validated,OU=Thawte SSL123 certificate,OU=Go to https://www.thawte.com/repository/index.html,O=rackspace_api.url
* start date: Nov 18 00:00:00 2010 GMT
* expire date: Nov 17 23:59:59 2015 GMT
* common name: rackspace_api.url
* issuer: CN=Thawte DV SSL CA,OU=Domain Validated SSL,O="Thawte, Inc.",C=US
> GET /v1.0/account_id/loadbalancers/lb_id/usage/current HTTP/1.1
> User-Agent: curl/7.33.0
> Host: rackspace_api.url
> Accept: */*
> X-Auth-Token: my_token
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Via: 1.1 Rackspace Cloud Load Balancer API v1.19.28 (Repose/2.11.0)
< Content-Length: 7265
< Date: Mon, 10 Feb 2014 15:47:28 GMT
* Server Jetty(8.0.y.z-SNAPSHOT) is not blacklisted
< Server: Jetty(8.0.y.z-SNAPSHOT)
<
{ [data not shown]
53 7265 53 3884 0 0 7158 0 0:00:01 --:--:-- 0:00:01 7100 7265 100 7265 0 0 12349 0 --:--:-- --:--:-- --:--:-- 12376
* Connection #0 to host rackspace_api.url left intact
{
"links": [],
"loadBalancerUsageRecords": [
{
"averageNumConnections": 17.5,
"averageNumConnectionsSsl": 0.0,
"endTime": "2014-02-09T17:00:00Z",
"id": id;
"incomingTransfer": 3816105,
"incomingTransferSsl": 0,
"numPolls": 12,
"numVips": 1,
"outgoingTransfer": 529684773,
"outgoingTransferSsl": 0,
"sslMode": "OFF",
"startTime": "2014-02-09T16:00:00Z",
"vipType": "PUBLIC"
},
..and so on..
But, I got a doubt in the next item, now I've this set up in collectd.conf
<Plugin curl_json>
<URL "https://rackspace_api.url/usage/current">
Instance "Load_Balancer"
Header "X-Auth-Token: my_token"
<Key "LoadBalancerUsageRecords/*/averageNumConnections">
Type "connections"
</Key>
..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment