Re: Perl CGI advise/feedback please ...

[email protected] (Jeremiah Foster) Thu, 11 Feb 2010 19:02:56 +0100
Newsgroups perl.beginners.cgi,perl.beginners
Message-ID <[email protected]>
On Feb 11, 2010, at 3:18, newbie01 perl wrote:

> Hi all,
>=20
> I am wanting some advise/input on setting up some sort of intranet =
site to
> allow system operators to manage the servers, mostly UNIX servers and =
some
> Windows. I am constrained by not being able to install new modules or =
a
> database, for example, MySQL. The web server will be Apache. Given the
> choice between PHP and CGI-BIN. I've chosen CGI-BIN, is that a "wise" =
choice
> ...  :-)

PHP is a templating language, though it does more than that nowadays. =
PHP makes it fairly easy to combine logic with presentation, or code =
with html.=20

The Common Gateway Interface (cgi) allows for you to interact with a =
computer over http(s). This means you can write programs in many =
languages, not just perl.

Obviously this is only a brief explanation so take it with a grain of =
salt.

>=20
> For access, instead of a MySQL database, the only alternative that I =
can
> think of is reading the login information from a CSV delimited file =
for
> instance since I am not allowed to edit the htaccess and htpasswd =
files so
> am looking to somehow to be able to mask at least the password to keep =
it
> "secret"

There are a number of ways to keeping data other than a relational =
database like MySQL (which is owned by Oracle.) There is a 'NoSQL' =
movement going on nowadays that builds persistent data structures =
without the help of a RDMS. Plus there are things like Kioku DB, =
CouchDB, etc.
>=20
> I need some guidance if someone know of any existing set of CGI-BIN =
scripts
> that I can just plug it and used for this purpose.

Read the easily accessible CGI.pm perl documentation if you want to use =
perl. `perldoc CGI.pm`

>=20
> In its simplest form for a start, am looking at being able to present =
a page
> for login, once the user manages to login then, then I want to be able =
to
> allow it to run some basic UNIX commands, for example, df, top, rm old =
files
> from /tmp via a UNIX script etc. For some logins, they will not be =
allowed
> to run commands, but merely be presented with some server "health"
> information, i.e. for example output from a sar or vmstat or df or top
> report.
>=20
> Any guidance on where or how to start will be very much appreciated. =
Thanks
> in advance.

This is already done for you. Look at Nagios, Munin, RRDtool or any of =
the many very good open source monitoring projects.=20

Jeremiah