pcp
[Top] [All Lists]

pmwebd oddity?

To: pcp@xxxxxxxxxxx
Subject: pmwebd oddity?
From: Michele Baldessari <michele@xxxxxxxxxx>
Date: Mon, 13 Oct 2014 20:43:10 +0200
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=acksyn.org; h= user-agent:content-disposition:content-type:content-type :mime-version:message-id:subject:subject:from:from:date:date :received:received; s=2010; t=1413225791; bh=GIuHZMtzizkLP1WyMdG a9zwwVzHXOW33P1mOuumYGmg=; b=i4SpeN1KU7OK+WZg+2rwDvFgPEmgrEMhXKL Rmgq8oxrd3LmQS977ap9r+OTwpTEsmEYqJMDVJu9uKJ34oL1itUC+yWDxUP+cMr+ izDu+Q/PPkB8Kn45QwjwmKFQetvlg4c/PcnMM9h3UKgybTHFKLvJEREP7q/v8f5T rPRljFew=
User-agent: Mutt/1.5.21 (2012-12-30)
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

<Prev in Thread] Current Thread [Next in Thread>