У меня есть txt файл с именем региона, который нужно исключить из списка registry.xml файл и показать только хосты не исключенного региона.
Вот это самое registry.xml файл
<?xml version="1.0" encoding="UTF-8"?> <p:Complex xmlns:p="http://www.openwave.com/OAM/ConfigData-v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" DocPath="" Name="Openwave" XSDVersion="1.4" xsi:schemaLocation="http://www.openwave.com/OAM/ConfigData-v1 ConfigData-v1.xsd"> <ConfigGroup Name="OAMCS_Install"> <ValueString Encrypted="false" Name="SSH_Username">root <ValueString Encrypted="false" Name="SSH_Password">KMdJvcDHLFM= <ValueString Encrypted="false" Name="SSH_Key_Flag">true <ValueString Encrypted="false" Name="SSH_Private_Key_Location">/root/.ssh/id_dsa <Region Name="TG"> <Host Name="pun-esx-prod2-vm21.owmobility.com"> <ConfigGroup Name="_Registry_"> <ValueString Encrypted="false" Name="ActiveOAM">OAM v6.3.2 <ValueString Encrypted="false" Name="ActiveSystem">None <ConfigGroup Name="Packages"> <ConfigGroup Name="OAM v6.3.2"> <ConfigGroup Name="OPWVoamCL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCL <ConfigGroup Name="OPWVoamMYSQL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamMYSQL-6.3.2-el7.i686 <ConfigGroup Name="OPWVoamRT"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamRT-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamRTPatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamRTPatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVmepIntegraRT"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepIntegraRT-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamRTPatch-6.3.2.10"> <ValueString Encrypted="false" Name="Version">6.3.2.10 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamRTPatch-6.3.2.10-el7.x86_64 <ConfigGroup Name="STM v6.3.2"/> <ValueString Encrypted="false" Name="SystemType">Linux 3.10.0-514.16.1.el7.x86_64 x86_64 x86_64 <Host Name="pun-esx-prod2-vm23.owmobility.com"> <ConfigGroup Name="_Registry_"> <ValueString Encrypted="false" Name="ActiveOAM">OAM v6.3.2 <ValueString Encrypted="false" Name="ActiveSystem">TestSystem <ConfigGroup Name="Packages"> <ConfigGroup Name="OAM v6.3.2"> <ConfigGroup Name="OPWVoamCL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCL-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamCP"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCP-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCLPatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.10"> <ValueString Encrypted="false" Name="Version">6.3.2.10 <ValueString Encrypted="false" Name="Status">Failed: could not install the package <ValueString Encrypted="false" Name="InstalledName"/> <ConfigGroup Name="OPWVoamCLPatch-6.3.2.11"> <ValueString Encrypted="false" Name="Version">6.3.2.11 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCLPatch-6.3.2.11-el7.x86_64 <ConfigGroup Name="OPWVoamCPPatch-6.3.2.11"> <ValueString Encrypted="false" Name="Version">6.3.2.11 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCPPatch-6.3.2.11-el7.x86_64 <ConfigGroup Name="CONGESTIONCONTROL v6.2.2"> <ConfigGroup Name="OPWVmepCC"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCC-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepDAV"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepDAV-6.2.2-el7.i686 <ConfigGroup Name="OPWVmepOOS"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepOOS-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepCCpatch-6.2.2.5"> <ValueString Encrypted="false" Name="Version">6.2.2.5 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCCpatch-6.2.2.5-el7.x86_64 <ConfigGroup Name="INTEGRA v6.3.2"> <ConfigGroup Name="OPWVmepCR"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCR-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVmepHEpatch-6.3.2.1"> <ValueString Encrypted="false" Name="Version">6.3.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepHEpatch-6.3.2.1-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.12"> <ValueString Encrypted="false" Name="Version">6.3.2.12 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.12-el7.x86_64 <ConfigGroup Name="TCPACC v6.2.2"> <ConfigGroup Name="OPWVmepTCPAcc"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepTCPAcc-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepTCPAccpatch-6.2.2.3"> <ValueString Encrypted="false" Name="Version">6.2.2.3 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepTCPAccpatch-6.2.2.3-el7.x86_64 <ConfigGroup Name="FFMPEG v6.2.2"> <ConfigGroup Name="OPWVmepFFMPEG_2.4.3"> <ValueString Encrypted="false" Name="Version">2.4.3 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepFFMPEG_2.4.3-6.2.2-el7.x86_64 <ConfigGroup Name="IPTM v1.3.2"> <ConfigGroup Name="OPWVmepIPTM"> <ValueString Encrypted="false" Name="Version">1.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepIPTM-1.3.2-el7.x86_64 <ConfigGroup Name="STM v6.3.2"> <ConfigGroup Name="OPWVmepSTM"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTM-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVmepSTMpatch-2.2.2.1"> <ValueString Encrypted="false" Name="Version">2.2.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTMpatch-2.2.2.1-el7.x86_64 <ConfigGroup Name="OPWVmepSTMpatch-2.2.2.6"> <ValueString Encrypted="false" Name="Version">2.2.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTMpatch-2.2.2.6-el7.x86_64 <ValueString Encrypted="false" Name="SystemType">Linux 3.10.0-514.16.1.el7.x86_64 x86_64 x86_64 <Host Name="pun-esx-prod2-vm9.owmobility.com"> <ConfigGroup Name="_Registry_"> <ValueString Encrypted="false" Name="ActiveOAM">OAM v6.3.2 <ValueString Encrypted="false" Name="ActiveSystem">TestSystem <ConfigGroup Name="Packages"> <ConfigGroup Name="OAM v6.3.2"> <ConfigGroup Name="OPWVoamCL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCL-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamMYSQL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamMYSQL-6.3.2-el7.i686 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCLPatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.10"> <ValueString Encrypted="false" Name="Version">6.3.2.10 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCLPatch-6.3.2.10-el7.x86_64 <ConfigGroup Name="FFMPEG v6.2.2"> <ConfigGroup Name="OPWVmepX264_4.1"> <ValueString Encrypted="false" Name="Version">4.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepX264_4.1-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepFFMPEG_4.1"> <ValueString Encrypted="false" Name="Version">4.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepFFMPEG_4.1-6.2.2-el7.x86_64 <ConfigGroup Name="INTEGRA v6.3.2"> <ConfigGroup Name="OPWVmepCR"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCR-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVmepHEpatch-6.3.2.1"> <ValueString Encrypted="false" Name="Version">6.3.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepHEpatch-6.3.2.1-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.12"> <ValueString Encrypted="false" Name="Version">6.3.2.12 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.12-el7.x86_64 <ConfigGroup Name="CONGESTIONCONTROL v6.2.2"> <ConfigGroup Name="OPWVmepVOS"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepVOS-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepCCDBMgr"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCCDBMgr-6.2.2-el7.x86_64 <ConfigGroup Name="GSTREAMER v6.2.2"> <ConfigGroup Name="OPWVmepGStreamer_0.10"> <ValueString Encrypted="false" Name="Version">0.10 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepGStreamer_0.10-6.2.2-el7.x86_64 <ConfigGroup Name="STM v6.3.2"> <ConfigGroup Name="OPWVmepSTMpatch-2.2.2.1"> <ValueString Encrypted="false" Name="Version">2.2.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTMpatch-2.2.2.1-el7.x86_64 <ValueString Encrypted="false" Name="SystemType">Linux 3.10.0-514.16.1.el7.x86_64 x86_64 x86_64 <Region Name="AX"> <Host Name="pun-esx-prod2-vm22.owmobility.com"> <ConfigGroup Name="_Registry_"> <ValueString Encrypted="false" Name="ActiveOAM">OAM v6.3.2 <ValueString Encrypted="false" Name="ActiveSystem">None <ConfigGroup Name="Packages"> <ConfigGroup Name="OAM v6.3.2"> <ConfigGroup Name="OPWVoamCL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCL <ConfigGroup Name="OPWVoamMYSQL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamMYSQL-6.3.2-el7.i686 <ConfigGroup Name="OPWVoamRT"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamRT-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamRTPatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamRTPatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVmepIntegraRT"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepIntegraRT-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamRTPatch-6.3.2.10"> <ValueString Encrypted="false" Name="Version">6.3.2.10 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamRTPatch-6.3.2.10-el7.x86_64 <ConfigGroup Name="STM v6.3.2"/> <ValueString Encrypted="false" Name="SystemType">Linux 3.10.0-514.16.1.el7.x86_64 x86_64 x86_64 <Host Name="pun-esx-prod2-vm24.owmobility.com"> <ConfigGroup Name="_Registry_"> <ValueString Encrypted="false" Name="ActiveOAM">OAM v6.3.2 <ValueString Encrypted="false" Name="ActiveSystem">TestSystem <ConfigGroup Name="Packages"> <ConfigGroup Name="OAM v6.3.2"> <ConfigGroup Name="OPWVoamCL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCL-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamCP"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCP-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCLPatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.10"> <ValueString Encrypted="false" Name="Version">6.3.2.10 <ValueString Encrypted="false" Name="Status">Failed: could not install the package <ValueString Encrypted="false" Name="InstalledName"/> <ConfigGroup Name="CONGESTIONCONTROL v6.2.2"> <ConfigGroup Name="OPWVmepCC"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCC-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepDAV"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepDAV-6.2.2-el7.i686 <ConfigGroup Name="OPWVmepOOS"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepOOS-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepCCpatch-6.2.2.5"> <ValueString Encrypted="false" Name="Version">6.2.2.5 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCCpatch-6.2.2.5-el7.x86_64 <ConfigGroup Name="INTEGRA v6.3.2"> <ConfigGroup Name="OPWVmepCR"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCR-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVmepHEpatch-6.3.2.1"> <ValueString Encrypted="false" Name="Version">6.3.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepHEpatch-6.3.2.1-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.12"> <ValueString Encrypted="false" Name="Version">6.3.2.12 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.12-el7.x86_64 <ConfigGroup Name="TCPACC v6.2.2"> <ConfigGroup Name="OPWVmepTCPAcc"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepTCPAcc-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepTCPAccpatch-6.2.2.3"> <ValueString Encrypted="false" Name="Version">6.2.2.3 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepTCPAccpatch-6.2.2.3-el7.x86_64 <ConfigGroup Name="FFMPEG v6.2.2"> <ConfigGroup Name="OPWVmepFFMPEG_2.4.3"> <ValueString Encrypted="false" Name="Version">2.4.3 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepFFMPEG_2.4.3-6.2.2-el7.x86_64 <ConfigGroup Name="IPTM v1.3.2"> <ConfigGroup Name="OPWVmepIPTM"> <ValueString Encrypted="false" Name="Version">1.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepIPTM-1.3.2-el7.x86_64 <ConfigGroup Name="STM v6.3.2"> <ConfigGroup Name="OPWVmepSTM"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTM-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVmepSTMpatch-2.2.2.1"> <ValueString Encrypted="false" Name="Version">2.2.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTMpatch-2.2.2.1-el7.x86_64 <ConfigGroup Name="OPWVmepSTMpatch-2.2.2.6"> <ValueString Encrypted="false" Name="Version">2.2.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTMpatch-2.2.2.6-el7.x86_64 <ValueString Encrypted="false" Name="SystemType">Linux 3.10.0-514.16.1.el7.x86_64 x86_64 x86_64 <Host Name="pun-esx-prod2-vm10.owmobility.com"> <ConfigGroup Name="_Registry_"> <ValueString Encrypted="false" Name="ActiveOAM">OAM v6.3.2 <ValueString Encrypted="false" Name="ActiveSystem">TestSystem <ConfigGroup Name="Packages"> <ConfigGroup Name="OAM v6.3.2"> <ConfigGroup Name="OPWVoamCL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCL-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVoamMYSQL"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamMYSQL-6.3.2-el7.i686 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCLPatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVoamCLPatch-6.3.2.10"> <ValueString Encrypted="false" Name="Version">6.3.2.10 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVoamCLPatch-6.3.2.10-el7.x86_64 <ConfigGroup Name="FFMPEG v6.2.2"> <ConfigGroup Name="OPWVmepX264_4.1"> <ValueString Encrypted="false" Name="Version">4.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepX264_4.1-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepFFMPEG_4.1"> <ValueString Encrypted="false" Name="Version">4.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepFFMPEG_4.1-6.2.2-el7.x86_64 <ConfigGroup Name="INTEGRA v6.3.2"> <ConfigGroup Name="OPWVmepCR"> <ValueString Encrypted="false" Name="Version">6.3.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCR-6.3.2-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.6"> <ValueString Encrypted="false" Name="Version">6.3.2.6 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.6-el7.x86_64 <ConfigGroup Name="OPWVmepHEpatch-6.3.2.1"> <ValueString Encrypted="false" Name="Version">6.3.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepHEpatch-6.3.2.1-el7.x86_64 <ConfigGroup Name="OPWVmepCRpatch-6.3.2.12"> <ValueString Encrypted="false" Name="Version">6.3.2.12 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCRpatch-6.3.2.12-el7.x86_64 <ConfigGroup Name="CONGESTIONCONTROL v6.2.2"> <ConfigGroup Name="OPWVmepVOS"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepVOS-6.2.2-el7.x86_64 <ConfigGroup Name="OPWVmepCCDBMgr"> <ValueString Encrypted="false" Name="Version">6.2.2 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepCCDBMgr-6.2.2-el7.x86_64 <ConfigGroup Name="GSTREAMER v6.2.2"> <ConfigGroup Name="OPWVmepGStreamer_0.10"> <ValueString Encrypted="false" Name="Version">0.10 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepGStreamer_0.10-6.2.2-el7.x86_64 <ConfigGroup Name="STM v6.3.2"> <ConfigGroup Name="OPWVmepSTMpatch-2.2.2.1"> <ValueString Encrypted="false" Name="Version">2.2.2.1 <ValueString Encrypted="false" Name="Status">installed <ValueString Encrypted="false" Name="InstalledName">OPWVmepSTMpatch-2.2.2.1-el7.x86_64 <ValueString Encrypted="false" Name="SystemType">Linux 3.10.0-514.16.1.el7.x86_64 x86_64 x86_64
Теперь у меня есть один region_name_ex.txt файл с исключенным списком имен регионов, как показано ниже
[root@oam01 bin]# подробнее region_name_ex.txt
ТОПОР
Сообщение по сравнению с registry.xml файл получил регион, хост которого нужно показать, как показано ниже:
[root@oam01 bin]# подробнее final_region_name.txt
ТГ
Итак, в настоящее время registry.xml файл имеет 2 региона, которые имеют по 3 суб-хоста в каждом. Нам нужно читать final_region_name.txt чтобы показать, что конкретный регион хостов. Нужно кодировать, имея в виду несколько регионов.
Что я уже пробовал:
#!/usr/bin/perl use strict; se warnings; use lib "/opt/opwv/ost/lib"; se ostUtils; my $ostEnv = ostUtils::getOSTenv(); my $oamVersion = $ostEnv->{'OAM_VERSION'}; use oamUtils; se Getopt::Std; use File::Basename; se Data::Dumper; my $user = "opwv"; my $scriptName = basename($0); my %opts; ############################################################################### sub printUsage() { print "\nUsage: $scriptName -h|-u <user>\n\n"; print "\t-h\tPrints this help\n"; print "\t-c\tSpecifies command to execute\n"; print "\t-u\tSpecifies UNIX user under which the command will be executed. Defaults to \"opwv\" if not specified\n"; print "\n"; } ############################################################################### # Start of main program # getopts('c:hu:', \%opts); printUsage() && exit if($opts{h}); printUsage() && exit unless($opts{c}); my $remoteCommand = $opts{c}; $user = $opts{u} if($opts{u}); my $cfgFile = "/opt/opwv/oam/" . $oamVersion . "/cfgroot/System/cscfg.xml"; my $registryXmlFile = "/opt/opwv/oam/" . $oamVersion . "/cfgroot/System/registry.xml"; my $haMode=`grep HAMode $cfgFile 2>/dev/null | cut -d'>' -f2 | cut -d'<' -f1`; #If the node is RW, then create a file with region name if ($haMode =~ "RW") { my $registryXmlData = oamUtils::getOAMregistry($registryXmlFile); open my $fh, '>', 'region_name.txt' or die "$!"; foreach my $region (sort (keys(%{$$registryXmlData->{'Region'}})) ) { #print "$region\n"; print $fh $region; print $fh "\n"; } close $fh; } #Difference between two files and print not excluded region name my $first_file = shift || 'region_name.txt'; my $second_file = shift || 'region_name_ex.txt'; my $third_file = shift || 'final_region_name.txt'; open my $a_fh, '<', $first_file or die "$first_file: $!"; open my $b_fh, '<', $second_file or die "$second_file: $!"; open(c_fh, '>', $third_file) or die $!; my %second_file; @second_file{map { unpack 'A*', $_ } <$b_fh>} = (); while (<$a_fh>) { print c_fh unless exists $second_file{unpack 'A*', $_}; #print c_fh "\n"; } close $a_fh; close $b_fh; close (c_fh); my $forth_file = shift || 'final_region_name.txt'; open(d_fh, '+<', $forth_file) or die $!; #Below code is showing all the region hosts. Want to show only host of region in final_region_name.txt and need help. if ($haMode =~ "RW") { my $registryXmlData = oamUtils::getOAMregistry($registryXmlFile); foreach my $region (sort (keys(%{$$registryXmlData->{'Region'}})) ) { foreach my $host (sort (keys(%{$$registryXmlData->{'Region'}->{$region}->{'Host'}})) ) { my $output = system("ssh -o \"ConnectTimeout=10\" $user\@$host \"$remoteCommand\" >/dev/null 2>&1"); if ($? > 0) { print "OamLog:RemoteNotifyCritical|$host:$scriptName|$host is unreachable and seems to be Down. Bring it back up asap.\n"; } else { print "OamLog:INFO|$host:$scriptName|$host is Up.\n"; } } } } else { print "OamLog:INFO|$scriptName|HA mode is NOT set as RW on this node\n"; } close (d_fh);
Mohibur Rashid
Что это такое? Массивный дамп кода,я даже не собираюсь пытаться посмотреть на ваш код. В любом случае, вы пробовали отладку?
Member 13627198
Пожалуйста, обратите внимание, что в настоящее время он показывает всех хозяев. Я хочу исключить хост для региона, присутствующего в Примере обработчика 'TX'. Я очень новичок в perl и нуждаюсь в вашей помощи, чтобы разобраться в этом вопросе. Я поделился с вами registry.xml файл для справки.
мой $forth_file = сдвиг || 'final_region_name.txt';
откройте(d_fh, '+<', $forth_file) или умрите $!;
Mohibur Rashid
открытая команда выглядит странно. почему у вас есть знак + в середине?
также я задал вам вопрос 4 дня назад. как насчет этого?
Mohibur Rashid
$$registryXmlData, почему двойная отметка$?