pcp
[Top] [All Lists]

Re: [pcp] PostgreSQL PMDA --> EnterpriseDB

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: [pcp] PostgreSQL PMDA --> EnterpriseDB
From: Pieter Baele <pieter.baele@xxxxxxxxx>
Date: Tue, 7 Jul 2015 09:12:52 +0200
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=LD+bY/3X8KelDsll2UPKfafba9QF9E7o5t3/MYx3ie0=; b=rA6OqBygcAISTasz+TtNhH5jEKCsuWLGCCE/Ed0lOC+aDlfUNJNOPMWGpMfvV0oWjQ 4A78kbtOMNd84pgV54voj8WZfbW5pNUe1r3K+PQMeFo0M3bNpefWrfjGzZihxuUO7uz7 q49WkzcwKtTzOx6/MySdPGwtNBo1fBh469ttgWqicRfEUgXBu4oQ1weukvXBbjXonp1b efxDbjwQXle3veyPNSDFw0hYm4He0BhxwdNopWBvj2liwBM+/Z2lfLDcKCXtMCZ5UYr3 +4Ue8TjssUGwDFQGEs1QSaVw2cvJO+83IIeG5b5XvUdPrKkoK92MkcSsCxoBWqKdE5jk c1sw==
In-reply-to: <559AF536.3060309@xxxxxxxxxxxxxxxx>
References: <CADDXySqgr+X192n92WbxOpMywGBZ=+p1thzYiefkT4+1_J_1TA@xxxxxxxxxxxxxx> <559AF536.3060309@xxxxxxxxxxxxxxxx>

On Mon, Jul 6, 2015 at 11:37 PM, Ken McDonell <kenj@xxxxxxxxxxxxxxxx> wrote:
Â
This message comes from the pmda->set_user() call near the end of the Perl code. For reasons that escape me (I did not write this code) this is trying to set the O/S (Linux probably) user to "postgres" so the PMDA does not run with UID 0 (root). It is unfortunate and confusing that this is the same string as the default DB username.


Oh thanks, I looked only very briefly in the source code....


Unless there are some O/S level protections needed to connect to PostgreSQL (seems unlikely) you could replace 'postgres' here with any valid Linux user name, else you might consider the attached modified version of the PMDA that uses $os_user instead of 'postgres' which would allow you to change it via

$os_user = 'something else';

in one of the *.conf files mentioned in the man page. This version also includes some additional logging ahead of the set_user() call and the attempted DB connection.

I'll commit these changes once I receive some confirmation that this has improved the situation.

Â
It worked and patched correctly, however, on another host nothing appears with pminfo -f.

I have seen this problem before ...
Check postgresql metrics have appeared ... 208 warnings, 208 metrics and 0 values

pminfo -f postgresql
postgresql: pmLookupName: No PMCD agent for domain of request

Note: RH is on version 3.9.5. They will rebase to 3.10 with RHEL 7.2

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