...

View Full Version : best approach to script ssh/telneting into various servers



green_hydralisk
03-24-2010, 07:07 PM
Hi,

I am starting out with scripting so forgive me if I am not wording something properly.

I have written a script with bash and expect to ssh and telnet into a server and grab data. And I've been able to incorporate this on an apache server's cgi-bin directory so I can call the script via a web browser.

I'd like to extend this to more than one server, gather data, make decisions based on that data to display a certain message, or connect to other servers to get even more data. I'd like to call ldapsearch and sqlplus (which I've done so far with oracle's Instant Client) commands. What is the best way to write this?

* perl (took an online intro course and could learn it if needed)?
* bash?
* something else?

Thanks.

FishMonger
03-24-2010, 09:44 PM
Since this is a Perl forum, that's the direction I'll address.

Perl has modules for doing each of your tasks.

Start with some reading.

Database:
http://search.cpan.org/~timb/DBI-1.609/DBI.pm
http://search.cpan.org/~pythian/DBD-Oracle-1.24a/Oracle.pm

SSH:
http://search.cpan.org/~rkitover/Net-SSH2-0.28/lib/Net/SSH2.pm

LDAP:
http://search.cpan.org/~gbarr/perl-ldap-0.40/lib/Net/LDAP.pod

green_hydralisk
03-25-2010, 12:23 AM
thanks for the links. i'll use this as a reason to learn more perl.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum