Puppet Function: dynatrace_clean_agent

Defined in:
lib/puppet/parser/functions/dynatrace_functions.rb
Function type:
Ruby 3.x API

Overview

dynatrace_clean_agent()Any

Returns:

  • (Any)


78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/puppet/parser/functions/dynatrace_functions.rb', line 78

newfunction(:dynatrace_clean_agent, :type => :rvalue) do |args|
    puts "dynatrace_clean_agent user=#{resource[:installer_owner]}"
    
    #this should stop any dynaTraceServer process on agent node
    stop_processes('dynaTraceServer', "#{resource[:installer_owner]}", 'rhel', 5, 'TERM')
    
    #Stop any running instance of dynatrace service: dtserver
    stop_processes('dtserver', nil, 'rhel', 5, 'TERM')

    #Stop any running instance of dynatrace service: dtfrontendserver
    stop_processes('dtfrontendserver', nil, 'rhel', 5, 'TERM')
    
    #this should stop any dynatrace user process on agent node
    #stop_processes(nil, "#{resource[:installer_owner]}", 'rhel', 5, 'TERM')
    

    
    #this should stop any dynaTraceServer process on agent node
    stop_processes('dynaTraceServer', "#{resource[:installer_owner]}", 'rhel', 5, 'KILL')
    
    #Stop any running instance of dynatrace service: dtserver
    stop_processes('dtserver', nil, 'rhel', 5, 'KILL')

    #Stop any running instance of dynatrace service: dtfrontendserver
    stop_processes('dtfrontendserver', nil, 'rhel', 5, 'KILL')
    
  return 1
end