Open goodwinos opened 3 years ago
@goodwinos I don't think there is a problem here. A relative pathname for the config file in /var/log/pcp/pmlogger/somehost is perfectly normal (. is where pmlogger looks first to find the -c configfile), and is probably more natural than populating /var/lib/pcp/config/pmlogger with a bunch of config files that need to have the hostname as part of the name to avoid collisions. pmlogctl already has a hard-wired policy file for the default class, it is
[class]
default
[ident]
%h
[destroy]
condition(1)
[create]
hostname(.*)
[control]
#DO NOT REMOVE OR EDIT THE FOLLOWING LINE
$version=1.1
%h n n PCP_ARCHIVE_DIR/%i -c ./%i.config
pmlogctl using the default class creates a control file with the pmlogger config file named ./somehost, which ends up in the pmlogger log directory rather than /var/lib/pcp/config/pmloggersomehost.config. E.g.
create a new pmlogger instance:
pmlogconf created the new config thusly:
If I create a class file named 'default' as follows, it seems to do the expected:
So the simple fix is probably just to ship a 'default' class file, unless I've missed something??