For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > November 2005 > Checking the Machine's Operating System









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Checking the Machine's Operating System
Mazhar

2005-11-21, 7:56 am

Hi Folks,
I have a requirement from the clinet where in i have to take control of the
machines (either by telnet,SSH). My first point to be addressed is how can i
take a remote machine TELNET through perl script and also once i take the
same i have to check the type of operating system and then find the size of
the disks partitioned. Waiting for your help at the earliest

Thanks in Advance
Mazhar

Dan Klose

2005-11-21, 7:56 am

On Mon, 2005-11-21 at 14:16 +0530, Mazhar wrote:
> Hi Folks,

Hello

> I have a requirement from the clinet where in i have to take control of the
> machines (either by telnet,SSH). My first point to be addressed is how can i
> take a remote machine TELNET through perl script and also once i take the
> same i have to check the type of operating system and then find the size of
> the disks partitioned. Waiting for your help at the earliest


I would look at Network Programming with Perl by Lincoln D. Stein. I
might also have a look at CPAN (search.cpan.org) and search for telnet
and or socket.

Dan.

>
> Thanks in Advance
> Mazhar

--
Daniel Klose
PhD Student - Taylor Group
Mathematical Biology
National Institute for Medical Research
The Ridgeway
Mill Hill
London
NW7 1AA

usenet@DavidFilmer.com

2005-11-21, 7:56 am

Mazhar wrote:
> I have a requirement from the clinet where in i have to take control of the
> machines (either by telnet,SSH). My first point to be addressed is how can i
> take a remote machine TELNET through perl script

See Net::SSH http://search.cpan.org/~ivan/Net-SSH-0.08/SSH.pm
or Net::Telnet
http://search.cpan.org/~jrogers/Net...b/Net/Telnet.pm

> and also once i take the same i have to check the type of operating system


See Probe::Machineinfo::OS
http://search.cpan.org/~srshah/Prob...chineInfo/OS.pm

> and then find the size of the disks partitioned.


See Filesys::DiskFree
http://search.cpan.org/~abarclay/Fi....06/DiskFree.pm

I found these by about ten seconds searching cpan.org. You could have
done the same.

Marcel

2005-11-21, 7:56 am

Hi Mazhar

To find out what OS you are running try someting like this:

my $os = $^0;
Now f.e. if you are running linux, your $os = "linux" ...

Hope this helps...
Marcel


Mazhar schrieb:

> Hi Folks,
> I have a requirement from the clinet where in i have to take control of the
> machines (either by telnet,SSH). My first point to be addressed is how can i
> take a remote machine TELNET through perl script and also once i take the
> same i have to check the type of operating system and then find the size of
> the disks partitioned. Waiting for your help at the earliest
>
> Thanks in Advance
> Mazhar


John Doe

2005-11-21, 7:56 am

Mazhar am Montag, 21. November 2005 09.46:
> Hi Folks,
> I have a requirement from the clinet where in i have to take control of the
> machines (either by telnet,SSH). My first point to be addressed is how can
> i take a remote machine TELNET through perl script and also once i take the
> same i have to check the type of operating system and then find the size of
> the disks partitioned. Waiting for your help at the earliest
>
> Thanks in Advance
> Mazhar


Just one thing: Don't use telnet unless absolutely necessary. It's unsecure
since all data is transferred in plain text. Even if you don't login as root
(or su to root after login): Don't use it.

joe
pokerlad@gmail.com

2005-11-21, 7:56 am

Should be O not 0

my $os = $^O;


Marcel wrote:[color=darkred]
> Hi Mazhar
>
> To find out what OS you are running try someting like this:
>
> my $os = $^0;
> Now f.e. if you are running linux, your $os = "linux" ...
>
> Hope this helps...
> Marcel
>
>
> Mazhar schrieb:
>

Marcel

2005-11-21, 7:56 am

Ups, you're right.
Typo...

Marcel

xicheng

2005-11-21, 6:57 pm

pokerlad@gmail.com wrote:
> Should be O not 0
>
> my $os = $^O;

Can you get the OS of a remote machine by $^O?
XC

Mazhar

2005-11-25, 7:55 am

Then how well can i write the script to log to a remote server and then
> capture the following thing
> 1. to know the operating system of the logged remote server
> 2. to know the free space and then the number of drives or partitiones
> created in the remote server
>
> Mazhar
>
>
> On 11/21/05, John Doe <security.department@tele2.ch> wrote:
>


Mohammed Shameer

2005-11-25, 7:55 am

Can't you use Net::SSH::Perl module ?

On Friday 25 November 2005 17:51, Mazhar wrote:[color=darkred]
> Then how well can i write the script to log to a remote server and then
>

--
If you can't convince them, confuse them.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com