Puppet Class: profile::fastnetmon

Defined in:
modules/profile/manifests/fastnetmon.pp

Overview

Class profile::fastnetmon

Sets up Fastnetmon: netflow collector and DDoS detection

Parameters:

  • thresholds_overrides (Hash[String, Hash[String, Any]]) (defaults to: lookup('profile::fastnetmon::thresholds_overrides'))


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'modules/profile/manifests/fastnetmon.pp', line 3

class profile::fastnetmon (
  Hash[String, Hash[String, Any]] $thresholds_overrides = lookup('profile::fastnetmon::thresholds_overrides'),
  ) {

    include network::constants

    ensure_resource('class', 'geoip')

    $icinga_dir = '/run/fastnetmon_icinga'

    class { '::fastnetmon':
        networks             => $::network::constants::external_networks,
        thresholds_overrides => $thresholds_overrides,
        icinga_dir           => $icinga_dir,
    }

    $nrpe_path = '/usr/local/lib/nagios/plugins/check_fastnetmon'
    file { $nrpe_path:
        ensure => present,
        source => 'puppet:///modules/profile/fastnetmon/check_fastnetmon.sh',
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
    }
    nrpe::monitor_service { 'fastnetmon':
        description     => 'fastnetmon is alerting',
        nrpe_command    => "${nrpe_path} ${icinga_dir}",
        notes_url       => 'https://bit.ly/wmf-fastnetmon',
        dashboard_links => [ 'https://w.wiki/8oU', ],
        retries         => 15,
        critical        => true,
    }

    ferm::service { 'FNM-netflow':
        proto => 'udp',
        port  => '2055',
        desc  => 'FNM-netflow',
      srange  => '($NETWORK_INFRA $MGMT_NETWORKS)',
    }

    logrotate::rule { 'fastnetmon':
        ensure        => present,
        file_glob     => '/var/log/fastnetmon.log',
        frequency     => 'daily',
        copy_truncate => true,
        missing_ok    => true,
        compress      => true,
        not_if_empty  => true,
        rotate        => 15,
    }
}