Module: Telemetry::Snmp

Defined in:
lib/telemetry/snmp.rb,
lib/telemetry/snmp/api.rb,
lib/telemetry/snmp/auth.rb,
lib/telemetry/snmp/data.rb,
lib/telemetry/snmp/client.rb,
lib/telemetry/snmp/version.rb,
lib/telemetry/snmp/collector.rb,
lib/telemetry/snmp/publisher.rb,
lib/telemetry/snmp/auth/defaults.rb,
lib/telemetry/snmp/data/models/oid.rb,
lib/telemetry/snmp/controllers/oids.rb,
lib/telemetry/snmp/data/models/user.rb,
lib/telemetry/snmp/device_collector.rb,
lib/telemetry/snmp/controllers/users.rb,
lib/telemetry/snmp/controllers/walks.rb,
lib/telemetry/snmp/data/default_opts.rb,
lib/telemetry/snmp/data/models/device.rb,
lib/telemetry/snmp/controllers/devices.rb,
lib/telemetry/snmp/data/models/oid_walk.rb,
lib/telemetry/snmp/data/models/oid_group.rb,
lib/telemetry/snmp/controllers/oid_groups.rb,
lib/telemetry/snmp/data/models/device_cred.rb,
lib/telemetry/snmp/data/models/device_lock.rb,
lib/telemetry/snmp/controllers/device_creds.rb,
lib/telemetry/snmp/data/models/oid_oid_groups.rb,
lib/telemetry/snmp/data/models/user_audit_log.rb

Defined Under Namespace

Modules: AuthDefaults, Client, Collector, Controller, Data, Publisher Classes: API, Auth, DeviceCollector

Constant Summary collapse

VERSION =
'0.3.0'

Class Method Summary collapse

Class Method Details

.bootstrapObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/telemetry/snmp.rb', line 15

def bootstrap
  Telemetry::Logger.setup(level: 'info')
  Telemetry::Logger.info "Starting Telemetry::Snmp v#{Telemetry::Snmp::VERSION}"
  Telemetry::Snmp::Data.start!
  Telemetry::Snmp::Client.load_mibs
  Telemetry::Snmp::Publisher.start!
  Telemetry::Logger.info 'Telemetry::Snmp bootstrapped!'
  start_expire_devices
  start_collection
end

.start_collectionObject



37
38
39
40
41
42
# File 'lib/telemetry/snmp.rb', line 37

def start_collection
  @collection_task = Concurrent::TimerTask.new(execution_interval: 10, timeout_interval: 300) do
    Telemetry::Snmp::Collector.loop_devices
  end
  @collection_task.execute
end

.start_expire_devicesObject



26
27
28
29
30
31
# File 'lib/telemetry/snmp.rb', line 26

def start_expire_devices
  @expire_devices_task = Concurrent::TimerTask.new(execution_interval: 300, timeout_interval: 10) do
    Telemetry::Snmp::Collector.unlock_expired_devices
  end
  @expire_devices_task.execute
end

.stop_collectionObject



44
45
46
# File 'lib/telemetry/snmp.rb', line 44

def stop_collection
  @collection_task.stop
end

.stop_expire_devicesObject



33
34
35
# File 'lib/telemetry/snmp.rb', line 33

def stop_expire_devices
  @expire_devices_task.stop
end