mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
parent
8b34f35896
commit
459433e80f
@ -41,6 +41,7 @@ class NsxMonitor
|
||||
attr_accessor :nsx_status
|
||||
|
||||
def initialize(host_id)
|
||||
@host_id = host_id
|
||||
@nsx_client = nil
|
||||
@nsx_status = ''
|
||||
return unless nsx_ready?
|
||||
@ -118,8 +119,7 @@ class NsxMonitor
|
||||
|
||||
def nsx_ready?
|
||||
@one_item = VCenterDriver::VIHelper
|
||||
.one_item(OpenNebula::Host,
|
||||
@vi_client.instance_variable_get(:@host_id).to_i)
|
||||
.one_item(OpenNebula::Host, @host_id.to_i)
|
||||
|
||||
# Check if NSX_MANAGER is into the host template
|
||||
if [nil, ''].include?(@one_item['TEMPLATE/NSX_MANAGER'])
|
||||
|
@ -297,8 +297,8 @@ class ClusterMonitor
|
||||
|
||||
customizations.each do |c|
|
||||
t = 'CUSTOMIZATION = [ '
|
||||
t << %(<NAME = "#{c.name}", >)
|
||||
t << %(<TYPE = "#{c.type}" ]\n>)
|
||||
t << %Q<NAME = "#{c.name}", >
|
||||
t << %Q<TYPE = "#{c.type}" ]\n>
|
||||
|
||||
text << t
|
||||
end
|
||||
@ -494,7 +494,7 @@ class ClusterMonitor
|
||||
vm_info << "IMPORT_TEMPLATE=\"#{vm_template64}\","
|
||||
end
|
||||
|
||||
vm_info << "POLL=\"#{self.info.gsub('"', '\\"')}\"]"
|
||||
vm_info << "POLL=\"#{self.info.gsub('"', "\\\"")}\"]"
|
||||
rescue StandardError => e
|
||||
vm_info = error_monitoring(e, vm_ref, info)
|
||||
end
|
||||
|
@ -16,14 +16,28 @@
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
HID=$2
|
||||
HNAME=$3
|
||||
|
||||
STDIN=`cat -`
|
||||
|
||||
CLIENT_PID_FILE=/tmp/one-monitord-$HID.pid
|
||||
|
||||
(
|
||||
[ -f /tmp/one-monitord-client.pid ] || exit 0
|
||||
running_pid=$(cat /tmp/one-monitord-client.pid)
|
||||
pids=$(ps axuwww | grep -e "/monitord-client.rb vcenter" | grep -v grep | awk '{ print $2 }' | grep -v "^${running_pid}$")
|
||||
[ -f $CLIENT_PID_FILE ] || exit 0
|
||||
|
||||
running_pid=$(cat $CLIENT_PID_FILE)
|
||||
pids=$(ps axuwww | grep -e "/monitord-client.rb.*${HID} " | grep -v grep | \
|
||||
awk '{ print $2 }' | grep -v "^${running_pid}$")
|
||||
|
||||
if [ -n "$pids" ]; then
|
||||
kill -6 $pids
|
||||
kill $pids
|
||||
fi
|
||||
|
||||
) > /dev/null
|
||||
oned=`ps auxwww | grep oned | grep -v grep | wc -l`
|
||||
|
||||
if [ ${oned} -eq 0 ]; then
|
||||
kill ${running_pid}
|
||||
fi
|
||||
|
||||
) > /dev/null
|
@ -35,7 +35,8 @@ $LOAD_PATH << RUBY_LIB_LOCATION
|
||||
require 'nsx_driver'
|
||||
require_relative '../../../lib/nsx.rb'
|
||||
|
||||
host_id = ARGV[1]
|
||||
host = ARGV[-1]
|
||||
host_id = ARGV[-2]
|
||||
|
||||
# Vcenter and NSX connection
|
||||
begin
|
||||
|
@ -18,7 +18,8 @@
|
||||
|
||||
require_relative '../../../lib/vcenter.rb'
|
||||
|
||||
host_id = ARGV[1]
|
||||
host = ARGV[-1]
|
||||
host_id = ARGV[-2]
|
||||
|
||||
begin
|
||||
# Vcenter connection
|
||||
|
Loading…
x
Reference in New Issue
Block a user