Re: insert OS command results into a table on a remote system ?

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: insert OS command results into a table on a remote system ?
Date: 2010-06-09 17:00:41
Message-ID: m3mxv4xhs6.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Kevin Kempter <kevink(at)consistentstate(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Greg Spiegelberg 2010-06-09 18:45:09 Re: Filesystem and PG configuration
Previous Message Kevin Kempter 2010-06-09 16:10:44 insert OS command results into a table on a remote system ?