Hi all,
it's likely something silly I am doing, but at the moment I am just not
seeing it. I am printing out my ADSL bandwith using pmwebd/json and an
Arduino [1].
Now I wanted to add latency as well and I thought about using a pretty
horrendous but very quick hack via the shping PMDA: I add a simple
script which just outputs the latency via status error.
>From shping's sample.conf:
acksyn.org /var/lib/pcp/pmdas/shping/ping.sh
ping.sh being:
"""
#!/bin/sh
# This hack will break if latency > 254 ;)
ret=`ping -c 2 -n -q 8.8.8.8 | grep ^rtt | cut -f5 -d\/ | cut -f1 -d\.`
exit $ret
"""
Now, leaving aside for a second how fragile and broken by design the whole
thing is,
everything works via pminfo but not via pmwebapi:
- pminfo -f -m -M shping.error
shping.error PMID: 19.0.10 = 79691786 = 0x4c0000a
inst [0 or "8.8.8.8"] value 52
- pmwebd returns empty values :
{u'timestamp': {u's': 1413224620, u'us': 977986}, u'values': []}
On the network I see the following exchange:
"""
GET /pmapi/747499891/_fetch?pmids=79691786 HTTP/1.1
Host: fw:44323
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.3.0 CPython/2.7.8 Linux/3.17.0-301.fc21.x86_64
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 63
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Mon, 13 Oct 2014 18:19:30 GMT
{ "timestamp": { "s":1413224370, "us":801625 },
"values": [
] }
"""
I've tried restarting both pmcd and pmwebd. Do I need to do anything
special to get shping.error exported via JSON? I have also tried adding
-v to the options but I only see context creation or expiration
messages. Anything I missed? (I assume that without specifying -K it
should take all PMDAs?)
Thanks,
Michele
[1] http://acksyn.org/blog/2014/10/09/performance-co-pilot-and-arduino/
--
Michele Baldessari <michele@xxxxxxxxxx>
C2A5 9DA3 9961 4FFB E01B D0BC DDD4 DCCB 7515 5C6D
|