Puppet Class: librenms::discovery

Inherits:
librenms::params
Defined in:
manifests/discovery.pp

Overview

Parameters:

  • librenms_server (String) (defaults to: '')
  • api_token (String) (defaults to: '')
  • transport_protocol (Enum['http', 'https']) (defaults to: 'http')


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'manifests/discovery.pp', line 2

class librenms::discovery(
    String $librenms_server = '',
    String $api_token = '',
    Enum['http', 'https'] $transport_protocol = 'http',
) inherits librenms::params {

    ensure_packages([$librenms::params::curl_package], {ensure => present})

    $curl_bin = $librenms::params::curl_bin

    exec {'trigger_discovery':
        command     => "${curl_bin} -s -L -H 'X-Auth-Token: ${api_token}' ${transport_protocol}://${librenms_server}/api/v0/devices/${facts['fqdn']}/discover",
        refreshonly => true,
    }
}