#!/usr/bin/perl use strict; use warnings; use Getopt::Long; use Opsware::NAS::Connect; my($host,$port,$user,$pass) = ('localhost','$tc_proxy_telnet_port$','$tc_user_username$','$tc_user_password$'); my $device = '#$tc_device_id$'; my @output; my $con = Opsware::NAS::Connect->new(-user => $user, -pass => $pass, -host => $host, -port => $port); $con->login(); $con->connect( $device ) or die "Failed to connect."; $con->cmd("terminal length 0"); print "show crypto files \n"; open my $fh, ">cryptofiles.log" or die "Cant open file died unexpectedly"; @output = $con->cmd("show crypto files"); foreach (@output) { print $fh $_; } close $fh; $con->disconnect(); $con->logout(); undef $con; exit(0);