Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8DBC9476DA9 for ; Fri, 6 Sep 2002 09:39:07 -0400 (EDT) Received: from dg.eisolution.com (dsl-232-15.speedsite.com [206.126.232.15]) by postgresql.org (Postfix) with ESMTP id 4D8F8476D81 for ; Fri, 6 Sep 2002 09:39:06 -0400 (EDT) Received: from marcmdelltop (dg117.eisolution.com [10.5.1.117]) (authenticated) by dg.eisolution.com (8.11.6/8.11.6) with ESMTP id g86DhYj22469; Fri, 6 Sep 2002 08:43:34 -0500 Message-ID: <003601c255ab$3688d1a0$7501050a@eisolution.com> From: "Marc Mitchell" To: "Bruce Momjian" Cc: References: <200209060425.g864PHn20477@candle.pha.pa.us> Subject: Re: Remote monitoring Date: Fri, 6 Sep 2002 08:42:15 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/64 X-Sequence-Number: 5603 ----- Original Message ----- From: "Bruce Momjian" To: "Marc Mitchell" Cc: Sent: Thursday, September 05, 2002 11:25 PM Subject: Re: [ADMIN] Remote monitoring > Marc Mitchell wrote: > > I have a requirement to be able to remotely monitor and diagnose a > > production Postgres installation running on a machine with limited firewall > > access. When local to the box, I use pgmonitor and find it completely > > indispensable. But, from my remote location, I can only slogin to the box > > and get terminal access and thus have a problem with the Xwindows display. > > Admittedly, I'm not very well versed in Xwindows. Is there any way to > > achieve similar functionality but in a completely server based way? I know > > pgmonitor is basically based on a series of ps and awk commands. Is there > > a way this could be wrapped in a script to provide straight text based > > information along the same lines as "top" or "sar"? > > Well, if you enable stats_command_string in postgresql.conf you will > see the queries being run in pg_stat_activity. Would this have a performance cost? Where does the X-based pgmonitor get its query string data? > > Another option is to ssh into the machine, set your $DISPLAY back to > your local machine, and then run pgmonitor. ssh does secure remote X > display. When remote, the link between my workstation to the box being monitored is via the net where my machine gains access via a NAT router and does not have its own publicly routable IP. So making the connection back from server to workstation is problematic at best. Would it be possible to get the code for the current X-based stuff in order to convert it to a straight text based display in either ksh script or perhaps C? I wouldn't try to implement some of the more UI related stuff like the ability to specify sort order or shutdown the server. But having a basic refreshing display of active sessions and the ability to get query details on an one would same a do-able thing in C. Marc Mitchell Enterprise Information Solutions, Inc. Downers Grove, IL 60515 marcm@eisolution.com > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 359-1001 > + If your life is a hard drive, | 13 Roberts Road > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org