NAME

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

VERSION

Version 1.05

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'};

# Software configuration (i.e. show configuration)
my $swconfig = $bc->{'sgos_sysinfo_sect'}{'Software Configuration'};

SUBROUTINES/METHODS

Below are methods for BlueCoat::SGOS.

new

Creates a new BlueCoat::SGOS object. Can be passed one of the following:

appliancehost
applianceport
applianceusername
appliancepassword
applianceconnectmode (one of http or https)
debuglevel

get_sysinfo

Takes no parameters, but instead fetches the sysinfo from the appliance specified in the constructor.

$bc->get_sysinfo();

get_sysinfo_from_file

Takes one parameter: the filename of a sysinfo file on the disk. Use this instead of logging in over the network.

$bc->get_sysinfo_from_file('sysinfo.filename.here');

get_sysinfo_from_data

Takes one parameter: a scalar that contains sysinfo data. Use this instead of logging in over the network.

$bc->get_sysinfo_from_data($sysinfodata);

parse_sysinfo

Takes no parameters. Tells the object to parse the sysinfo data and populate the object variables.

vpmcpl

Displays the VPM-CPL data. Note that this does not currently return the local, central, or forwarding policies.

vpmxml

Displays the VPM-XML data.

send_command

Takes one parameter: a scalar that contains configuration commands to send to the appliance. This command is executed in configuration mode.

my $output = $bc->send_command('show version');
# or
my $commands =qq{
	int 0:0
	speed 100
};
my $output = $bc->send_command($commands);

Other Data

Other data that is directly accessible in the object:

Appliance Name:   $bc->{'appliance-name'}
Model Number:     $bc->{'modelnumber'}
Serial Number:    $bc->{'serialnumber'}
SGOS Version:     $bc->{'sgosversion'}
Release ID:       $bc->{'sgosreleaseid'}
Default Gateway:  $bc->{'ip-default-gateway'}
Sysinfo Time:     $bc->{'sysinfotime'}
Accelerator Info: $bc->{'ssl-accelerator'}

The software configuration can be retrieved as follows:
	$bc->{'sgos_sysinfo_sect'}{'Software Configuration'}

Other sections that can be retrieved:
	$bc->{'sgos_sysinfo_sect'}{'Software Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'ADN Compression Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'ADN Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'ADN Node Info'}
	$bc->{'sgos_sysinfo_sect'}{'ADN Sizing Peers'}
	$bc->{'sgos_sysinfo_sect'}{'ADN Sizing Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'ADN Tunnel Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'AOL IM Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Access Log Objects'}
	$bc->{'sgos_sysinfo_sect'}{'Access Log Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Authenticator Memory Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Authenticator Realm Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Authenticator Total Realm Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'CCM Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'CCM Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'CIFS Memory Usage'}
	$bc->{'sgos_sysinfo_sect'}{'CIFS Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'CPU Monitor'}
	$bc->{'sgos_sysinfo_sect'}{'CacheEngine Main'}
	$bc->{'sgos_sysinfo_sect'}{'Configuration Change Events'}
	$bc->{'sgos_sysinfo_sect'}{'Content Filter Status'}
	$bc->{'sgos_sysinfo_sect'}{'Core Image'}
	$bc->{'sgos_sysinfo_sect'}{'Crypto Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'DNS Cache Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'DNS Query Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Disk 1'}
	... and up to Disk 10, in some cases
	$bc->{'sgos_sysinfo_sect'}{'Endpoint Mapper Internal Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Endpoint Mapper Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Endpoint Mapper database contents'}
	$bc->{'sgos_sysinfo_sect'}{'FTP Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Forwarding Settings'}
	$bc->{'sgos_sysinfo_sect'}{'Forwarding Statistics Per IP'}
	$bc->{'sgos_sysinfo_sect'}{'Forwarding Summary Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Forwarding health check settings'}
	$bc->{'sgos_sysinfo_sect'}{'Forwarding health check statistics'}
	$bc->{'sgos_sysinfo_sect'}{'HTTP Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'HTTP Main'}
	$bc->{'sgos_sysinfo_sect'}{'HTTP Requests'}
	$bc->{'sgos_sysinfo_sect'}{'HTTP Responses'}
	$bc->{'sgos_sysinfo_sect'}{'Hardware Information'}
	$bc->{'sgos_sysinfo_sect'}{'Hardware sensors'}
	$bc->{'sgos_sysinfo_sect'}{'Health Monitor'}
	$bc->{'sgos_sysinfo_sect'}{'Health check entries'}
	$bc->{'sgos_sysinfo_sect'}{'Health check statistics'}
	$bc->{'sgos_sysinfo_sect'}{'ICP Hosts'}
	$bc->{'sgos_sysinfo_sect'}{'ICP Settings'}
	$bc->{'sgos_sysinfo_sect'}{'ICP Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'IM Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'Kernel Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Licensing Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Client Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Conversation Client Errors'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Conversation Other Errors'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Conversation Server Errors'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Errors'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Internal Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Server Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'MAPI Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'MMS Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'MMS General'}
	$bc->{'sgos_sysinfo_sect'}{'MMS Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'MMS Streaming Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'MSN IM Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'OPP Services'}
	$bc->{'sgos_sysinfo_sect'}{'OPP Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'P2P Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Persistent Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Policy Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Policy'}
	$bc->{'sgos_sysinfo_sect'}{'Priority 1 Events'}
	$bc->{'sgos_sysinfo_sect'}{'Quicktime Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'Quicktime Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'RIP Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Real Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'Real Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Refresh Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'SCSI Disk Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'SOCKS Gateways Settings'}
	$bc->{'sgos_sysinfo_sect'}{'SOCKS Gateways Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'SOCKS Proxy Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'SSL Proxy Certificate Cache'}
	$bc->{'sgos_sysinfo_sect'}{'SSL Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Security processor Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Server Side persistent connections'}
	$bc->{'sgos_sysinfo_sect'}{'Services Management Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Services Per-service Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Services Proxy Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Software Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'System Memory Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'TCP/IP ARP Information'}
	$bc->{'sgos_sysinfo_sect'}{'TCP/IP Listening list'}
	$bc->{'sgos_sysinfo_sect'}{'TCP/IP Malloc Information'}
	$bc->{'sgos_sysinfo_sect'}{'TCP/IP Routing Table'}
	$bc->{'sgos_sysinfo_sect'}{'TCP/IP Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Threshold Monitor Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Version Information'}
	$bc->{'sgos_sysinfo_sect'}{'WCCP Configuration'}
	$bc->{'sgos_sysinfo_sect'}{'WCCP Statistics'}
	$bc->{'sgos_sysinfo_sect'}{'Yahoo IM Statistics'}
	

The details for interface 0:0 are stored here:
	IP address:   $bc->{'interface'}{'0:0'}{'ip'} 
	Netmask:      $bc->{'interface'}{'0:0'}{'netmask'} 
	MAC address:  $bc->{'interface'}{'0:0'}{'mac'} 
	Link status:  $bc->{'interface'}{'0:0'}{'linkstatus'} 
	Capabilities: $bc->{'interface'}{'0:0'}{'capabilities'} 

You can retrieve the interface names like this:
	my @interfaces = keys %{$bc->{'interface'}};

The route table can	be retrieved as follows:
	$bc->{'sgos_sysinfo_sect'}{'TCP/IP Routing Table'}

The static route table can be retrieved as follows:
	$bc->{'static-route-table'}

The WCCP configuration can be retrieved as follows:
	$bc->{'sgos_sysinfo_sect'}{'WCCP Configuration'}

AUTHOR

Matthew Lange <mmlange@cpan.org>

BUGS

Please report any bugs or feature requests through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=BlueCoat-SGOS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc BlueCoat::SGOS

You can also look for information at:

LICENSE

Copyright (C) 2008-2012 Matthew Lange

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.