YATG/Config.pm

filter: Statementstmt 92.8% 13 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 88.8% 16 / 18 CC 1 SCAR 2.2
CC
1
Cov
93%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« RPC/Serialized/Handler/YATG/Store.pm ↑ Summary
1 package YATG::Config;
2 {
3 1 $YATG::Config::VERSION = '5.140510';
4 }
5  
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Module::MultiConf 0.0301;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 __PACKAGE__->Validate({
12 yatg => {
13 oids => { type => HASHREF },
14 dbi_connect => { type => ARRAYREF },
15 dbi_ip_query => { type => SCALAR, default =>
16 'SELECT ip FROM device WHERE extract(epoch from last_macsuck) > (extract(epoch from now()) - 7200)' },
17 dbi_host_query => { type => SCALAR, optional => 1 },
18 dbi_interfaces_query => { type => SCALAR, optional => 1 },
19 interval => { type => SCALAR, default => 300 },
20 timeout => { type => SCALAR, default => 280 },
21 max_pollers => { type => SCALAR, default => 20 },
22 debug => { type => SCALAR, default => 0 },
23 communities => { type => SCALAR | ARRAYREF,
24 default => 'public' },
25 mibdirs => { type => ARRAYREF, default => [qw(
26 /usr/share/netdisco/mibs/cisco
27 /usr/share/netdisco/mibs/rfc
28 /usr/share/netdisco/mibs/net-snmp
29 )] },
30 disk_root => { type => SCALAR, default => '/var/lib/yatg' },
31 newhosts_watch => { type => SCALAR, optional => 1 },
32 },
33 cache_memcached => {
34 servers => { type => ARRAYREF, optional => 1 },
35 namespace => { type => SCALAR, default => 'yatg:' },
36 },
37 rpc_serialized_client_inet => {
38 data_serializer => { type => HASHREF,
39 default => {serializer => 'YAML::Syck'} },
40 io_socket_inet => { type => HASHREF, optional => 1 },
41 },
42 log_dispatch_syslog => {
43 name => { type => SCALAR, default => 'yatg' },
44 ident => { type => SCALAR, default => 'yatg' },
45 min_level => { type => SCALAR, default => 'info' },
46 facility => { type => SCALAR, default => 'local1' },
47 callbacks => { type => CODEREF | ARRAYREF,
48 0 ▶ default => sub { return "$_[1]\n" } },
Subroutine __ANON__: not called CC=1 SCAR=6.9
49 },
50 1 nsca => {
51 nsca_server => { type => SCALAR, optional => 1 },
52 nsca_port => { type => SCALAR, default => '5667' },
53 send_nsca_cmd => { type => SCALAR, default => '/usr/bin/send_nsca' },
54 config_file => { type => SCALAR, default => '/etc/send_nsca.cfg' },
55 ignore_ports => { type => SCALAR, default => '^(?:Vlan|Po)\d+$' },
56 ignore_descr => { type => SCALAR, default => '(?:SPAN)' },
57 ignore_oper_descr => { type => SCALAR, optional => 1 },
58 ignore_error_descr => { type => SCALAR, optional => 1 },
59 ignore_discard_descr => { type => SCALAR, optional => 1 },
60 service_prefix => { type => SCALAR, default => 'Interfaces' },
61 threshold => { type => SCALAR, optional => 1 },
62 },
63 });
64  
65 1 1;
66  
67 # ABSTRACT: Configuration management for YATG
68  
69  
70 __END__
« RPC/Serialized/Handler/YATG/Store.pm ↑ Summary