Martins ... %shell only added very recently so make sure you've got a new
enough version of pmcpp ... you can cherrypick just pmcpp if your pmlpgger is
new enough to unconditionally use pmcpp, else you'll need a recent pmlogger and
pmcpp.
-----Original Message-----
From: Martins Innus <minnus@xxxxxxxxxxx>
To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, pcp@xxxxxxxxxxx
Sent: Thu, 20 Aug 2015 12:54 am
Subject: Re: [pcp] New pmlognow utility
Ken,
On 8/17/15 7:14 PM, Ken McDonell wrote:
> On 18/08/15 00:19, Frank Ch. Eigler wrote:
>> ...
>> So you're starting from a preexisting pmlogger configuration file, but
>> one that doesn't say "log once ..." on all of its metrics? ...
>
> Another option that may be feasible would be to use the macro
> processing that is now included for all pmlogger configuration files
> so you could do something like ...
>
>
> config
>
> %shell '[ -n "$PMLOGGER_ONCE" ] && echo %define PMLOGGER_ONCE; exit 0'
>
> %ifdef PMLOGGER_ONCE
> %define disk_dev_freq once
> %define cpu_all_freq once
> # etc ..
> %else
> %define disk_dev_freq '10 sec'
> %define cpu_all_freq '1 sec'
> # etc ..
> %endif
>
> log mandatory on %{disk_dev_freq} {
> disk.dev
> }
>
> log mandatory on %{cpu_all_freq} {
> kernel.all.cpu
> }
>
> The for the normal case
> pmlogger -c config ...
>
> And for the logged once case
> PMLOGGER_ONCE=yes pmlogger -c config ...
I missed that this was possible, but that seems to work really well!
I'll switch over to using this for a week or so, and see if I notice any
issues.
Thanks
Martins
|