A new prog is added to install the node_exporter on VmHosts. A flag is also added to make sure the application will serve the metrics on localhost instead of all network interfaces. For the VmHosts which are already setup and do not have the app installed we can create this strand: Strand.create(prog: "SetupNodeExporter", label: "start", stack: [{subject_id: vm_host.id}])
12 lines
245 B
Ruby
12 lines
245 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Prog::SetupNodeExporter < Prog::Base
|
|
subject_is :sshable
|
|
|
|
label def start
|
|
version = "1.9.1"
|
|
sshable.cmd("sudo host/bin/setup-node-exporter #{version}")
|
|
pop "node exporter was setup"
|
|
end
|
|
end
|