#!/usr/bin/env perl -w use strict; use warnings; use Net::SSH::Perl; ####################################################################### # LOGIN DETAILS ####################################################################### my $server = "10.255.255.10"; my $username = "user"; my $password = "password"; # Log into server print "Creating ssh object... "; my $ssh = Net::SSH::Perl->new($server); # Error check this print "done\n"; print "Logging into server... "; $ssh->login($username, $password); # Error check this print "done\n"; # Check df my $command = "df"; print "Running command ($command)... "; my ($stdout, $stderr, $exit) = $ssh->cmd($command); # Check output print "done\n"; print "$stdout\n"; $ssh->cmd("exit");