pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRemote monitoring
10+ messages / 4 participants
[nested] [flat]
* Remote monitoring
@ 2002-09-05 23:30 Marc Mitchell <marcm@eisolution.com>
0 siblings, 1 reply; 10+ messages in thread
From: Marc Mitchell @ 2002-09-05 23:30 UTC (permalink / raw)
To: pgsql-admin
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"?
Thank you for any insight you can provide.
Marc Mitchell - Senior Application Architect
Enterprise Information Solutions, Inc.
4910 Main Street
Downers Grove, IL 60515
marcm@eisolution.com
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 04:25 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Marc Mitchell <marcm@eisolution.com>
0 siblings, 1 reply; 10+ messages in thread
From: Bruce Momjian @ 2002-09-06 04:25 UTC (permalink / raw)
To: Marc Mitchell <marcm@eisolution.com>; +Cc: pgsql-admin
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.
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.
--
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
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 13:42 Marc Mitchell <marcm@eisolution.com>
parent: Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 3 replies; 10+ messages in thread
From: Marc Mitchell @ 2002-09-06 13:42 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-admin
----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Marc Mitchell" <marcm@eisolution.com>
Cc: <pgsql-admin@postgresql.org>
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
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 14:38 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Marc Mitchell <marcm@eisolution.com>
2 siblings, 0 replies; 10+ messages in thread
From: Bruce Momjian @ 2002-09-06 14:38 UTC (permalink / raw)
To: Marc Mitchell <marcm@eisolution.com>; +Cc: pgsql-admin
Marc Mitchell wrote:
> > 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
Less that 1% performance load.
> its query string data?
The X-based solution gets its query string from the local machine, it
just pipes the X display back to your local machine.
> > 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.
Actually, there is a text-based TCL/Tk library. I think it was done by
SCO initially for their install stuff. Anyway, I am sure it exists
somewhere, and if you can get it, the script should just run with no
changes to pgaccess.
--
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
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 14:57 Ross J. Reedstrom <reedstrm@rice.edu>
parent: Marc Mitchell <marcm@eisolution.com>
2 siblings, 1 reply; 10+ messages in thread
From: Ross J. Reedstrom @ 2002-09-06 14:57 UTC (permalink / raw)
To: Marc Mitchell <marcm@eisolution.com>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; pgsql-admin
On Fri, Sep 06, 2002 at 08:42:15AM -0500, Marc Mitchell wrote:
> ----- Original Message -----
> From: "Bruce Momjian" <pgman@candle.pha.pa.us>
> To: "Marc Mitchell" <marcm@eisolution.com>
> Cc: <pgsql-admin@postgresql.org>
> Sent: Thursday, September 05, 2002 11:25 PM
> Subject: Re: [ADMIN] Remote monitoring
>
>
> > Marc Mitchell wrote:
>
> >
> > 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.
I think you and Bruce are talking past each other, here. You mention
slogin, Bruce mentions SSH. Clearly, the server can get packets to your
workstation, and vice versa, since you can get a terminal session. SSH
has the capability to piggy-back an encrypted X session on top of that
connection: I don't think slogin does. To use it, you need to enable
the option, or use the command line switch (unfortunately, the switch
has varied from version to version of SSH, so I can't tell you which
one it is, either -x or -X)
If you've got sshd running on the server, you're golden - I do this all
the time, with our wireless net here, BTW.
Ross
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 15:38 Marc Mitchell <marcm@eisolution.com>
parent: Ross J. Reedstrom <reedstrm@rice.edu>
0 siblings, 1 reply; 10+ messages in thread
From: Marc Mitchell @ 2002-09-06 15:38 UTC (permalink / raw)
To: Ross J. Reedstrom <reedstrm@rice.edu>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; pgsql-admin
Ross,
You rock! This works perfectly! Thank you very much!
Marc
----- Original Message -----
From: "Ross J. Reedstrom" <reedstrm@rice.edu>
To: "Marc Mitchell" <marcm@eisolution.com>
Cc: "Bruce Momjian" <pgman@candle.pha.pa.us>; <pgsql-admin@postgresql.org>
Sent: Friday, September 06, 2002 9:57 AM
Subject: Re: [ADMIN] Remote monitoring
> On Fri, Sep 06, 2002 at 08:42:15AM -0500, Marc Mitchell wrote:
> > ----- Original Message -----
> > From: "Bruce Momjian" <pgman@candle.pha.pa.us>
> > To: "Marc Mitchell" <marcm@eisolution.com>
> > Cc: <pgsql-admin@postgresql.org>
> > Sent: Thursday, September 05, 2002 11:25 PM
> > Subject: Re: [ADMIN] Remote monitoring
> >
> >
> > > Marc Mitchell wrote:
> >
> > >
> > > 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.
>
> I think you and Bruce are talking past each other, here. You mention
> slogin, Bruce mentions SSH. Clearly, the server can get packets to your
> workstation, and vice versa, since you can get a terminal session. SSH
> has the capability to piggy-back an encrypted X session on top of that
> connection: I don't think slogin does. To use it, you need to enable
> the option, or use the command line switch (unfortunately, the switch
> has varied from version to version of SSH, so I can't tell you which
> one it is, either -x or -X)
>
> If you've got sshd running on the server, you're golden - I do this all
> the time, with our wireless net here, BTW.
>
> Ross
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 16:05 Andrew Sullivan <andrew@libertyrms.info>
parent: Marc Mitchell <marcm@eisolution.com>
2 siblings, 1 reply; 10+ messages in thread
From: Andrew Sullivan @ 2002-09-06 16:05 UTC (permalink / raw)
To: pgsql-admin
On Fri, Sep 06, 2002 at 08:42:15AM -0500, Marc Mitchell wrote:
>
> 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.
My colleague, Sorin Iszlai (siszlai@libertyrms.info), has already
done this. He has asked me for some more time to clean up the code
and make it commented and such, but we intend to release it. I just
don't have a date yet.
Bruce Momjian told me, however, that the pgmonitor stuff was being
merged with another project. I'm not sure how that will affect the
utility of Sorin's code.
A
--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew@libertyrms.info> M2P 2A8
+1 416 646 3304 x110
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 17:38 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Andrew Sullivan <andrew@libertyrms.info>
0 siblings, 0 replies; 10+ messages in thread
From: Bruce Momjian @ 2002-09-06 17:38 UTC (permalink / raw)
To: Andrew Sullivan <andrew@libertyrms.info>; +Cc: pgsql-admin
Andrew Sullivan wrote:
> On Fri, Sep 06, 2002 at 08:42:15AM -0500, Marc Mitchell wrote:
> >
> > 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.
>
> My colleague, Sorin Iszlai (siszlai@libertyrms.info), has already
> done this. He has asked me for some more time to clean up the code
> and make it commented and such, but we intend to release it. I just
> don't have a date yet.
>
> Bruce Momjian told me, however, that the pgmonitor stuff was being
> merged with another project. I'm not sure how that will affect the
> utility of Sorin's code.
pgmonitor was merged into pgaccess and is now part of the current
release:
http://www.pgaccess.org/
There is actually a pgmonitor menu option. I assume all future
pgmonitor work will be done as part of pgaccess. I will add something
to the pgmonitor page stating this when pgaccess release is finalized.
--
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
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 18:23 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Marc Mitchell <marcm@eisolution.com>
0 siblings, 1 reply; 10+ messages in thread
From: Bruce Momjian @ 2002-09-06 18:23 UTC (permalink / raw)
To: Marc Mitchell <marcm@eisolution.com>; +Cc: Ross J. Reedstrom <reedstrm@rice.edu>; pgsql-admin
Marc Mitchell wrote:
> Ross,
>
> You rock! This works perfectly! Thank you very much!
The pgmonitor README does have this paragraph:
Pgmonitor only works when run on the database server machine. To use it
remotely, log into the remote machine, set the DISPLAY variable to point
to your local X server, and start pgmonitor. Pgmonitor will then run on
the remote machine, but will display on your local machine.
--
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
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Remote monitoring
@ 2002-09-06 18:49 Marc Mitchell <marcm@eisolution.com>
parent: Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 0 replies; 10+ messages in thread
From: Marc Mitchell @ 2002-09-06 18:49 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Ross J. Reedstrom <reedstrm@rice.edu>; pgsql-admin
Setting the DISPLAY on the remote machine works fine if the remote machine
can directly access the local/client machine. It cannot in our case due to
firewall and NAT issues.
In this case we (thanks to Ross) use ssh (instead of the simpler slogin)
from client to remote server. However, you set DISPLAY on the local
machine, not the remote machine. The server side of ssh (sshd) sets up all
the required settings to send the X11 traffic back over the established
link. In fact, the ssh man page on our box explicitly states: "The user
should not manually set DISPLAY." meaning on the remote side.
One thing that was hampering this, at least within our install, was that
the postgres home directory on the remote server was owned by root and not
postgres. When ssh'ing into the box with the X11 forwarding enabled, the
daemon wants to create a file (".Xauthority") in the home directory of the
user on the remote machine. When this directory isn't writeable by the
user, the creation of this file fails and the X11 forwarding doesn't work
(and in fact screws up a lot of basic UI-rich apps like vi). Our solution
was to make that directory writeable by everyone. We tried pre-creating
just the file and chmod'ing but that didn't work apparently indicating the
process wants to re-create the file as opposed to appending to it.
Also, wasn't able to make this work in the situation where to ssh as user
"X" and then on the remote machine su to user "postgres". But I didn't try
very hard to figure it out once I got it working under the "postgres"
account. I suspect it would be do-able. This might be important if ssh
logins are restricted to certain accounts and those accounts don't include
"postgres" which would be needed to enable the query view functionality as
well as others.
Marc
----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Marc Mitchell" <marcm@eisolution.com>
Cc: "Ross J. Reedstrom" <reedstrm@rice.edu>; <pgsql-admin@postgresql.org>
Sent: Friday, September 06, 2002 1:23 PM
Subject: Re: [ADMIN] Remote monitoring
> Marc Mitchell wrote:
> > Ross,
> >
> > You rock! This works perfectly! Thank you very much!
>
> The pgmonitor README does have this paragraph:
>
> Pgmonitor only works when run on the database server machine. To use it
> remotely, log into the remote machine, set the DISPLAY variable to point
> to your local X server, and start pgmonitor. Pgmonitor will then run on
> the remote machine, but will display on your local machine.
>
> --
> 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
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2002-09-06 18:49 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-05 23:30 Remote monitoring Marc Mitchell <marcm@eisolution.com>
2002-09-06 04:25 ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-09-06 13:42 ` Marc Mitchell <marcm@eisolution.com>
2002-09-06 14:38 ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-09-06 14:57 ` Ross J. Reedstrom <reedstrm@rice.edu>
2002-09-06 15:38 ` Marc Mitchell <marcm@eisolution.com>
2002-09-06 18:23 ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-09-06 18:49 ` Marc Mitchell <marcm@eisolution.com>
2002-09-06 16:05 ` Andrew Sullivan <andrew@libertyrms.info>
2002-09-06 17:38 ` Bruce Momjian <pgman@candle.pha.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox