How to read zookeeper object

    FetchNSXStatus:
        Type: NSX
        TestNSX: "nsxmanager.[1]"
        PersistData: "Yes"
        read:
            'mem_total[?]defined': ''
	  
	  
	FetchSNMPHostResourcesMIB:
        Type: "SnmpManager"
        TestSnmpManager : "nsxmanager.[1].snmpmanager.[1]"
        manager_ip: 'nsxmanager.[1]'
        hostresourcesmib:
            'snmp_response':
                'HOST-RESOURCES-MIB::hrMemorySize."0"[?]equal_to' : 'nsxmanager[1]->read->mem_total'


1 Start the zookeeper server
/tmp/vdnet/20141020-181332/zookeeper-4668/bin/zkServer.sh start

2 Get the port number of server
cat /tmp/vdnet/20141020-181332/zookeeper-4668/conf/zoo.cfg
clientPort=2188

3 Start the zookeeper session
/tmp/vdnet/20141020-181332/zookeeper-4668/bin/zkCli.sh -server localhost:2188

[zk: localhost:2188(CONNECTED) 5] get /testbed/nsxmanager/1/runtime/read/fetchnsxstatus/1
{mem_cache => 377684,mem_used => 3213708,mem_total => 12283916,swap_total => 0,load_average => [],swap_used => 0,revision => undef,file_systems => [{file_system => '/dev/sda2',used => 1233548,mount => '/',type => 'ext3',total => 4128448},{file_system => 'shm',used => 0,mount => '/dev/shm',type => 'tmpfs',total => 6141956},{file_system => '/dev/sda6',used => 154624,mount => '/var/log',type => 'ext3',total => 10321208},{file_system => '/dev/sda8',used => 186328,mount => '/common',type => 'ext3',total => 16513960}],uptime => 2231070,cpu_cores => 4}

你可能感兴趣的:(zookeeper)