The hostname is branded in the archive label and is used later on to
match archives first to merge and then for config files used by tools
like pmie and pmchart and ...
So not having a unique and real hostname could present something of a
problem for merging archives and using the archives for cross-host
analysis.
Without looking at the code, the patch you're suggesting "doesn't feel
right" ... whatever the control scripts do should be compatible with
pmlogger.
After looking at the code, the status quo would appear to work fine
provided what gethostname(3) returns matches what hostname(1) returns up
to the first `.'. So in you specific case, what does gethostname(3) and
hostname(1) return?
And for extra points, what does uname -n report?
pmlogger's automatic replacement is the right thing to do in my opinion,
so generic config files can be deployed in environments where hosts are
not confused about their names.
On Wed, 2010-04-07 at 10:26 +1000, Max Matveev wrote:
> I've got caught in pmlogger stampede after using the following
> incantation in the control file:
>
> # special local logger
> localhost n n PCP_LOG_DIR/pmlogger/mumble -c
> /var/lib/pcp/config/mumble.conf
>
> pmlogger was started with -h localhost argument which was helpfully
> replaced in the map file with the actual host name, that host name did
> not match what pmlogger_check and pmlogger_daily were expecting,
> pmlogger_check went troppo and started starting new logger every time
> it was invoked, pmlogger_daily tried to merge archives which were
> still written by the horde of pmlogger - it wasn't thrilled by that.
>
> The reason I've used 'localhost' instead of LOCALHOSTNAME was because
> on that machine's name is not resolvable: it's not in DNS and it's not
> in the /etc/hosts (DHCP addresses and generic hostnames).
>
> I've added the following in pmlogger_check
>
> --- /usr/libexec/pcp/bin/pmlogger_check 2010-02-04 10:58:38.000000000 +1100
> +++ ./pmlogger_check 2010-04-07 10:23:52.587928390 +1000
> @@ -288,6 +288,9 @@
> | while read host primary socks dir args
> do
> line=`expr $line + 1`
> + if [ "$host" == "localhost" ]; then
> + host=$LOCALHOSTNAME
> + fi
> $VERY_VERBOSE && echo "[control:$line] host=\"$host\"
> primary=\"$primary\" socks=\"$socks\" dir=\"$dir\"
> args=\"$args\""
> case "$host"
> in
>
> but I wonder if it would be better to remove automatic replacement
> which pmlogger does.
>
> max
>
> _______________________________________________
> pcp mailing list
> pcp@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/pcp
|