pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: pgsql-admin@postgresql.org
Subject: Re: insert OS command results into a table on a remote system ?
Date: Wed, 09 Jun 2010 17:00:41 +0000
Message-ID: <m3mxv4xhs6.fsf@passepartout.tim-landscheidt.de> (raw)
References: <201006091010.44437.kevink@consistentstate.com>

Kevin Kempter <kevink@consistentstate.com> 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




view thread (2+ messages)

Message-ID: <m3mxv4xhs6.fsf@passepartout.tim-landscheidt.de>
Permalink:  ../m3mxv4xhs6.fsf@passepartout.tim-landscheidt.de/
Also on:    postgresql.org/message-id/m3mxv4xhs6.fsf@passepartout.tim-landscheidt.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tim@tim-landscheidt.de
  Subject: Re: insert OS command results into a table on a remote system ?
  In-Reply-To: <m3mxv4xhs6.fsf@passepartout.tim-landscheidt.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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