pcp
[Top] [All Lists]

Re: [pcp] Additional substitutions in pmlogger control file

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: [pcp] Additional substitutions in pmlogger control file
From: Martins Innus <minnus@xxxxxxxxxxx>
Date: Thu, 15 Oct 2015 19:20:32 -0400
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <56200C2A.2080601@xxxxxxxxxxxxxxxx>
References: <561E8148.1070304@xxxxxxxxxxx> <56200C2A.2080601@xxxxxxxxxxxxxxxx>
Ken,

> On Oct 15, 2015, at 4:27 PM, Ken McDonell <kenj@xxxxxxxxxxxxxxxx> wrote:
> 
> Thanks for this Martins.
> 
>> On 15/10/15 03:22, Martins Innus wrote:
>> Hi,
>>     Is there any interest in supporting other substitutions in the path
>> component of the pmlogger control file?  Something like the following,
>> or any other suggestions on how to achieve the same goal? (Obviously the
>> same change in pmlogger_daily)
>> 
>> 
>> 
>> --- pmlogger_check.sh    2015-09-18 15:31:31.000000000 +0000
>> +++ /usr/libexec/pcp/bin/pmlogger_check    2015-10-14 15:57:21.159413586
>> +0000
>> @@ -460,6 +460,12 @@
>>      dir=`echo $dir | sed -e "s;LOCALHOSTNAME;$dir_hostname;"`
>>      [ "x$host" = "xLOCALHOSTNAME" ] && host=local:
>> 
>> +    dir_date_day=`date "+%Y%m%d"`
>> +    dir=`echo $dir | sed -e "s;LOCALDAY;$dir_date_day;"`
>> +
>> +    dir_date_month=`date "+%Y%m"`
>> +    dir=`echo $dir | sed -e "s;LOCALMONTH;$dir_date_month;"`
>> +
>>      $VERY_VERBOSE && echo "[$controlfile:$line] host=\"$host\"
>> primary=\"$primary\" socks=\"$socks\" dir=\"$dir\" args=\"$args\""
>> 
>>      case "$host"
> 
> Can you please clarify a couple of things for me?
> 
> 1. this is needed in pmlogger_check _and_ pmlogger_daily?

Correct


> And for consisitency I think we'd want to do the pmie_check and pmie_daily 
> scripts as well (they contain similar logic and semantics).

I'm not sure

> 
> 2. In your control lines you are using LOCALDAY for some of the "dir" field 
> entries and LOCALMONTH for some of the others?

Yes, for some of our hosts we will want one and for others we want the other

> 
> Apropos 2, if this is the case, then I wonder if we'd not be better to 
> generalize your suggestion to allow the "dir" field to contain embedded 
> bash(1) syntax of the forms:
> - $variable (from the environment, one presumes)
> - `cmd`
> - $(cmd)
> - ...

That would be perfect!

You can ignore my previous patch, I think this is a more flexible idea.

Thanks 

Martins

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