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
|