Leser: 17
1
2
3
4
5
6
7
For (AlleVMS)
shutdown(vm)
endfor
connect to NAS by SSH
send shutdown by ssh shell
endconnect
shutdown host
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
my $NAS_IP = '192.168.7.99'; #!!!! IP für NAS anpassen! !!!!! my $host_IP = '10.1.1.1'; #!!!! IP für Host anpassen! !!!!! my $cmd = 'shutdown -h now'; use Net::SSH::Perl; # ----------------------------------------- # Login for NAS my $host = $NAS_IP; my $user = 'root'; my $pass = 'myVerrYSikrietPaSs'; #!!!! Passwort für Root auf NAS !!!! # Shutdown NAS with SSH my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass) or die "Cant login on $host: $!"; $ssh->cmd($cmd); # ----------------------------------------- # Login for host $host = $host_IP; $user = 'root'; $pass = 'RuthPatzWoert'; #!!!! Passwort für Root auf HOST !!!! # Shutdown host with SSH $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass) or die "Cant login on $host: $!"; $ssh->cmd($cmd);
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl .) at ./shutdown.pl line 72.