blib/lib/App/NetdiscoX/Web/Plugin/Observium.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 19 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package App::NetdiscoX::Web::Plugin::Observium;
2  
3 our $VERSION = '2.004000';
4  
5 use Dancer ':syntax';
6 use App::Netdisco::Web::Plugin;
7  
8 use File::ShareDir 'dist_dir';
9 register_template_path(
10 dist_dir( 'App-NetdiscoX-Web-Plugin-Observium' ));
11  
12 register_device_port_column({
13 name => 'observium',
14 position => 'mid',
15 label => 'Traffic',
16 default => 'on',
17 });
18  
19 register_css('observium');
20 register_javascript('observium');
21  
22 =head1 NAME
23  
24 App::NetdiscoX::Web::Plugin::Observium - Port Traffic Links and Thumbnail Graphs from Observium
25  
26 =head1 SYNOPSIS
27  
28 # in your ~/environments/deployment.yml file
29
30 extra_web_plugins:
31 - X::Observium
32
33 plugin_observium:
34 location: "https://web-server.example.com/"
35 open_in_same_window: false
36  
37 =head1 Description
38  
39 This is a plugin for the L<App::Netdisco> network management application. It
40 adds a column to the Device Ports table named "Traffic" with a link and
41 thumbnail graph for the port, taken from a local Observium installation.
42  
43 =head1 Configuration
44  
45 Create an entry in your C<~/environments/deployment.yml> file named
46 "C<plugin_observium>", containing the following settings:
47  
48 =head2 location
49  
50 Value: String, Required.
51  
52 Full URL to your local Observium server, including HTTP/HTTPS scheme (as in
53 the example above).
54  
55 =head2 open_in_same_window
56  
57 Value: Boolean. Default: false.
58  
59 If set to true, the hyperlink is configured to open the port's Observium page
60 in the same browser window or tab as Netdisco. The default is false.
61  
62 =head1 AUTHOR
63  
64 Oliver Gorwits <oliver@cpan.org>
65  
66 =head1 COPYRIGHT AND LICENSE
67
68 This software is copyright (c) 2013 by The Netdisco Developer Team.
69
70 Redistribution and use in source and binary forms, with or without
71 modification, are permitted provided that the following conditions are met:
72 * Redistributions of source code must retain the above copyright
73 notice, this list of conditions and the following disclaimer.
74 * Redistributions in binary form must reproduce the above copyright
75 notice, this list of conditions and the following disclaimer in the
76 documentation and/or other materials provided with the distribution.
77 * Neither the name of the Netdisco Project nor the
78 names of its contributors may be used to endorse or promote products
79 derived from this software without specific prior written permission.
80
81 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
82 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
83 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
84 DISCLAIMED. IN NO EVENT SHALL THE NETDISCO DEVELOPER TEAM BE LIABLE FOR ANY
85 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
86 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
87 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
88 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
89 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
90 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
91  
92 =cut
93  
94 true;