Varnish::API - Perl extension for accessing varnish stats and logs
use Varnish::API; use Sys::Hostname qw(hostname); my $vd = Varnish::API::VSL_New(); Varnish::API::VSL_OpenLog($vd, hostname); Varnish::API::VSL_Dispatch($vd, sub { my ($tag, $id, $spec, $text) = @_; return 1 }); my $log = Varnish::API::VSL_NextLog($vd); my $tag = Varnish::API::VSL_tags(Varnish::API::SHMLOG_TAG($log)); my $fd = Varnish::API::SHMLOG_ID($log); my $text = Varnish::API::SHMLOG_DATA($log); my $stats = Varnish::API::VSL_OpenStats(hostname); my $fields = Varnish::API::VSL_GetStatFieldTypes(); my $description = Varnish::API::VSL_GetStatFieldDescriptions(); my $client_conn = Varnish::API::VSL_GetStat($stats, "client_conn");
This module allows access to the data that varnishlog and varnishstats can read.
None by default.
Artur Bergman <sky+cpan@crucially.net>
Copyright (C) 2009 by Artur Bergman
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Varnish::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Varnish::API
CPAN shell
perl -MCPAN -e shell install Varnish::API
For more information on module installation, please visit the detailed CPAN module installation guide.