BlueCoat-SGOS

 view release on metacpan or  search on metacpan

lib/BlueCoat/SGOS.pm  view on Meta::CPAN

package BlueCoat::SGOS;
use strict;
use warnings;
use Data::Dumper;
use Date::Parse;
use LWP::UserAgent;
require HTTP::Request;
use HTTP::Request::Common qw/POST/;

our %_URL = (
	'archconf_expanded'    => '/archconf_expanded.txt',
	'contentfilter_status' => '/ContentFilter/Status',
	'sysinfo'              => '/SYSINFO',
	'send_command' =>
	  '/Secure/Local/console/install_upload_action/cli_post_setup.txt'
);

our %defaults = (
	'appliancehost'        => 'proxy',
	'applianceport'        => 8082,
	'applianceusername'    => 'admin',
	'appliancepassword'    => 'password',
	'applianceconnectmode' => 'https',
	'debuglevel'           => 0,
);

=head1 NAME

BlueCoat::SGOS - A module to interact with Blue Coat SGOS-based devices.

=head1 VERSION

Version 1.05

=cut

our $VERSION = '1.05';

=head1 SYNOPSIS

This module interacts with Blue Coat SGOS-based devices.  Right
now, this is limited to parsing of the 'sysinfo' data from the
device.

	use strict; #always!
	use BlueCoat::SGOS;
	my $bc = BlueCoat::SGOS->new(
		'appliancehost'		=> 'swg.example.com',
		'applianceport'		=> 8082,
		'applianceuser'		=> 'admin',
		'appliancepassword'	=> 'password'
	);
	$bc->get_sysinfo();
	$bc->parse_sysinfo();

	# or from a file
	my $bc = BlueCoat::SGOS->new();
	$bc->get_sysinfo_from_file('/path/to/file.sysinfo');
	$bc->parse_sysinfo();

	# or from a data structure
	# in this case, $sysinfodata already contains sysinfo data
	my $bc = BlueCoat::SGOS->new();
	$bc->get_sysinfo_from_data($sysinfodata);
	$bc->parse_sysinfo();

	my $sysinfodata = $bc->{'sgos_sysinfo'};
	my $sgosversion = $bc->{'sgosversion'};
	my $sgosreleaseid = $bc->{'sgosreleaseid'};
	my $serialnumber = $bc->{'serialnumber'};
	my $modelnumber = $bc->{'modelnumber'};
	my $sysinfotime = $bc->{'sysinfotime'};

	# Hardware section of the sysinfo file
	my $hwinfo = $bc->{'sgos_sysinfo_sect'}{'Hardware Information'};



( run in 1.022 second using v1.01-cache-2.11-cpan-b16cb0d3907 )