Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7614C6321D2 for ; Wed, 9 Jun 2010 14:01:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 54886-04 for ; Wed, 9 Jun 2010 17:00:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id D2D74632B0E for ; Wed, 9 Jun 2010 14:00:57 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OMOe2-0007Am-S8 for pgsql-admin@postgresql.org; Wed, 09 Jun 2010 19:00:50 +0200 Received: from g224046125.adsl.alicedsl.de ([92.224.46.125]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Jun 2010 19:00:50 +0200 Received: from tim by g224046125.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Jun 2010 19:00:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: pgsql-admin@postgresql.org To: pgsql-admin@postgresql.org connect(): No such file or directory From: Tim Landscheidt Subject: Re: insert OS command results into a table on a remote system ? Date: Wed, 09 Jun 2010 17:00:41 +0000 Organization: Lines: 18 Message-ID: References: <201006091010.44437.kevink@consistentstate.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: g224046125.adsl.alicedsl.de Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:tFwEfEvrmay2altByM6Dx4+I+eI= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/87 X-Sequence-Number: 34865 Kevin Kempter wrote: > I want to gather OS command based stats such as the results of commands > like: 'df' 'iostat' 'free' etc and put the results into a temp table that I > can then select from. > I need to do this all from the db since I wont have OS/shell access, > only 'psql -h' access. Is this possible? > Can I somehow leverage the '\!' meta command in psql to pull results of OS > commands into a table? psql's "\!" commands are executed on the /client/ box. You could try using PL/Perl or PL/Python, but chances are that if you aren't allowed shell access to the database server, these paths of entry are also blocked. Tim