{
    "name"  : "智能信息收集",
    "problems" : {
        "sys_status" : {
            "desc"      : "###使能的业务模块或特殊接口:${0}",
            "advice"    : "###以上模块风险较高的模块有:${1}"
        }
    }
}
---------------------------code-------------------------------
isBigbox =  precondition('bigbox')
print isBigbox

if isBigbox :
    cm_collected = false
	is_in_cm = false
    selectedSlot = precondition('selectedSlot')
	print selectedSlot
	res = cli('show version slot')
	slots_arr = res.split(/\r?\n/ig);
	slot_num = 3
	while slot_num < (slots_arr.length - 1):
		print slots_arr[slot_num]
		slot_temp = slots_arr[slot_num]
		slot_info = slot_temp.split(/\s+/g)
		print 'slot_info:' + slot_info[2]
		if slot_temp.indexOf('none') == -1 && slot_temp.indexOf('RSR77-SIP1') == -1:
			if (selectedSlot == 'ALL') :
				slots_arr[slot_num] = slot_info[2]
			else :
				if (selectedSlot != slot_info[2]) :
					slots_arr[slot_num] = 'none'
				else :
					slots_arr[slot_num] = slot_info[2]
				end
			end
		else :
			slots_arr[slot_num] = 'none'
		end

		print 'slot info:' + slots_arr[slot_num]
		if (slots_arr[slot_num] != 'none') && (slots_arr[slot_num] != 'F1') && (slots_arr[slot_num] != 'F2') &&  ((slots_arr[slot_num] != 'M1' && slots_arr[slot_num] != 'M2') || ((slots_arr[slot_num] == 'M1' || slots_arr[slot_num] == 'M2') && cm_collected == false)):
		    card = '*********Collect card：' + slots_arr[slot_num] + ' ****************'
			cli(card)
			print 'card:' +slots_arr[slot_num]

			cli('enable')
			if slots_arr[slot_num] == 'M1' || slots_arr[slot_num] == 'M2':
				print 'cellect cm card'
				enabled_module = '\r\n'
				high_risk_module = '\r\n'
				cm_collected = true
				is_in_cm = true
				cli('show run')
				cli('show start')
				cli('show clock')
				cli('show version')
				cli('show version slot')
				cli('show users')
			else :
				is_in_cm = false
				clicmd = 'vtty ' + slots_arr[slot_num]
				cli(clicmd,'.')
				cli('enable')
			end
			cli('show log')
			cli('show environment')
			cli('show temperature')
			cli('dir')
			cli('show cpu')
			cli('show memory')
			cli('show debugging')
			cli('debug sup')
			cli('show pool')
			cli('show task')
			cli('show hisr')
			cli('show irq')
			cli('show timer')
			cli('show semaphore')
			cli('show eventgroup')
			cli('show skbuff')
			cli('show dconf')
			cli('show exception')
			cli('enable')
			if 	is_in_cm == true :
				cli('show hpg all')
				cli('show redundancy fsm')
				cli('show redundancy state')
				cli('show redundancy auto-sync')
				cli('show redundancy switchtimeout')
				cli('show checkpoint client')
			end
			cli('show ip fpm statistics')
			cli('show ip fpm counters')
			if 	is_in_cm == true :
				cli('show interfaces ')
				cli('show ntp status')
				cli('show sntp')
				cli('show arp')
				cli('show ip route')
			end
			cli('show ip ref route')
			cli('show ip ref adjacency')
			cli('show ip ref route statistic')
			cli('show ip ref adjacency statistic')
			cli('show ip ref pkt-statistic')

			res = cli('show run | in ipv6 address')
			ipv6Arr = res.split(/\r?\n/ig)
			if ipv6Arr.length > 2 :
				cli('show ipv6 route')
				cli('show ipv6 ref route')
				cli('show ipv6 ref adjacency')
				cli('show ipv6 ref route statistic')
			end

			print "step 1111"
			res = cli('show vrf detail | in VRF')
			vrfArr = res.split(/\r?\n/ig)
			print vrfArr.length
			i = 1
			if 	is_in_cm == true :
				enabled_module = enabled_module + 'VRF: '
			end
			while i < (vrfArr.length - 1):
				print vrfArr[i]
				vrf_temp = vrfArr[i]
				vrf_tarr = vrf_temp.split(/\s+/g)
				vrfArr[i] = vrf_tarr[1]
				print vrfArr[i]
				clicmd = 'show ip route vrf ' + vrfArr[i]
				cli(clicmd)
				clicmd1 = 'show ip ref route vrf ' + vrfArr[i]
				cli(clicmd1)
				if 	is_in_cm == true :
					enabled_module = enabled_module + vrfArr[i] + ' '
				end
				i = i + 1
			end

			if 	is_in_cm == true :
				enabled_module = enabled_module + "\r\n"
				res = cli('show run | in router ospf')
				ospfArr = res.split(/\r?\n/ig)
				if ospfArr.length > 2 :
					enabled_module	= enabled_module + 'OSPF\r\n'
					cli('show ip ospf')
					cli('show ip ospf nei')
					cli('show ip ospf route')
					cli('show ip ospf database')
					cli('show ip ospf interface')
					cli('show ip protocol')
				end

				res = cli('show run | in router rip')
				ripArr = res.split(/\r?\n/ig)
				if ripArr.length > 2 :
					enabled_module	= enabled_module + 'RIP\r\n'
					cli('show ip rip')
					cli('show ip rip database')
					cli('show ip rip interface')
					cli('show ip rip peer')
					cli('show ip rip external')
				end

				res = cli('show run | in router bgp')
				bgpArr = res.split(/\r?\n/ig)
				if bgpArr.length > 2 :
					enabled_module	= enabled_module + 'BGP\r\n'
					cli('show ip bgp neighbor')
					cli('show ip bgp summary')
					cli('show bgp all summary')
				end
			end
			print "step 2222"

			res = cli('show run | in mpls ip')
			mplsArr = res.split(/\r?\n/ig)
			if mplsArr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'MPLS\r\n'
					cli('show mpls forwarding-table')
					cli('show mpls forwarding-table summary')
					cli('show mpls summary')
				end
				cli('show ip ref mpls summary detail')
				sleep(5000)
				if 	is_in_cm == true :
					cli('show mpls forwarding-table summary')
					cli('show mpls summary')
				end
				cli('show ip ref mpls summary detail')
				cli('show ip ref mpls forwarding-table')
				i = 1
				while i < (vrfArr.length - 1) :
					if 	is_in_cm == true :
						clicmd = 'show mpls forwarding-table vrf ' + vrfArr[i]
						cli(clicmd)
					end
					clicmd1 = 'show ip ref mpls forwarding-table vrf ' + vrfArr[i]
					cli(clicmd1)
					i = i + 1
				end
			end

			# start of : if 	is_in_cm == true : #
			if 	is_in_cm == true :
				res = cli('show run | in xconnect')
				mpls_l2_Arr = res.split(/\r?\n/ig)
				if mpls_l2_Arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'MPLS L2VPN\r\n' 
					end
					cli('show mpls l2transport vc')
					cli('show mpls l2transport switching vfi')
					cli('show mpls l2vc ftn-table')
				end

				res = cli('show run | in mpls router ldp')
				mpls_ldp_Arr = res.split(/\r?\n/ig)
				if mpls_ldp_Arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'MPLS LDP\r\n' 
					end
					cli('show mpls ldp neighbor')
					i = 1
					while i < (vrfArr.length - 1) :
						clicmd = 'show mpls ldp neighbor vrf ' + vrfArr[i]
						cli(clicmd)
						i = i + 1
					end
					cli('show mpls ldp graceful-restart')
					cli('show mpls ldp parameters')
					cli('show mpls ldp igp sync')
					cli('show mpls ldp discovery')
					cli('show mpls ldp vfi')
					cli('show mpls ldp vc all')
				end


				res = cli('show run | in service dhcp')
				dhcp_Arr = res.split(/\r?\n/ig)
				if dhcp_Arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'DHCP\r\n' 
					end
					cli('show ip dhcp pool')
					cli('show ip dhcp conflict')
					cli('sh ip dhcp binding')
				end

				res = cli('show run | in dot1x port-control auto')
				dot1x_Arr = res.split(/\r?\n/ig)
				if dot1x_Arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'DOT1X\r\n' 
					end
					cli('show dot1x')
					cli('show dot1x port-control')
					res = cli('show dot1x su')
					if res.indexof('Invalid input') == -1 :
						dot1x_Arr = res.split(/\r?\n/ig)
						i = 3
						while i < (dot1x_Arr.length - 1) :
							dotix_item_temp = dot1x_Arr[i]
							dot1xid_arr = dotix_item_temp.split(/\s+/g)
							clicmd = 'show dot1x user id ' + dot1xid_arr[0]
							cli(clicmd)
							i = i + 1
						end
					end
				end

				res = cli('show run | in aaa new-model')
				aaa_Arr = res.split(/\r?\n/ig)
				if aaa_Arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'AAA\r\n' 
					end
					res = cli('show aaa user all')
					if res.indexof('Invalid input') == -1 :
						aaa_user_Arr = res.split(/\r?\n/ig)
						i = 3
						while i < (dot1x_Arr.length - 2) :
							aaa_item_temp = aaa_user_Arr[i]
							aaaid_arr = aaa_item_temp.split(/\s+/g)
							clicmd = 'show aaa user ' + aaaid_arr[0]
							cli(clicmd)
							i = i + 1
						end
					end
					cli('show aaa user lockout ')
					cli('show aaa domain ')
					cli('show aaa group')
					cli('show aaa method-list ')
					cli('show aaa lockout ')
				end

				res = cli('show run | in radius-server host')
				aaa_radius_Arr = res.split(/\r?\n/ig)
				if aaa_radius_Arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'AAA radius-server\r\n' 
					end
					cli('show radius auth stat')
					cli('show radius acct stat')
					cli('show radius server')
					cli('show radius group')
					cli('show radius parameter ')
					cli('show radius dynamic-authorization-extension statistics')
				end

				res = cli('show run | in dynamic-authorization-extension')
				aaa_auth_Arr = res.split(/\r?\n/ig)
				if aaa_auth_Arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'AAA dynamic-authorization\r\n' 
					end
					cli('show radius dynamic-authorization-extension statistics')
				end
				
				res = cli('show run | in snmp')
				snmp_arr = res.split(/\r?\n/ig)
				if  snmp_arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'SNMP\r\n'
					end
					cli('show snmp udp-port')
					cli('show snmp')
					cli('show snmp host')
					cli('show snmp lock')
					cli('show snmp mib')
					cli('show snmp process-mib-time')
					cli('show snmp user')
					cli('show snmp group')
					cli('show snmp view')
				end

				res = cli('show run | in dldp')
				dldp_arr = res.split(/\r?\n/ig)
				if  dldp_arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'DLDP\r\n' 
					end
					cli('sh dldp interface')
			#		cli('log on')
			#		cli('no log console')
			#		cli('no log moni')
			#		cli('clear logging')
			#		cli('enable')
			#		cli('debug dldp event')
			#		cli('debug dldp error')
			#		sleep(20000)
			#		cli('undebug all')
			#		cli('show logging')
				end
				
				res = cli('show run | in vrrp')
				vrrp_arr = res.split(/\r?\n/ig)
				if vrrp_arr.length > 2 :
					if 	is_in_cm == true :
						enabled_module	= enabled_module + 'VRRP\r\n' 
					end
					cli('show vrrp')
					cli('show vrrp brief')
					cli('show ipv6 vrrp')
					cli('show ipv6 vrrp brief')
					cli('show vrrp balance')
					cli('show vrrp balance brief')
				end
			end
			# end of : if is_in_cm == true : #

			res = cli('show run | in ip nat inside')
			res1 = cli('show run | in ip nat outside')
			natin_Arr = res.split(/\r?\n/ig)
			natout_Arr = res1.split(/\r?\n/ig)
			if natin_Arr.length > 2 || natout_Arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'NAT\r\n' 
					high_risk_module = high_risk_module + 'NAT\r\n'
				end
				cli('show ip fpm statistics')
				cli('show ip fpm flow')
				cli('show ip nat translations')
				cli('show ip nat statistics rule ')
				cli('show ip nat translations verbose')
				cli('sh ip nat translations ex')
				sleep(2000)
				cli('sh ip nat translations ex')
				sleep(2000)
				cli('sh ip nat translations ex')
				i = 1
				while i < (vrfArr.length - 1) :
					clicmd = 'show ip nat translations vrf ' + vrfArr[i]
					cli(clicmd)
					clicmd1 = 'show ip nat translations vrf ' + vrfArr[i] + ' ex' 
					cli(clicmd1)
					sleep(2000)
					cli(clicmd1)
					sleep(2000)
					cli(clicmd1)
					i = i + 1
				end
			end

			res = cli('show run | in crypto map')
			crypto_Arr = res.split(/\r?\n/ig)
			if crypto_Arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'IPSEC\r\n'
					high_risk_module = high_risk_module + 'IPSEC\r\n'
				end
				cli('show crypto pki certificates')
				cli('show crypto pki trustpoints')
				cli('show crypto isakmp policy')
				cli('show crypto ipsec sa')
				cli('show crypto ipsec transform-set')
				cli('show crypto map')
				cli('show crypto acl')
				cli('show crypto detail')
				cli('show crypto state')
				cli('show crypto data')
			#	cli('configure')
			#	cli('log on')
			#	cli('no log console')
			#	cli('no log moni')
			#	cli('clear logging')
			#	cli('enable')
			#	cli('debug crypto isak')
			#	cli('debug crypto pki event')
			#	cli('debug crypto pki error')
			#	sleep(30000)
			#	cli('undebug all')
			#	cli('show logging')
			end

			res = cli('show run | in vpdn enable')
			vpdn_Arr = res.split(/\r?\n/ig)
			if vpdn_Arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'VPDN\r\n' 
					high_risk_module = high_risk_module + 'VPDN\r\n'
				end
				cli('show vpdn')
				cli('show ip ref vpdn pptp-ef-count')
				cli('show ip ref vpdn l2tp-da')
				cli('show ip ref vpdn l2tp-info')
				cli('show ip ref vpdn pptp-ef-error')
			#	cli('configure')
			#	cli('log on')
			#	cli('no log console')
			#	cli('no log moni')
			#	cli('clear logging')
			#	cli('enable')
			#	cli('debug vpdn l2x-event')
			#	cli('debug vpdn l2x-error')
			#	cli('debug vpdn l2x-packet')
			#	sleep(30000)
			#	cli('undebug all')
			#	cli('show logging')
			#	cli('debug vpdn event')
			#	cli('debug vpdn error')
			#	cli('debug vpdn packet')
			#	sleep(30000)
			#	cli('undebug all')
			#	cli('show logging')
			end

			res = cli('show run | in flow ingress')
			res1 = cli('show run | in flow egress')
			res2 = cli('show run | in flow flow-sample')
			ipfix_inarr = res.split(/\r?\n/ig)
			ipfix_earr = res1.split(/\r?\n/ig)
			ipfix_sarr = res2.split(/\r?\n/ig)
			if ipfix_inarr.length > 2 || ipfix_earr.length > 2 || ipfix_sarr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'IPFIX\r\n' 
				end
				cli('show ip flow export')
				cli('show ip flow cache')
				cli('show ip flow interface')
				cli('show ip flow stats')
				cli('show ipv6 flow export')
				cli('show ipv6 flow cache')
				cli('show ipv6 flow interface')
				cli('show ipv6 flow stat')
			end

			res = cli('show run | in bfd')
			bfd_arr = res.split(/\r?\n/ig)
			if  bfd_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'BFD\r\n'
				end
				cli('show bfd nei pend')
				cli('show bfd nei rdnd')
				cli('show bfd neighbors')
				i = 1
				while i < (vrfArr.length - 1) :
					clicmd = 'show bfd neighbors vrf ' + vrfArr[i]
					cli(clicmd)
					clicmd1 = 'show bfd neighbors vrf ' + vrfArr[i] + 'detail'
					cli(clicmd1)
					i = i + 1
				end
			end

			res = cli('show run | in fair-queue')
			qos_wfq_arr = res.split(/\r?\n/ig)
			if qos_wfq_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'QOS WFQ\r\n' 
				end
				res = cli('show queue wfq')
				qos_wfq_arr = res.split(/\r?\n/ig)
				i = 2
				while i < (qos_wfq_arr.length - 1) :
					temp_qos = qos_wfq_arr[i]
					temp_qos = temp_qos.split(/\s+/g)
					clicmd = 'show queue interface ' + temp_qos[0] + ' ' + temp_qos[1]
					cli(clicmd)
					i = i + 1
				end
			end

			res = cli('show run | in service-policy')
			qos_policy_arr = res.split(/\r?\n/ig)
			if qos_policy_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'QOS CBWFQ/LLQ\r\n' 
				end
				cli('show class-map')
				cli('show policy-map')
				cli('show policy-map interface')
				cli('show queue interface')
			end

			res = cli('show run | in ip rtp priority')
			qos_rtpq_arr = res.split(/\r?\n/ig)
			if qos_rtpq_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'QOS RTPQ\r\n' 
				end
				cli('show queue rtpq')
			end

			res = cli('show run | in custom-queue-list')
			qos_cq_arr = res.split(/\r?\n/ig)
			if qos_cq_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'QOS CQ\r\n'
				end
				res = cli('show queue cq')
				qos_cq_arr = res.split(/\r?\n/ig)
				i = 2
				while i < (qos_cq_arr.length - 1) :
					temp_qos = qos_cq_arr[i]
					temp_qos = temp_qos.split(/\s+/g)
					clicmd = 'show queue interface ' + temp_qos[0] + ' ' + temp_qos[1]
					cli(clicmd)
					i = i + 1
				end
			end

			res = cli('show run | in priority-group')
			qos_pq_arr = res.split(/\r?\n/ig)
			if qos_pq_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'QOS PQ\r\n' 
				end
				res = cli('show queue pq')
				qos_pq_arr = res.split(/\r?\n/ig)
				i = 2
				while i < (qos_pq_arr.length - 1) :
					temp_qos = qos_pq_arr[i]
					temp_qos = temp_qos.split(/\s+/g)
					clicmd = 'show queue interface ' + temp_qos[0] + ' ' + temp_qos[1]
					cli(clicmd)
					i = i + 1
				end
			end

			res = cli('show run | in rate-limit')
			res1 = cli('show run | in  police cir')
			qos_car_arr = res.split(/\r?\n/ig)
			qos_car1_arr = res1.split(/\r?\n/ig)
			if qos_car_arr.length > 2 || qos_car1_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'QOS CAR\r\n' 
				end
				cli('show rate-limit')
			end

			res = cli('show run | in traffic-shape')
			qos_gts_arr = res.split(/\r?\n/ig)
			if qos_gts_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'QOS GTS\r\n'
				end
				cli('show traffic-shape')
				cli('show traffic-shape queue')
				cli('show traffic-shape statistics')
			end

			res = cli('show run | in trust upstream')
			hqos_stc_arr = res.split(/\r?\n/ig)
			if hqos_stc_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'HQOS STC(简单流分类)\r\n'
				end
				i = 1
				while i < (hqos_stc_arr.length - 1) :
					temp_qos = hqos_stc_arr[i]
					temp_qos = temp_qos.split(/\s+/g)
					clicmd = 'show diffserv domain ' + temp_qos[2]
					cli(clicmd)
					i = i + 1
				end
			end

			res = cli('show run | in traffic policy')
			hqos_tp_arr = res.split(/\r?\n/ig)
			if hqos_tp_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'HQOS CTC(复杂流分类)\r\n' 
				end
				cli('show traffic classifier ')
				cli('show traffic behavior')
				cli('show traffic policy')
			end

			res = cli('show user-queue | in user-queue')
			hqos_uq_arr = res.split(/\r?\n/ig)
			if hqos_uq_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'HQOS User-Q\r\n' 
				end
				i = 1
				while i < (hqos_uq_arr.length - 1) :
					temp_qos = hqos_uq_arr[i]
					temp_qos = temp_qos.split(/\s+/g)
					clicmd = 'show user-queue statistics ' + temp_qos[1] + ' ' + temp_qos[2]
					cli(clicmd)
					i = i + 1
				end
			end

			res = cli('show port-queue | in port queue')
			hqos_pq_arr = res.split(/\r?\n/ig)
			if hqos_pq_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'HQOS Port-Q\r\n' 
				end
			end

			res = cli('show run | in ip access-group')
			acl_arr = res.split(/\r?\n/ig)
			if acl_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'ACL\r\n'
				end
				cli('show access-lists')
				cli('show efacl')
				sleep(3000)
				cli('show efacl')
			end

			res = cli('show run | in ip policy route-map')
			res1 = cli('show run | in ip local policy')
			pbr_arr = res.split(/\r?\n/ig)
			pbr1_arr = res1.split(/\r?\n/ig)
			if pbr_arr.length > 2 ||  pbr1_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'PBR\r\n' 
				end
				cli('show pbr rm')
				cli('show pbr fw')
				cli('show efpbr tran 1')
			end

			if 	is_in_cm == true :
				res = cli('show run | in acpp bw-rate')
				rnfp_arr = res.split(/\r?\n/ig)
				if rnfp_arr.length > 2 :
					enabled_module	= enabled_module + 'RNFP\r\n'
					cli('show ef-rnfp all')
					sleep(2000)
					cli('show ef-rnfp all')
				end
			end

			res = cli('show run | in unicast source')
			urpf_arr = res.split(/\r?\n/ig)
			if urpf_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'URPF\r\n'
				end
				cli('show ip urpf')
			end

			res = cli('show run | in reverse-path')
			rpl_arr = res.split(/\r?\n/ig)
			if rpl_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'RPL\r\n' 
				end
			end

			res = cli('show run | in rate-control')
			rate_c_arr = res.split(/\r?\n/ig)
			if rate_c_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'Rate-control\r\n' 
				end
				cli('show ip rate-control')
			end

			res = cli('show run | in sparse-mode')
			res1 = cli('show run | in dense-mode')
			ps_arr = res.split(/\r?\n/ig)
			pd_arr = res1.split(/\r?\n/ig)
			if ps_arr.length > 2 || pd_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'MVPN\r\n' 
					cli('show ip pim mdt')
					if pd_arr.length > 2 :
						cli('show ip pim dense-mode mroute')
						cli('show ip pim dense-mode neighbor')
						cli('show ip pim dense-mode nexthop')
						cli('show ip pim dense-mode track')
						cli('show ip pim dense-mode interface')
					end
					if ps_arr.length > 2 :
						cli('show ip pim sparse-mode mroute')
						cli('show ip pim sparse-mode neighbor')
						cli('show ip pim sparse-mode nexthop')
						cli('show ip pim sparse-mode track')
						cli('show ip pim sparse-mode interface')
					end
				end
				i = 1
				while i < (vrfArr.length - 1) :
					clicmd = 'show ip pim vrf ' + vrfArr[i] + ' mdt receive'
					cli(clicmd)
					clicmd1 = 'show ip pim vrf ' + vrfArr[i] + ' mdt send'
					cli(clicmd1)
					i = i + 1
				end
				cli('show ip ref mcast info')
				cli('show ip ref mcast route')
				cli('sh ip ref mcast statistics mfc')
			end

			#interface based command
			if 	is_in_cm == true :
				enabled_module	= enabled_module + 'enabled interface :\r\n'
			end
			cli('show interface')

			print "step 3333"
			#所有需要收集接口命令的模块，都在此处添加
			res = cli('show ip interface brief')
			if_arr = res.split(/\r?\n/ig)
			if if_arr.length > 3 :
				i = 2
				while i < (if_arr.length - 1) :
					temp_if = if_arr[i];
					temp_if = temp_if.split(/\s+/g)
					clicmd = 'show run interface ' + temp_if[0] + ' ' + temp_if[1] 
					res = cli(clicmd)
					if res.indexOf('port-queue') != -1 :
						clicmd1 = 'show port-queue statistics interface ' + temp_if[0] + ' ' + temp_if[1] 
						cli(clicmd1)
					end
					
					if res.indexOf('pim') != -1 :
						clicmd1 = 'show ip ref mcast statistics interface ' + temp_if[0] + ' ' + temp_if[1] 
						cli(clicmd1)
					end
					i = i + 1
				end
			end
			 
			res  = cli('show run | in Controller e1')
			e1_arr = res.split(/\r?\n/ig)
			if e1_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'E1\r\n' 
				end
				cli('show controller e1')
			end

			res  = cli('show run | in Controller ATM')
			atm_arr = res.split(/\r?\n/ig)
			if atm_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'ATM\r\n' 
				end
				cli('show atm map')
				cli('show atm vc-statistics')
				cli('show atm vc')
			end
			 
			res  = cli('show run | in Pos')
			res1  = cli('show run | in Cpos')
			pos_arr = res.split(/\r?\n/ig)
			cpos_arr = res1.split(/\r?\n/ig)
			if pos_arr.length > 2 || cpos_arr.length > 2:
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'POS/CPOS\r\n'
				end
				cli('show pos interface pos')
			end
			 
			res  = cli('show run | in encapsulation ppp')
			ppp_arr = res.split(/\r?\n/ig)
			if ppp_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'PPP\r\n'
				end
			end

			res = cli('show run | in ppp multilink')
			ppp_mp_arr = res.split(/\r?\n/ig)
			if ppp_mp_arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'PPP multilink\r\n'
				end
				cli('show ppp multilink')
				cli('show ref ppp multilink')
			end

			res = cli('show run | in interface Tunnel')
			tunnel_Arr = res.split(/\r?\n/ig)
			if tunnel_Arr.length > 2 :
				if 	is_in_cm == true :
					enabled_module	= enabled_module + 'Tunnel maybe GRE/IPIP/IPV6/IPV6IP\r\n' 
				end
				i = 1
				while i < (tunnel_Arr.length - 1) :
					tunnel_name = tunnel_Arr[i]
					tunnel_id_arr =  tunnel_name.split(/\s+/g)
					clicmd = 'show run interface tunnel ' + tunnel_id_arr[2]
					res = cli(clicmd)
					tunnelcfg_arr = res.split(/\r?\n/ig)
					tunnel_source = false
					j = 1
					while j < (tunnelcfg_arr.length - 1) :
						tunnelcfg = tunnelcfg_arr[i]
						tunnelcfg = tunnelcfg.split(/\s+/g)
						if tunnelcfg[1] == 'source' :
							tunnel_sip = tunnelcfg[2]
							tunnel_source = true
						end
						
						if tunnelcfg[1] == 'destination' :
							tunnel_dip = tunnelcfg[2]
							if tunnel_source == true :
								clicmd1 = 'ping ' + tunnel_dip + ' sou ' + tunnel_sip
								cli(clicmd1)
							end
						end
						
						if tunnelcfg[1] == 'address' :
							tunnel_ip = tunnelcfg[2]
							clicmd2 = 'ping ' + tunnel_ip
							cli(clicmd2)
						end
						j = j + 1 
					end
					clicmd1 = 'show interface tunnel ' + tunnel_id_arr[2]
					cli(clicmd1)
					i = i + 1
				end
			end
			if (slots_arr[slot_num] != 'M1' && slots_arr[slot_num] != 'M2') :
				cli('@ctrl + x')
			end
		end
		slot_num = slot_num + 1
	end
else :

	enabled_module = '\r\n'
	high_risk_module = '\r\n'

	cli('enable')
	cli('show run')
	cli('show start')
	cli('show clock')
	cli('show version')
	cli('show version slot')
	cli('show users')
	cli('show log')
	cli('show environment')
	cli('show temperature')
	cli('dir')
	cli('show cpu')
	cli('show memory')
	cli('show debugging')
	cli('debug sup')
	cli('show pool')
	cli('show task')
	cli('show hisr')
	cli('show irq')
	cli('show timer')
	cli('show semaphore')
	cli('show eventgroup')
	cli('show skbuff')
	cli('show dconf')
	cli('show exception')
	cli('enable')
	cli('show ip fpm statistics')
	cli('show ip fpm counters')
	cli('show interfaces ')
	cli('show ntp status')
	cli('show sntp')
	cli('show arp')
	cli('show ip route')
	cli('show ip ref route')
	cli('show ip ref adjacency')
	cli('show ip ref route statistic')
	cli('show ip ref adjacency statistic')
	cli('show ip ref pkt-statistic')

	res = cli('show run | in ipv6 address')
	ipv6Arr = res.split(/\r?\n/ig)
	if ipv6Arr.length > 2 :
		cli('show ipv6 route')
		cli('show ipv6 ref route')
		cli('show ipv6 ref adjacency')
		cli('show ipv6 ref route statistic')
	end

	print "step 1111"
	res = cli('show vrf detail | in VRF')
	vrfArr = res.split(/\r?\n/ig)
	print vrfArr.length
	i = 1
	enabled_module = enabled_module + 'VRF: '
	while i < (vrfArr.length - 1):
		print vrfArr[i]
		vrf_temp = vrfArr[i]
		vrf_tarr = vrf_temp.split(/\s+/g)
		vrfArr[i] = vrf_tarr[1]
		print vrfArr[i]
		clicmd = 'show ip route vrf ' + vrfArr[i]
		cli(clicmd)
		clicmd1 = 'show ip ref route vrf ' + vrfArr[i]
		cli(clicmd1)
		enabled_module = enabled_module + vrfArr[i] + ' '
		i = i + 1
	end

	enabled_module = enabled_module + "\r\n"

	res = cli('show run | in router ospf')
	ospfArr = res.split(/\r?\n/ig)
	if ospfArr.length > 2 :
		enabled_module	= enabled_module + 'OSPF\r\n'
		cli('show ip ospf')
		cli('show ip ospf nei')
		cli('show ip ospf route')
		cli('show ip ospf database')
		cli('show ip ospf interface')
		cli('show ip protocol')
	end

	res = cli('show run | in router rip')
	ripArr = res.split(/\r?\n/ig)
	if ripArr.length > 2 :
		enabled_module	= enabled_module + 'RIP\r\n'
		cli('show ip rip')
		cli('show ip rip database')
		cli('show ip rip interface')
		cli('show ip rip peer')
		cli('show ip rip external')
	end

	res = cli('show run | in router bgp')
	bgpArr = res.split(/\r?\n/ig)
	if bgpArr.length > 2 :
		enabled_module	= enabled_module + 'BGP\r\n'
		cli('show ip bgp neighbor')
		cli('show ip bgp summary')
		cli('show bgp all summary')
	end

	print "step 2222"

	res = cli('show run | in mpls ip')
	mplsArr = res.split(/\r?\n/ig)
	if mplsArr.length > 2 :
		enabled_module	= enabled_module + 'MPLS\r\n'
		cli('show mpls forwarding-table')
		cli('show mpls forwarding-table summary')
		cli('show mpls summary')
		cli('show ip ref mpls summary detail')
		sleep(5000)
		cli('show mpls forwarding-table summary')
		cli('show mpls summary')
		cli('show ip ref mpls summary detail')
		cli('show ip ref mpls forwarding-table')
		i = 1
		while i < (vrfArr.length - 1) :
			clicmd = 'show mpls forwarding-table vrf ' + vrfArr[i]
			cli(clicmd)
			clicmd1 = 'show ip ref mpls forwarding-table vrf ' + vrfArr[i]
			cli(clicmd1)
			i = i + 1
		end
	end

	res = cli('show run | in xconnect')
	mpls_l2_Arr = res.split(/\r?\n/ig)
	if mpls_l2_Arr.length > 2 :
		enabled_module	= enabled_module + 'MPLS L2VPN\r\n' 
		cli('show mpls l2transport vc')
		cli('show mpls l2transport switching vfi')
		cli('show mpls l2vc ftn-table')
	end

	res = cli('show run | in mpls router ldp')
	mpls_ldp_Arr = res.split(/\r?\n/ig)
	if mpls_ldp_Arr.length > 2 :
		enabled_module	= enabled_module + 'MPLS LDP\r\n' 
		cli('show mpls ldp neighbor')
		i = 1
		while i < (vrfArr.length - 1) :
			clicmd = 'show mpls ldp neighbor vrf ' + vrfArr[i]
			cli(clicmd)
			i = i + 1
		end
		cli('show mpls ldp graceful-restart')
		cli('show mpls ldp parameters')
		cli('show mpls ldp igp sync')
		cli('show mpls ldp discovery')
		cli('show mpls ldp vfi')
		cli('show mpls ldp vc all')
	end


	res = cli('show run | in service dhcp')
	dhcp_Arr = res.split(/\r?\n/ig)
	if dhcp_Arr.length > 2 :
		enabled_module	= enabled_module + 'DHCP\r\n' 
		cli('show ip dhcp pool')
		cli('show ip dhcp conflict')
		cli('sh ip dhcp binding')
	end

	res = cli('show run | in dot1x port-control auto')
	dot1x_Arr = res.split(/\r?\n/ig)
	if dot1x_Arr.length > 2 :
		enabled_module	= enabled_module + 'DOT1X\r\n' 
		cli('show dot1x')
		cli('show dot1x port-control')
		res = cli('show dot1x su')
		if res.indexof('Invalid input') == -1 :
			dot1x_Arr = res.split(/\r?\n/ig)
			i = 3
			while i < (dot1x_Arr.length - 1) :
				dotix_item_temp = dot1x_Arr[i]
				dot1xid_arr = dotix_item_temp.split(/\s+/g)
				clicmd = 'show dot1x user id ' + dot1xid_arr[0]
				cli(clicmd)
				i = i + 1
			end
		end
	end

	res = cli('show run | in aaa new-model')
	aaa_Arr = res.split(/\r?\n/ig)
	if aaa_Arr.length > 2 :
		enabled_module	= enabled_module + 'AAA\r\n' 
		res = cli('show aaa user all')
		if res.indexof('Invalid input') == -1 :
			aaa_user_Arr = res.split(/\r?\n/ig)
			i = 3
			while i < (dot1x_Arr.length - 2) :
				aaa_item_temp = aaa_user_Arr[i]
				aaaid_arr = aaa_item_temp.split(/\s+/g)
				clicmd = 'show aaa user ' + aaaid_arr[0]
				cli(clicmd)
				i = i + 1
			end
		end
		cli('show aaa user lockout ')
		cli('show aaa domain ')
		cli('show aaa group')
		cli('show aaa method-list ')
		cli('show aaa lockout ')
	end

	res = cli('show run | in radius-server host')
	aaa_radius_Arr = res.split(/\r?\n/ig)
	if aaa_radius_Arr.length > 2 :
		enabled_module	= enabled_module + 'AAA radius-server\r\n' 
		cli('show radius auth stat')
		cli('show radius acct stat')
		cli('show radius server')
		cli('show radius group')
		cli('show radius parameter ')
		cli('show radius dynamic-authorization-extension statistics')
	end

	res = cli('show run | in dynamic-authorization-extension')
	aaa_auth_Arr = res.split(/\r?\n/ig)
	if aaa_auth_Arr.length > 2 :
		enabled_module	= enabled_module + 'AAA dynamic-authorization\r\n' 
		cli('show radius dynamic-authorization-extension statistics')
	end

	res = cli('show run | in snmp')
	snmp_arr = res.split(/\r?\n/ig)
	if  snmp_arr.length > 2 :
		enabled_module	= enabled_module + 'SNMP\r\n'
		cli('show snmp udp-port')
		cli('show snmp')
		cli('show snmp host')
		cli('show snmp lock')
		cli('show snmp mib')
		cli('show snmp process-mib-time')
		cli('show snmp user')
		cli('show snmp group')
		cli('show snmp view')
	end

	res = cli('show run | in dldp')
	dldp_arr = res.split(/\r?\n/ig)
	if  dldp_arr.length > 2 :
		enabled_module	= enabled_module + 'DLDP\r\n' 
		cli('sh dldp interface')
	#		cli('log on')
	#		cli('no log console')
	#		cli('no log moni')
	#		cli('clear logging')
	#		cli('enable')
	#		cli('debug dldp event')
	#		cli('debug dldp error')
	#		sleep(20000)
	#		cli('undebug all')
	#		cli('show logging')
	end

	res = cli('show run | in vrrp')
	vrrp_arr = res.split(/\r?\n/ig)
	if vrrp_arr.length > 2 :
		enabled_module	= enabled_module + 'VRRP\r\n' 
		cli('show vrrp')
		cli('show vrrp brief')
		cli('show ipv6 vrrp')
		cli('show ipv6 vrrp brief')
		cli('show vrrp balance')
		cli('show vrrp balance brief')
	end

	res = cli('show run | in ip nat inside')
	res1 = cli('show run | in ip nat outside')
	natin_Arr = res.split(/\r?\n/ig)
	natout_Arr = res1.split(/\r?\n/ig)
	if natin_Arr.length > 2 || natout_Arr.length > 2 :
		enabled_module	= enabled_module + 'NAT\r\n' 
		high_risk_module = high_risk_module + 'NAT\r\n'
		cli('show ip fpm statistics')
		cli('show ip fpm flow')
		cli('show ip nat translations')
		cli('show ip nat statistics rule ')
		cli('show ip nat translations verbose')
		cli('sh ip nat translations ex')
		sleep(2000)
		cli('sh ip nat translations ex')
		sleep(2000)
		cli('sh ip nat translations ex')
		i = 1
		while i < (vrfArr.length - 1) :
			clicmd = 'show ip nat translations vrf ' + vrfArr[i]
			cli(clicmd)
			clicmd1 = 'show ip nat translations vrf ' + vrfArr[i] + ' ex' 
			cli(clicmd1)
			sleep(2000)
			cli(clicmd1)
			sleep(2000)
			cli(clicmd1)
			i = i + 1
		end
	end

	res = cli('show run | in crypto map')
	crypto_Arr = res.split(/\r?\n/ig)
	if crypto_Arr.length > 2 :
		enabled_module	= enabled_module + 'IPSEC\r\n'
		high_risk_module = high_risk_module + 'IPSEC\r\n'
		cli('show crypto pki certificates')
		cli('show crypto pki trustpoints')
		cli('show crypto isakmp policy')
		cli('show crypto ipsec sa')
		cli('show crypto ipsec transform-set')
		cli('show crypto map')
		cli('show crypto acl')
		cli('show crypto detail')
		cli('show crypto state')
		cli('show crypto data')
	#	cli('configure')
	#	cli('log on')
	#	cli('no log console')
	#	cli('no log moni')
	#	cli('clear logging')
	#	cli('enable')
	#	cli('debug crypto isak')
	#	cli('debug crypto pki event')
	#	cli('debug crypto pki error')
	#	sleep(30000)
	#	cli('undebug all')
	#	cli('show logging')
	end

	res = cli('show run | in vpdn enable')
	vpdn_Arr = res.split(/\r?\n/ig)
	if vpdn_Arr.length > 2 :
		enabled_module	= enabled_module + 'VPDN\r\n' 
		high_risk_module = high_risk_module + 'VPDN\r\n'
		cli('show vpdn')
		cli('show ip ref vpdn pptp-ef-count')
		cli('show ip ref vpdn l2tp-da')
		cli('show ip ref vpdn l2tp-info')
		cli('show ip ref vpdn pptp-ef-error')
	#	cli('configure')
	#	cli('log on')
	#	cli('no log console')
	#	cli('no log moni')
	#	cli('clear logging')
	#	cli('enable')
	#	cli('debug vpdn l2x-event')
	#	cli('debug vpdn l2x-error')
	#	cli('debug vpdn l2x-packet')
	#	sleep(30000)
	#	cli('undebug all')
	#	cli('show logging')
	#	cli('debug vpdn event')
	#	cli('debug vpdn error')
	#	cli('debug vpdn packet')
	#	sleep(30000)
	#	cli('undebug all')
	#	cli('show logging')
	end

	res = cli('show run | in flow ingress')
	res1 = cli('show run | in flow egress')
	res2 = cli('show run | in flow flow-sample')
	ipfix_inarr = res.split(/\r?\n/ig)
	ipfix_earr = res1.split(/\r?\n/ig)
	ipfix_sarr = res2.split(/\r?\n/ig)
	if ipfix_inarr.length > 2 || ipfix_earr.length > 2 || ipfix_sarr.length > 2 :
		enabled_module	= enabled_module + 'IPFIX\r\n' 
		cli('show ip flow export')
		cli('show ip flow cache')
		cli('show ip flow interface')
		cli('show ip flow stats')
		cli('show ipv6 flow export')
		cli('show ipv6 flow cache')
		cli('show ipv6 flow interface')
		cli('show ipv6 flow stat')
	end

	res = cli('show run | in bfd')
	bfd_arr = res.split(/\r?\n/ig)
	if  bfd_arr.length > 2 :
		enabled_module	= enabled_module + 'BFD\r\n'
		cli('show bfd nei pend')
		cli('show bfd nei rdnd')
		cli('show bfd neighbors')
		i = 1
		while i < (vrfArr.length - 1) :
			clicmd = 'show bfd neighbors vrf ' + vrfArr[i]
			cli(clicmd)
			clicmd1 = 'show bfd neighbors vrf ' + vrfArr[i] + 'detail'
			cli(clicmd1)
			i = i + 1
		end
	end

	res = cli('show run | in fair-queue')
	qos_wfq_arr = res.split(/\r?\n/ig)
	if qos_wfq_arr.length > 2 :
		enabled_module	= enabled_module + 'QOS WFQ\r\n' 
		res = cli('show queue wfq')
		qos_wfq_arr = res.split(/\r?\n/ig)
		i = 2
		while i < (qos_wfq_arr.length - 1) :
			temp_qos = qos_wfq_arr[i]
			temp_qos = temp_qos.split(/\s+/g)
			clicmd = 'show queue interface ' + temp_qos[0] + ' ' + temp_qos[1]
			cli(clicmd)
			i = i + 1
		end
	end

	res = cli('show run | in service-policy')
	qos_policy_arr = res.split(/\r?\n/ig)
	if qos_policy_arr.length > 2 :
		enabled_module	= enabled_module + 'QOS CBWFQ/LLQ\r\n' 
		cli('show class-map')
		cli('show policy-map')
		cli('show policy-map interface')
		cli('show queue interface')
	end

	res = cli('show run | in ip rtp priority')
	qos_rtpq_arr = res.split(/\r?\n/ig)
	if qos_rtpq_arr.length > 2 :
		enabled_module	= enabled_module + 'QOS RTPQ\r\n' 
		cli('show queue rtpq')
	end

	res = cli('show run | in custom-queue-list')
	qos_cq_arr = res.split(/\r?\n/ig)
	if qos_cq_arr.length > 2 :
		enabled_module	= enabled_module + 'QOS CQ\r\n'
		res = cli('show queue cq')
		qos_cq_arr = res.split(/\r?\n/ig)
		i = 2
		while i < (qos_cq_arr.length - 1) :
			temp_qos = qos_cq_arr[i]
			temp_qos = temp_qos.split(/\s+/g)
			clicmd = 'show queue interface ' + temp_qos[0] + ' ' + temp_qos[1]
			cli(clicmd)
			i = i + 1
		end
	end

	res = cli('show run | in priority-group')
	qos_pq_arr = res.split(/\r?\n/ig)
	if qos_pq_arr.length > 2 :
		enabled_module	= enabled_module + 'QOS PQ\r\n' 
		res = cli('show queue pq')
		qos_pq_arr = res.split(/\r?\n/ig)
		i = 2
		while i < (qos_pq_arr.length - 1) :
			temp_qos = qos_pq_arr[i]
			temp_qos = temp_qos.split(/\s+/g)
			clicmd = 'show queue interface ' + temp_qos[0] + ' ' + temp_qos[1]
			cli(clicmd)
			i = i + 1
		end
	end

	res = cli('show run | in rate-limit')
	res1 = cli('show run | in  police cir')
	qos_car_arr = res.split(/\r?\n/ig)
	qos_car1_arr = res1.split(/\r?\n/ig)
	if qos_car_arr.length > 2 || qos_car1_arr.length > 2 :
		enabled_module	= enabled_module + 'QOS CAR\r\n' 
		cli('show rate-limit')
	end

	res = cli('show run | in traffic-shape')
	qos_gts_arr = res.split(/\r?\n/ig)
	if qos_gts_arr.length > 2 :
		enabled_module	= enabled_module + 'QOS GTS\r\n'
		cli('show traffic-shape')
		cli('show traffic-shape queue')
		cli('show traffic-shape statistics')
	end

	res = cli('show run | in trust upstream')
	hqos_stc_arr = res.split(/\r?\n/ig)
	if hqos_stc_arr.length > 2 :
		enabled_module	= enabled_module + 'HQOS STC(简单流分类)\r\n'
		i = 1
		while i < (hqos_stc_arr.length - 1) :
			temp_qos = hqos_stc_arr[i]
			temp_qos = temp_qos.split(/\s+/g)
			clicmd = 'show diffserv domain ' + temp_qos[2]
			cli(clicmd)
			i = i + 1
		end
	end

	res = cli('show run | in traffic policy')
	hqos_tp_arr = res.split(/\r?\n/ig)
	if hqos_tp_arr.length > 2 :
		enabled_module	= enabled_module + 'HQOS CTC(复杂流分类)\r\n' 
		cli('show traffic classifier ')
		cli('show traffic behavior')
		cli('show traffic policy')
	end

	res = cli('show user-queue | in user-queue')
	hqos_uq_arr = res.split(/\r?\n/ig)
	if hqos_uq_arr.length > 2 :
		enabled_module	= enabled_module + 'HQOS User-Q\r\n' 
		i = 1
		while i < (hqos_uq_arr.length - 1) :
			temp_qos = hqos_uq_arr[i]
			temp_qos = temp_qos.split(/\s+/g)
			clicmd = 'show user-queue statistics ' + temp_qos[1] + ' ' + temp_qos[2]
			cli(clicmd)
			i = i + 1
		end
	end

	res = cli('show port-queue | in port queue')
	hqos_pq_arr = res.split(/\r?\n/ig)
	if hqos_pq_arr.length > 2 :
		enabled_module	= enabled_module + 'HQOS Port-Q\r\n' 
	end

	res = cli('show run | in ip access-group')
	acl_arr = res.split(/\r?\n/ig)
	if acl_arr.length > 2 :
		enabled_module	= enabled_module + 'ACL\r\n'
		cli('show access-lists')
		cli('show efacl')
		sleep(3000)
		cli('show efacl')
	end

	res = cli('show run | in ip policy route-map')
	res1 = cli('show run | in ip local policy')
	pbr_arr = res.split(/\r?\n/ig)
	pbr1_arr = res1.split(/\r?\n/ig)
	if pbr_arr.length > 2 ||  pbr1_arr.length > 2 :
		enabled_module	= enabled_module + 'PBR\r\n' 
		cli('show pbr rm')
		cli('show pbr fw')
		cli('show efpbr tran 1')
	end

	res = cli('show run | in acpp bw-rate')
	rnfp_arr = res.split(/\r?\n/ig)
	if rnfp_arr.length > 2 :
		enabled_module	= enabled_module + 'RNFP\r\n'
		cli('show ef-rnfp all')
		sleep(2000)
		cli('show ef-rnfp all')
	end

	res = cli('show run | in unicast source')
	urpf_arr = res.split(/\r?\n/ig)
	if urpf_arr.length > 2 :
		enabled_module	= enabled_module + 'URPF\r\n'
		cli('show ip urpf')
	end

	res = cli('show run | in reverse-path')
	rpl_arr = res.split(/\r?\n/ig)
	if rpl_arr.length > 2 :
		enabled_module	= enabled_module + 'RPL\r\n' 
	end

	res = cli('show run | in rate-control')
	rate_c_arr = res.split(/\r?\n/ig)
	if rate_c_arr.length > 2 :
		enabled_module	= enabled_module + 'Rate-control\r\n' 
		cli('show ip rate-control')
	end

	res = cli('show run | in sparse-mode')
	res1 = cli('show run | in dense-mode')
	ps_arr = res.split(/\r?\n/ig)
	pd_arr = res1.split(/\r?\n/ig)
	if ps_arr.length > 2 || pd_arr.length > 2 :
		enabled_module	= enabled_module + 'MVPN\r\n' 
		cli('show ip pim mdt')
		if pd_arr.length > 2 :
			cli('show ip pim dense-mode mroute')
			cli('show ip pim dense-mode neighbor')
			cli('show ip pim dense-mode nexthop')
			cli('show ip pim dense-mode track')
			cli('show ip pim dense-mode interface')
		end
		if ps_arr.length > 2 :
			cli('show ip pim sparse-mode mroute')
			cli('show ip pim sparse-mode neighbor')
			cli('show ip pim sparse-mode nexthop')
			cli('show ip pim sparse-mode track')
			cli('show ip pim sparse-mode interface')
		end
		i = 1
		while i < (vrfArr.length - 1) :
			clicmd = 'show ip pim vrf ' + vrfArr[i] + ' mdt receive'
			cli(clicmd)
			clicmd1 = 'show ip pim vrf ' + vrfArr[i] + ' mdt send'
			cli(clicmd1)
			i = i + 1
		end
		cli('show ip ref mcast info')
		cli('show ip ref mcast route')
		cli('sh ip ref mcast statistics mfc')
	end

	#interface based command
	enabled_module	= enabled_module + 'enabled interface :\r\n'
	cli('show interface')

	print "step 3333"
	#所有需要收集接口命令的模块，都在此处添加
	res = cli('show ip interface brief')
	if_arr = res.split(/\r?\n/ig)
	if if_arr.length > 3 :
		i = 2
		while i < (if_arr.length - 1) :
			temp_if = if_arr[i];
			temp_if = temp_if.split(/\s+/g)
			clicmd = 'show run interface ' + temp_if[0] + ' ' + temp_if[1] 
			res = cli(clicmd)
			if res.indexOf('port-queue') != -1 :
				clicmd1 = 'show port-queue statistics interface ' + temp_if[0] + ' ' + temp_if[1] 
				cli(clicmd1)
			end
			
			if res.indexOf('pim') != -1 :
				clicmd1 = 'show ip ref mcast statistics interface ' + temp_if[0] + ' ' + temp_if[1] 
				cli(clicmd1)
			end
			i = i + 1
		end
	end
	 
	res  = cli('show run | in Controller e1')
	e1_arr = res.split(/\r?\n/ig)
	if e1_arr.length > 2 :
		enabled_module	= enabled_module + 'E1\r\n' 
		cli('show controller e1')
	end

	res  = cli('show run | in Controller ATM')
	atm_arr = res.split(/\r?\n/ig)
	if atm_arr.length > 2 :
		enabled_module	= enabled_module + 'ATM\r\n' 
		cli('show atm map')
		cli('show atm vc-statistics')
		cli('show atm vc')
	end
	 
	res  = cli('show run | in Pos')
	res1  = cli('show run | in Cpos')
	pos_arr = res.split(/\r?\n/ig)
	cpos_arr = res1.split(/\r?\n/ig)
	if pos_arr.length > 2 || cpos_arr.length > 2:
		enabled_module	= enabled_module + 'POS/CPOS\r\n'
		cli('show pos interface pos')
	end
	 
	res  = cli('show run | in encapsulation ppp')
	ppp_arr = res.split(/\r?\n/ig)
	if ppp_arr.length > 2 :
		enabled_module	= enabled_module + 'PPP\r\n'
	end

	res = cli('show run | in ppp multilink')
	ppp_mp_arr = res.split(/\r?\n/ig)
	if ppp_mp_arr.length > 2 :
		enabled_module	= enabled_module + 'PPP multilink\r\n'
		cli('show ppp multilink')
		cli('show ref ppp multilink')
	end

	res = cli('show run | in interface Tunnel')
	tunnel_Arr = res.split(/\r?\n/ig)
	if tunnel_Arr.length > 2 :
		enabled_module	= enabled_module + 'Tunnel maybe GRE/IPIP/IPV6/IPV6IP\r\n' 
		i = 1
		while i < (tunnel_Arr.length - 1) :
			tunnel_name = tunnel_Arr[i]
			tunnel_id_arr =  tunnel_name.split(/\s+/g)
			clicmd = 'show run interface tunnel ' + tunnel_id_arr[2]
			res = cli(clicmd)
			tunnelcfg_arr = res.split(/\r?\n/ig)
			tunnel_source = false
			j = 1
			while j < (tunnelcfg_arr.length - 1) :
				tunnelcfg = tunnelcfg_arr[i]
				tunnelcfg = tunnelcfg.split(/\s+/g)
				if tunnelcfg[1] == 'source' :
					tunnel_sip = tunnelcfg[2]
					tunnel_source = true
				end
				
				if tunnelcfg[1] == 'destination' :
					tunnel_dip = tunnelcfg[2]
					if tunnel_source == true :
						clicmd1 = 'ping ' + tunnel_dip + ' sou ' + tunnel_sip
						cli(clicmd1)
					end
				end
				
				if tunnelcfg[1] == 'address' :
					tunnel_ip = tunnelcfg[2]
					clicmd2 = 'ping ' + tunnel_ip
					cli(clicmd2)
				end
				j = j + 1 
			end
			clicmd1 = 'show interface tunnel ' + tunnel_id_arr[2]
			cli(clicmd1)
			i = i + 1
		end
	end
		
	res = cli('show run | in interface Cellular')
	res1 = cli('show run | in interface Async')
	4g_arr = res.split(/\r?\n/ig)
	3g_arr = res1.split(/\r?\n/ig)
	if 4g_arr.length > 2 || 3g_arr.length > 2 :
		enabled_module	= enabled_module + '3G/4G\r\n' 
		high_risk_module = high_risk_module + '3G/4G\r\n'
		cli('show cellular info')
		cli('show ip interface brief')
	end
	
end

add_problem('sys_status',[enabled_module,high_risk_module])

return 'warn'

