Net::Radiator::Monitor - Perl interface to Radiator Monitor command language
This module provides a Perl interface to Radiator Monitor command language.
use strict; use warnings; use Net::Radiator::Monitor; use Carp qw(croak); my $monitor = Net::Radiator::Monitor->new( user => $user, passwd => $passwd, server => $server, port => 9084, timeout => 5 ) or croak "Unable to create monitor: $!\n"; print $monitor->id; $monitor->quit;
my $monitor = Net::Radiator::Monitor->new( user => $user, passwd => $passwd, server => $server, );
Constructor - creates a new Net::Radiator::Monitor object using the specified parameters. This method takes three mandatory and two optional parameters.
The username to use to connect to the monitor interface. This username must have the required access to connect to the monitor.
The password for the username use to connect to the monitor interface.
The server to connect to - this should be either a resolvable hostname or an IP address.
The port on which to connect to the monitor interface - this parameter is optional and if not specified will default to the Radiator default port of 9084.
The connection timeout value and recieve timeout value for the connection to the Radiator server - this parameter is optional and if not specified will default to five seconds.
$monitor->quit;
Closes the monitor connection.
my $id = $monitor->id;
Returns the Radiator server ID string. the string has the following format:
ID <local_timestamp> Radiator <version> on <servername>
Where:
Is the current local time on the server given in seconds since epoch.
Is the Radiator server version.
Is the configured server name.
my %server_stats = $monitor->server_stats; foreach my $stats (sort keys %server_stats) { print "$stats : $server_stats{$stats}\n" }
Returns a hash containing name,value pairs of collected server statistics. Server statistics are culminative values of access and accounting across all configured objects.
The measured statistics (and the keys of the hash) are:
Access challenges Access rejects Access requests Accounting requests Accounting responses Average response time Bad authenticators in accounting requests Bad authenticators in authentication requests Dropped access requests Dropped accounting requests Duplicate access requests Duplicate accounting requests Malformed access requests Malformed accounting requests Total Bad authenticators in requests Total dropped requests Total duplicate requests Total proxied requests Total proxied requests with no reply Total requests
my %client_stats = $monitor->client_stats($client_id);
Returns a hash containing name,value pairs of collected statistics for client specified by the value of the client id. The available statistics are the same as those listed for the server_stats method.
The list_clients method can be sed to retrieve valid client IDs.
while (($id, $name) = each $monitor->list-clients) { print "Client : $name - ID : $id\n" }
Returns a hash containing all configured clients where the key is the numerical identifier for the realm and the value is the client name or IP address (dependent on configuration).
Returns a hash containing all configured realms where the key is the numerical identifier for the realm and the value is the realm name.
Returns a hash containing all configured handlers where the key is the numerical identifier for the handler and the value is the handler name.
Luke Poskitt, <ltp at cpan.org>
<ltp at cpan.org>
Please report any bugs or feature requests to bug-net-radiator-monitor at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Radiator-Monitor. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-radiator-monitor at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::Radiator::Monitor
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Radiator-Monitor
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-Radiator-Monitor
CPAN Ratings
http://cpanratings.perl.org/d/Net-Radiator-Monitor
Search CPAN
http://search.cpan.org/dist/Net-Radiator-Monitor/
Copyright 2012 Luke Poskitt.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Net::Radiator::Monitor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Radiator::Monitor
CPAN shell
perl -MCPAN -e shell install Net::Radiator::Monitor
For more information on module installation, please visit the detailed CPAN module installation guide.