~ubuntu-branches/debian/lenny/smokeping/lenny

« back to all changes in this revision

Viewing changes to lib/probes/EchoPingIcp.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jose Carlos Garcia Sogo
  • Date: 2002-04-02 15:02:08 UTC
  • Revision ID: james.westby@ubuntu.com-20020402150208-8eycqntc07q6gig5
Tags: upstream-1.6
ImportĀ upstreamĀ versionĀ 1.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package probes::EchoPingIcp;
 
2
 
 
3
=head1 NAME
 
4
 
 
5
probes::EchoPingIcp - an echoping(1) probe for SmokePing
 
6
 
 
7
=head1 OVERVIEW
 
8
 
 
9
Measures ICP (Internet Cache Protocol, spoken by web caches)
 
10
roundtrip times for SmokePing.
 
11
 
 
12
=head1 SYNOPSYS
 
13
 
 
14
 *** Probes ***
 
15
 + EchoPingIcp
 
16
 
 
17
 binary = /usr/bin/echoping # mandatory
 
18
 
 
19
 *** Targets ***
 
20
 
 
21
 probe = EchoPingHttp
 
22
 
 
23
 + PROBE_CONF
 
24
 # this can be overridden in the targets' PROBE_CONF sections
 
25
 url = / 
 
26
 
 
27
 
 
28
=head1 DESCRIPTION
 
29
 
 
30
Supported probe-specific variables: those specified in EchoPing(3pm) 
 
31
documentation.
 
32
 
 
33
Supported target-specific variables:
 
34
 
 
35
=over
 
36
 
 
37
=item those specified in EchoPing(3pm) documentation 
 
38
 
 
39
except I<fill>, I<size> and I<udp>.
 
40
 
 
41
=item url
 
42
 
 
43
The URL to be requested from the web cache. 
 
44
 
 
45
=back
 
46
 
 
47
=head1 AUTHOR
 
48
 
 
49
Niko Tyni E<lt>ntyni@iki.fiE<gt>
 
50
 
 
51
=head1 SEE ALSO
 
52
 
 
53
EchoPing(3pm), EchoPingHttp(3pm)
 
54
 
 
55
=cut
 
56
 
 
57
use strict;
 
58
use base qw(probes::EchoPing);
 
59
use Carp;
 
60
 
 
61
sub _init {
 
62
        my $self = shift;
 
63
        # Icp doesn't fit with filling or size
 
64
        my $arghashref = $self->features;
 
65
        delete $arghashref->{size};
 
66
        delete $arghashref->{fill};
 
67
}
 
68
 
 
69
sub proto_args {
 
70
        my $self = shift;
 
71
        my $target = shift;
 
72
        my $url = $target->{vars}{url};
 
73
        $url = $self->{properties}{url} unless defined $url;
 
74
        $url = "/" unless defined $url;
 
75
 
 
76
        my @args = ("-i", $url);
 
77
 
 
78
        return @args;
 
79
}
 
80
 
 
81
sub test_usage {
 
82
        my $self = shift;
 
83
        my $bin = $self->{properties}{binary};
 
84
        croak("Your echoping binary doesn't support ICP")
 
85
                if `$bin -i/ foo 2>&1` =~ /not compiled|usage/i;
 
86
        $self->SUPER::test_usage;
 
87
        return;
 
88
}
 
89
 
 
90
sub ProbeDesc($) {
 
91
        return "ICP pings using echoping(1)";
 
92
}
 
93
 
 
94
1;