pcp
[Top] [All Lists]

Re: Param to add Hostname into pcp2graphite metrics?

To: Alejandro <cdgraff@xxxxxxxxx>
Subject: Re: Param to add Hostname into pcp2graphite metrics?
From: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Date: Fri, 4 Sep 2015 16:16:24 -0400
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <CALJtzxCumz2eSTwB-Y71oMhdpfk1YEZQQgq5igfuF2sQvYEnMg@xxxxxxxxxxxxxx>
References: <CALJtzxCGwMHVJ4-P_fCHupqNaFgVOU42FnEgxOtTVQqgc+M7xQ@xxxxxxxxxxxxxx> <y0ma8t27yra.fsf@xxxxxxxx> <CALJtzxCumz2eSTwB-Y71oMhdpfk1YEZQQgq5igfuF2sQvYEnMg@xxxxxxxxxxxxxx>
User-agent: Mutt/1.4.2.2i
Hi -

> [...]
> I got the idea from here:
> https://github.com/performancecopilot/pcp/issues/24
> 
> Possible after read the example, %H is Systemd variable? and for this
> reason does not work when I run pcp2graphite in the console only.

Yes, %H is substituted by systemd.

We would prefer not to hard-code policy like the output metric names
unnecessarily, given that the pcp2graphite invoker has apprx. the
right information already:

    pcp2graphite -m pcp.`hostname`. [...]

Though if pcp2graphite is being run against a remote -h HOST target,
then its hostname is what's probably desired.  pcp appears to lack a
shell-friendly general one-shot value-fetcher to do the equivalent of
the above, but this might work well enough:

    pcp2graphite -h FOO -m pcp.`/usr/libexec/pcp/bin/pmhostname FOO`. [...]

(The latter works based on DNS, which is not the same thing as the
remote pmcd.hostname.)

- FChE

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