remove private changes

This commit is contained in:
tuna 2013-10-14 10:51:24 +07:00
parent dc151115be
commit fca6d56681
5 changed files with 18 additions and 12 deletions

10
scripts/vm/hypervisor/xenserver/perfmon.py Normal file → Executable file
View File

@ -5,7 +5,7 @@ import XenAPI
import urllib
from xml.dom import minidom
import time
import commands
# Per VM dictionary (used by RRDUpdates to look up column numbers by variable names)
class VMReport(dict):
@ -179,6 +179,11 @@ class RRDUpdates:
else:
raise PerfMonException("Invalid string in <legend>: %s" % col_meta_data)
def getuuid(vm_name):
status, output = commands.getstatusoutput("xe vm-list | grep "+vm_name+" -B 1 | head -n 1 | awk -F':' '{print $2}' | tr -d ' '")
if (status != 0):
raise PerfMonException("Invalid vm name: %s" % vm_name)
return output
def get_vm_group_perfmon(args={}):
#Release code
@ -213,7 +218,8 @@ def get_vm_group_perfmon(args={}):
#for uuid in rrd_updates.get_vm_list():
for vm_count in xrange(1, total_vm + 1):
vm_uuid = args['vmuuid' + str(vm_count)]
vm_name = args['vmname' + str(vm_count)]
vm_uuid = getuuid(vm_name)
#print "Got values for VM: " + str(vm_count) + " " + vm_uuid
for counter_count in xrange(1, total_counter + 1):
counter = args['counter' + str(counter_count)]

View File

@ -145,8 +145,8 @@ def heartbeat(session, args):
@echo
def asmonitor(session, args):
result = perfmon.get_vm_group_perfmon(args)
return result
result = perfmon.get_vm_group_perfmon(args)
return result
if __name__ == "__main__":
XenAPIPlugin.dispatch({"forceShutdownVM":forceShutdownVM, "upgrade_snapshot":upgrade_snapshot, "create_privatetemplate_from_snapshot":create_privatetemplate_from_snapshot, "copy_vhd_to_secondarystorage":copy_vhd_to_secondarystorage, "copy_vhd_from_secondarystorage":copy_vhd_from_secondarystorage, "setup_heartbeat_sr":setup_heartbeat_sr, "setup_heartbeat_file":setup_heartbeat_file, "check_heartbeat":check_heartbeat, "heartbeat": heartbeat, "asmonitor": asmonitor})

View File

@ -916,7 +916,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
return false;
}
if (provider.get(0) == Provider.Netscaler || provider.get(0) == Provider.F5BigIp ||
provider.get(0) == Provider.VirtualRouter || provider.get(0) == Provider.VPCVirtualRouter) {
provider.get(0) == Provider.VirtualRouter) {
return true;
}
return false;

View File

@ -413,12 +413,12 @@ CREATE TABLE `cloud`.`autoscale_vmgroup_vm_map` (
INDEX `i_autoscale_vmgroup_vm_map__vmgroup_id`(`vmgroup_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1, UUID(), 'snmp','Linux User CPU - percentage', '1.3.6.1.4.1.2021.11.9.0', now());
--INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (2, UUID(), 'snmp','Linux System CPU - percentage', '1.3.6.1.4.1.2021.11.10.0', now());
--INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (3, UUID(), 'snmp','Linux CPU Idle - percentage', '1.3.6.1.4.1.2021.11.11.0', now());
--INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (100, UUID(), 'netscaler','Response Time - microseconds', 'RESPTIME', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1, UUID(), 'cpu','Linux User CPU - percentage', '1.3.6.1.4.1.2021.11.9.0', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (2, UUID(), 'memory','Linux User RAM - percentage', '1.3.6.1.4.1.2021.11.10.0', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1, UUID(), 'snmp','Linux User CPU - percentage', '1.3.6.1.4.1.2021.11.9.0', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (2, UUID(), 'snmp','Linux System CPU - percentage', '1.3.6.1.4.1.2021.11.10.0', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (3, UUID(), 'snmp','Linux CPU Idle - percentage', '1.3.6.1.4.1.2021.11.11.0', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (100, UUID(), 'netscaler','Response Time - microseconds', 'RESPTIME', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1, UUID(), 'cpu','Linux User CPU - percentage', '1.3.6.1.4.1.2021.11.9.1', now());
INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (2, UUID(), 'memory','Linux User RAM - percentage', '1.3.6.1.4.1.2021.11.10.1', now());
CREATE TABLE `cloud`.`user_ipv6_address` (
`id` bigint unsigned NOT NULL UNIQUE auto_increment,

View File

@ -25,7 +25,7 @@ region.id=1
# CloudStack database settings
db.cloud.username=cloud
db.cloud.password=cloud
db.root.password=123
db.root.password=
db.cloud.host=localhost
db.cloud.port=3306
db.cloud.name=cloud