pcp
[Top] [All Lists]

Re: [pcp] Shouldn't pmrep use the default config file?

To: Marko Myllynen <myllynen@xxxxxxxxxx>
Subject: Re: [pcp] Shouldn't pmrep use the default config file?
From: Jamie Bainbridge <jamie.bainbridge@xxxxxxxxx>
Date: Fri, 1 Jul 2016 10:09:47 +1000
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CZDxXFmYUrDD+llsKAA6OJQDEVe4bdRoW91CxBrhNMc=; b=itPMNCvcQG2kSpg8/Hp1lZ8g2hQjW/uu8ofnklucP86T4YeAFhRz2boJmr7xLIkdiY R75RekZKnXEft8UnTSqZcKaOx2TAve3lPdirtNxe8W4pjzZjwlUso42zMTbqznzY0uO6 sXLIVUGsjXukxaz+DsiAdS8ICcJEWW2pWQp+REHyuzPMyDpn8KcRTW9Q+wD9TyurJR7E 0e7kKphExYd6tjbnwEDAngQMjbyXjet/QEgTTpJxpt6UWKWk4I+E2ZZj61IVv60Pd3PF CDR/fmKh4eDFTXbTlG2SvA+YyxhrjximaA4u/IE4E+Y2cCZ4wa/SNwhL7ESYUpIOlqjF BgMg==
In-reply-to: <5763B86B.1070506@xxxxxxxxxx>
References: <CAAvyFNhgfmuLhAHfA3d1rUuiPE791=04QXQHeLy9Dq4F=_756w@xxxxxxxxxxxxxx> <CAAvyFNh7hKSQ0gYD1+kjwQr116xWQGpz=3zqp4gLEZk8jm9T4g@xxxxxxxxxxxxxx> <5763B86B.1070506@xxxxxxxxxx>
On 17 June 2016 at 18:44, Marko Myllynen <myllynen@xxxxxxxxxx> wrote:
> Hi,
>
> On 2016-06-17 09:00, Jamie Bainbridge wrote:
>> On 17 June 2016 at 10:35, Jamie Bainbridge <jamie.bainbridge@xxxxxxxxx> 
>> wrote:
>>> The pmrep manpage invites you to use a metric spec, but this does not
>>> work by default:
>>>
>>> # pmrep -p -b MB vfs.inodes.count :vmstat
>>> Metric set definition ':vmstat' not found.
>>>
>>> One has to specify the supplied config file for the command to work:
>>>
>>> # pmrep -p -b MB vfs.inodes.count -c /etc/pcp/pmrep/pmrep.conf :vmstat
>>>
>>> Shouldn't pmrep use this default config file, and users can
>>> modify/specify their own if they want to? This probably provides a
>>> better initial experience and is more in line with other tools with a
>>> config file.
>>>
>>> If you're happy with this, lmk and I'll submit a patch.
>
> Hmm, yeah, at least I can't recall why it's not like this already.
> Perhaps the example-{1,2}/zabbix sets could be commented out or removed,
> the rest looks generally usable.
>
>> Thinking more on this, it would make even more sense to have a
>> directory like /etc/pcp/pmrep/pmrep.conf.d/ and read every *.conf file
>> in there on launch.
>>
>> That way users could write their own tool, throw it in the directory,
>> and have it just work when they run "pmrep :mything".
>>
>> This also makes it neater for the project to pre-package tools, as
>> each set of related pmrep tools (eg: each "sar" option implementation)
>> is broken into its own file.
>
> Agreed, this on the TODO list already (see pcp.git/src/pmrep/TODO):
>
> -  includedir config file support (?)
>
> There was also this item:
>
> -  look for config in ./, ~/.pcp, ~/, /etc/pcp or so
>
> Do you think that would be helpful or should we just drop that item?

I like the idea of cwd, user-specific config, then system-wide config.

This allows users to easily have their own tools just work without
having root access to modify the system-wide files.

Jamie

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