Partage
  • Partager sur Facebook
  • Partager sur Twitter

Aide projet Python

Traitement fichier RECORD et CSV

    14 mai 2014 à 17:00:52

    Bonjour,

    J'ai un projet de développement à réaliser. Je vous explique la demande :

    - Un personne de la société génère un fichier de configuration portant l’extension .record

     Cette extention est propre à HP . Le produit pour un information est HP Universal CMDB

    - Cette même personne doit cliquer sur l'exécutable ( que je dois faire, d’où mon poste) qui doit réaliser ceci :

                                      - Ouvrir le fichier .record

                                      - Parser le fichier .record avec la reconnaissance de balises précises ( <log start et <EXEC start)

                                      - Enregistrer le résultat du parsing <nom>.csv

                                       - Ouvrir le fichier <nom>.csv sous EXCEL

    Au final, les lignes du CSV doivent être dans le ordre que dans le fichier .record

    Je précise des informations qui pourront vous aider, à savoir :

    - Je développe l'application sous Linux et la personne qui va l'utiliser est sous Windows. Je compte faire la conversion avec py2exe.

    - Il faut que l'ouverture de fichier ( a savoir du .record) doit être un chemin absolu en précisant l’extension .record ( Mon problème que je ne sais pas faire)

    - Est ce qu'il est possible d'analyser le fichier .record comme pour un fichier XML ? ou il faut le convertir en XML ? Car l'apparence du fichier source ( .record) ressemble beaucoup à du XML.

    - Je liste dans mon programme les fichiers ayant une extension .record ( Mon problème que je ne sais pas faire)

    Je ne suis pas développeur, juste ingénieur système et réseaux. Je réalise ce programme pour dépanner un collègue, mais je galère.

    Je passe mon code que j'ai réaliser. Il doit y avoir des erreurs etc.. Pourriez vous regarder et m'aider à réaliser ce projet SVP ?

    Je vous remercie par avance

    scratt

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
     
    import os
    import xml.sax
    
    #lister les fichiers en .RECORD et ouverture fichier à traiter
    os.chdir("/home")
    for root,dirs,files in os.walk(directory):
    	for file in files:
    		if file.endswith('.record'):
    			print file()
    				
    print "Bienvenue dans l'application CMDB"
    print "Parsing et génération CSV"
    record = raw_input('nom du fichier à traiter: ')
    record = os.getcwd()
    
    #parsing du fichier chargé
    
    class CmdHandler(xml.sax.ConterHandler):
    	def __init__(self):
    		self.CurrentData = ""
    		self.logstart = ""
    		self.EXECstart = ""
    		
    	#Appel d'un élément de départ 
    	def startElement(self, tag, attributes):
    			self.CurrentData = tag
    			if tag == "log start":
    				print "*****Log start*****"
    				Logstart = attributes["log start"]
    				print "Log start:", Logstart
    			if tag == "EXEC start":
    				print "****Exec start******"
    				EXECSTART = attributes["EXEC start"]
    				print "EXECSTART:", EXECstart
    				 
    	#Appel d'un élement de fin
    	def endElement(self, tag):
    			if self.CurrentData == "log start":
    				print "log start:",self.logstart
    			elif self.CurrentData == "EXEC start":
    				print "EXEC start:", self.EXECstart
    
    	#Appel quand un une ligne est lue
    	def characters(self, content):							
    				if self.CurrentData == "log start":
    					self.logstart = content
    				elif self.CurrentData =="EXEC start":
    					self.EXECstart = content
    					
    if (__name__ =="main__"):
    	parser = xml.sax.make_parser()
    	parser.setFeature(xml.sax.handler.feature_namespaces, 0) 
    	parser.setContHanler( Handler)
    	parser.parse("test2.record")	



    • Partager sur Facebook
    • Partager sur Twitter

    Linux , le marché en zone libre

      14 mai 2014 à 17:09:51

      - Est ce qu'il est possible d'analyser le fichier .record comme pour un fichier XML ? ou il faut le convertir en XML ? Car l'apparence du fichier source ( .record) ressemble beaucoup à du XML.


      J'analyse des fichiers SQLite en hexa. Partant de ce principe tu pourras tout faire ! Après que veux tu analyser dans le fichier ?

      -
      Edité par MonsieurVaros 14 mai 2014 à 17:10:32

      • Partager sur Facebook
      • Partager sur Twitter
      Python, simple et puissant !
        14 mai 2014 à 18:16:22

        Tu pourrais nous montrer un exemple de fichier .record, stp ?

        • Partager sur Facebook
        • Partager sur Twitter
        Zeste de Savoir, le site qui en a dans le citron !
          14 mai 2014 à 19:33:23

          Merci pour vos réponses. Je veux analyser les valeurs qui sont dans les balises que j'ai mis dans mon code. OK Nohar pas de soucis, je vous passe le fichier .record.

          <execution jobId="MZ_VSR Serveurs Shell_Courrier Infrastructure_Host Connection by Shell" destinationid="41f44fd69a3cda7a8dd02cce94d154b8" max_store_sent_results="2147483647">
          	<destination>
          		<destinationData name="id">41f44fd69a3cda7a8dd02cce94d154b8</destinationData><destinationData name="ip_address">221.128.8.125</destinationData><destinationData name="host_key">005056B053BA</destinationData><destinationData name="ip_domain">Confiance C</destinationData><destinationData name="mac_addrs">${NA}</destinationData><destinationData name="host_cmdbid">${NA}</destinationData><destinationData name="ip_mac_address">NA</destinationData><destinationData name="hostId">9637818046ea8efda27fb0476e232c70</destinationData><destinationData name="connected_os_credentials_id">NA</destinationData></destination><protocol name="ssh" cm_credential_id="691_1_CMS">
          		<object id="2648df4c266ee1e4b59d47723c318a40" id_type="CmdbObjectID" class="sshprotocol" isReference="false" is_anchor="false">
          			<attribute name="sshprotocol_version" type="String">SSH2 or SSH1</attribute><attribute name="protocol_pce_command_list" type="String">cstm,dmidecode,lsof,.*netstat,swlist</attribute><attribute name="sshprotocol_hello_timeout" type="String">10000</attribute><attribute name="protocol_type" type="String">sshprotocol</attribute><attribute name="cm_credential_id" type="String">691_1_CMS</attribute><attribute name="sshprotocol_authmode" type="String">publickey</attribute><attribute name="protocol_timeout" type="String">25000</attribute><attribute name="protocol_index" type="Integer">1</attribute><attribute name="sshprotocol_prompts" type="Unknown"/>
          			<attribute name="sshprotocol_sudo_su_policy" type="String">sudo</attribute><attribute name="protocol_username" type="String">ze1ucmdb</attribute><attribute name="protocol_netaddress" type="String">DEFAULT</attribute><attribute name="protocol_port" type="String">22</attribute><attribute name="protocol_sl_sudo_paths" type="String">/usr/bin/sudo</attribute><attribute name="protocol_sl_mode" type="String">sudo</attribute><attribute name="sshprotocol_sudo_paths" type="String">/usr/bin/sudo</attribute><attribute name="sshprotocol_sudo_commands" type="String">cstm,dmidecode,lsof,.*netstat,swlist</attribute><attribute name="user_label" type="String">Utilisateur Unix ze1ucmdb + Clé publique + Sudo</attribute><attribute name="sshprotocol_keypath" type="String">F:\APPLI\ze1\w5\hp\UCMDB\DataFlowProbe\conf\security\ze1ucmdb_CPNV0867_identity</attribute><attribute name="sshprotocol_shell_env_sep_char" type="String">;</attribute><attribute name="protocol_in_use" type="Boolean">false</attribute><attribute name="protocol_pce_policy" type="String">sudo_like</attribute></object></protocol><params>
          		<param param_name="onlyStampingClient" param_value="true"/>
          		<param param_name="maxThreadRuntime" param_value="900000"/>
          		<param param_name="taskType" param_value="runNow"/>
          		<param param_name="udaConnectionOrder" param_value="last"/>
          		<param param_name="language" param_value="NA"/>
          		<param param_name="useAIXhwId" param_value="false"/>
          		<param param_name="enableStamping" param_value="false"/>
          		<param param_name="JOB_ID" param_value="MZ_VSR Serveurs Shell_Courrier Infrastructure_Host Connection by Shell"/>
          		<param param_name="codepage" param_value="NA"/>
          	</params><log start="12:16:28" severity="info">Execution current time:2014/05/07 12:16:28</log><CONNECT start="12:16:28" duration="545" CMD="client_connect" RESULT="success" type="ssh" credentialsId="691_1_CMS">
          		<ClientProperties>
          			<prop name="sshprotocol_sudo_su_policy" value="sudo"/>
          			<prop name="protocol_index" value="1"/>
          			<prop name="protocol_timeout" value="25000"/>
          			<prop name="credentialsId" value="691_1_CMS"/>
          			<prop name="sshprotocol_sudo_commands" value="cstm,dmidecode,lsof,.*netstat,swlist"/>
          			<prop name="sshprotocol_keypath" value="F:\APPLI\ze1\w5\hp\UCMDB\DataFlowProbe\conf\security\ze1ucmdb_CPNV0867_identity"/>
          			<prop name="cm_credential_id" value="691_1_CMS"/>
          			<prop name="sshprotocol_shell_env_sep_char" value=";"/>
          			<prop name="protocol_type" value="sshprotocol"/>
          			<prop name="protocol_netaddress" value="DEFAULT"/>
          			<prop name="sshprotocol_authmode" value="publickey"/>
          			<prop name="sshprotocol_prompts"/>
          			<prop name="sshprotocol_hello_timeout" value="10000"/>
          			<prop name="protocol_port" value="22"/>
          			<prop name="protocol_sl_mode" value="sudo"/>
          			<prop name="protocol_sl_sudo_paths" value="/usr/bin/sudo"/>
          			<prop name="sshprotocol_version" value="SSH2 or SSH1"/>
          			<prop name="user_label" value="Utilisateur Unix ze1ucmdb + Clé publique + Sudo"/>
          			<prop name="protocol_username" value="ze1ucmdb"/>
          			<prop name="sshprotocol_sudo_paths" value="/usr/bin/sudo"/>
          			<prop name="protocol_in_use" value="false"/>
          			<prop name="BandwidthLimit" value="0"/>
          			<prop name="protocol_pce_policy" value="sudo_like"/>
          			<prop name="protocol_pce_command_list" value="cstm,dmidecode,lsof,.*netstat,swlist"/>
          		</ClientProperties></CONNECT><EXEC start="12:16:28" duration="24" CMD="ver" RESULT="-bash: ver: command not found"/>
          	<log start="12:16:28" severity="debug">Check for Cygwin installed on Windows</log><EXEC start="12:16:28" duration="21" CMD="cmd.exe /c ver" RESULT="-bash: cmd.exe: command not found"/>
          	<log start="12:16:28" severity="debug">Check for IBM VIO Server Shell</log><EXEC start="12:16:28" duration="20" CMD="ioscli uname -a" RESULT="-bash: ioscli: command not found"/>
          	<log start="12:16:28" severity="debug">Failed detecting IBM VIO Server. -bash: ioscli: command not found</log><EXEC start="12:16:28" duration="15" CMD="uname" RESULT="Linux"/>
          	<log start="12:16:28" severity="debug">Unix detected</log><EXEC start="12:16:28" duration="0" CMD="getShellCmdSeperator" RESULT=";"/>
          	<log start="12:16:28" severity="debug">Determining shell environment status variable...</log><log start="12:16:28" severity="debug">determining shell:</log><log start="12:16:28" severity="debug">trying: 'echo $SHELL'</log><EXEC start="12:16:29" duration="16">
          		<CMD>[CDATA: echo $SHELL]</CMD><RESULT>[CDATA: /bin/bash]</RESULT></EXEC><log start="12:16:29" severity="debug">res: '/bin/bash'</log><log start="12:16:29" severity="debug">response: '/bin/bash'</log><log start="12:16:29" severity="debug">trying: 'echo $?'...</log><EXEC start="12:16:29" duration="15">
          		<CMD>[CDATA: echo $?]</CMD><RESULT>[CDATA: 0]</RESULT></EXEC><log start="12:16:29" severity="debug">res: '0'...</log><log start="12:16:29" severity="debug">response: '0'</log><log start="12:16:29" severity="debug">found shell environment status variable='$?'</log><EXEC start="12:16:29" duration="29">
          		<CMD>[CDATA: uname ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: Linux
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:29" severity="debug">Using charset: Cp1252</log><log start="12:16:29" severity="debug">Can encode: True</log><EXEC start="12:16:29" duration="1" CMD="setCharset" RESULT="windows-1252"/>
          	<EXEC start="12:16:29" duration="0" CMD="getSudoPaths" RESULT="/usr/bin/sudo"/>
          	<EXEC start="12:16:29" duration="0">
          		<CMD>[CDATA: getSudoCommands]</CMD><RESULT>[CDATA: cstm,dmidecode,lsof,.*netstat,swlist]</RESULT></EXEC><log start="12:16:29" severity="debug">adding alternate cmd='locale -a | grep -E "en_US.*|^C|POSIX"'</log><log start="12:16:29" severity="debug">adding alternate cmd='locale -a | /usr/xpg4/bin/grep -E "en_US.*|^C|POSIX"'</log><log start="12:16:29" severity="debug">__getSudoPath: checking "/usr/bin/sudo -V;echo $?" command</log><EXEC start="12:16:29" duration="30">
          		<CMD>[CDATA: /usr/bin/sudo -V;echo $?]</CMD><RESULT>[CDATA: Sudo version 1.6.8p12
          0]</RESULT></EXEC><log start="12:16:29" severity="debug">__getSudoPath: execution of '/usr/bin/sudo -V;echo $?' succeeded - setting it as sudo path</log><EXEC start="12:16:29" duration="42">
          		<CMD>[CDATA: /usr/bin/sudo -l ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: User ze1ucmdb may run the following commands on this host:
              (ALL) ALL</RESULT></EXEC><log start="12:16:29" severity="debug">Command locale -a  is configured to run with sudo on destination.</log><log start="12:16:29" severity="debug">Command grep -E "en_US.* is configured to run with sudo on destination.</log><log start="12:16:29" severity="debug">Command ^C is configured to run with sudo on destination.</log><log start="12:16:29" severity="debug">Command POSIX" is configured to run with sudo on destination.</log><EXEC start="12:16:29" duration="71">
          		<CMD>[CDATA: locale -a | grep -E "en_US.*|^C|POSIX" ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: C
          en_US</RESULT></EXEC><log start="12:16:29" severity="debug">command='locale -a | grep -E "en_US.*|^C|POSIX"' ended successfully</log><EXEC start="12:16:29" duration="43">
          		<CMD>[CDATA: cmd.exe /c "exit /b 0" ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: -bash: cmd.exe: command not found
          ERROR_CODE:127]</RESULT></EXEC><EXEC start="12:16:29" duration="31">
          		<CMD>[CDATA: set ComSpec ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: ERROR_CODE:0]</RESULT></EXEC><EXEC start="12:16:29" duration="32">
          		<CMD>[CDATA: echo $SHELL ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: /bin/bash
          ERROR_CODE:0]</RESULT></EXEC><EXEC start="12:16:29" duration="32">
          		<CMD>[CDATA: echo $SHELL ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: /bin/bash
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:29" severity="debug">Bourne-like shell detected</log><log start="12:16:29" severity="debug">Command Not_Existing_Command is configured to run with sudo on destination.</log><EXEC start="12:16:29" duration="43">
          		<CMD>[CDATA: Not_Existing_Command ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: -bash: Not_Existing_Command: command not found
          ERROR_CODE:127]</RESULT></EXEC><log start="12:16:29" severity="debug">Command LANG="en_US.iso885915" </log><EXEC start="12:16:29" duration="60">
          		<CMD>[CDATA: LANG="en_US.iso885915" </CMD><RESULT>[CDATA: ERROR_CODE:0]</RESULT></EXEC><log start="12:16:29" severity="debug">Command LC_ALL="en_US.iso885915" </log><EXEC start="12:16:29" duration="3">
          		<CMD>[CDATA: LC_ALL="en_US.iso885915" </CMD><RESULT>[CDATA: ERROR_CODE:0]</RESULT></EXEC><log start="12:16:29" severity="debug">Locale set to: en_US.iso885915</log><EXEC start="12:16:29" duration="4">
          		<CMD>[CDATA: cmd.exe /c "exit /b 0" ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: -bash: cmd.exe: command not found
          ERROR_CODE:127]</RESULT></EXEC><EXEC start="12:16:29" duration="6">
          		<CMD>[CDATA: set ComSpec ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: ERROR_CODE:0]</RESULT></EXEC><EXEC start="12:16:29" duration="8">
          		<CMD>[CDATA: echo $SHELL ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: /bin/bash
          ERROR_CODE:0]</RESULT></EXEC><EXEC start="12:16:29" duration="8">
          		<CMD>[CDATA: echo $SHELL ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: /bin/bash
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:29" severity="debug">Bourne-like shell detected</log><log start="12:16:29" severity="debug">Command echo ${PATH-notExists} is configured to run with sudo on destination.</log><EXEC start="12:16:29" duration="9">
          		<CMD>[CDATA: echo ${PATH-notExists} ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: /home/ze1ucmdb/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/sbin:/usr/local/sbin:/usr/sbin:/opt/csw/bin:/opt/csw/sbin
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:29" severity="debug">Command PATH=${PATH}":/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" </log><EXEC start="12:16:29" duration="13">
          		<CMD>[CDATA: PATH=${PATH}":/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" </CMD><RESULT>[CDATA: ERROR_CODE:0]</RESULT></EXEC><log start="12:16:29" severity="debug">Current connected credential id is [NA]</log><log start="12:16:29" severity="debug">Connected credential id is irrelevant for this host - Not DDMI/UDA agent [ssh]</log><log start="12:16:29" severity="debug">creating object for obj_name=ssh</log><log start="12:16:29" severity="debug">Parameter for enableStamping:false</log><log start="12:16:29" severity="debug">Parameter for onlyStampingClient:true</log><EXEC start="12:16:29" duration="1">
          		<CMD>[CDATA: echo ~]</CMD><RESULT>[CDATA: /home/ze1ucmdb]</RESULT></EXEC><EXEC start="12:16:29" duration="4">
          		<CMD>[CDATA: cat ~/.discagnt/aioptionrc; echo ERRORCODE:$?]</CMD><RESULT>[CDATA: cat: /home/ze1ucmdb/.discagnt/aioptionrc: No such file or directory
          ERRORCODE:1]</RESULT></EXEC><EXEC start="12:16:29" duration="3">
          		<CMD>[CDATA: cat ~/.discagnt/aioptionrc; echo ERRORCODE:$?]</CMD><RESULT>[CDATA: cat: /home/ze1ucmdb/.discagnt/aioptionrc: No such file or directory
          ERRORCODE:1]</RESULT></EXEC><EXEC start="12:16:29" duration="4">
          		<CMD>[CDATA: cat ~/.discagnt/aioptionrc; echo ERRORCODE:$?]</CMD><RESULT>[CDATA: cat: /home/ze1ucmdb/.discagnt/aioptionrc: No such file or directory
          ERRORCODE:1]</RESULT></EXEC><EXEC start="12:16:30" duration="3">
          		<CMD>[CDATA: cat ~/.discagnt/aioptionrc; echo ERRORCODE:$?]</CMD><RESULT>[CDATA: cat: /home/ze1ucmdb/.discagnt/aioptionrc: No such file or directory
          ERRORCODE:1]</RESULT></EXEC><EXEC start="12:16:30" duration="48">
          		<CMD>[CDATA: cat ~/.discagnt/aioptionrc; echo ERRORCODE:$?]</CMD><RESULT>[CDATA: cat: /home/ze1ucmdb/.discagnt/aioptionrc: No such file or directory
          ERRORCODE:1]</RESULT></EXEC><EXEC start="12:16:30" duration="4">
          		<CMD>[CDATA: cat ~/.discagnt/aioptionrc; echo ERRORCODE:$?]</CMD><RESULT>[CDATA: cat: /home/ze1ucmdb/.discagnt/aioptionrc: No such file or directory
          ERRORCODE:1]</RESULT></EXEC><log start="12:16:30" severity="debug">Get uduid from client:None</log><log start="12:16:30" severity="debug">Final value of uduid:None</log><log start="12:16:30" severity="debug">Get UD_UNIQUE_ID:None</log><log start="12:16:30" severity="debug">Command hostname is configured to run with sudo on destination.</log><EXEC start="12:16:30" duration="3">
          		<CMD>[CDATA: hostname ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: CQYV0215
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:30" severity="debug">Found CQYV0215' for 221.128.8.125</log><log start="12:16:30" severity="debug">Command rpm -qa  is configured to run with sudo on destination.</log><log start="12:16:30" severity="debug">Command grep f5base is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="1085">
          		<CMD>[CDATA: rpm -qa | grep f5base ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: ERROR_CODE:1]</RESULT></EXEC><log start="12:16:31" severity="debug">Command vmware -v is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="2">
          		<CMD>[CDATA: vmware -v ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: -bash: vmware: command not found
          ERROR_CODE:127]</RESULT></EXEC><EXEC start="12:16:31" duration="3">
          		<CMD>[CDATA: cat /etc/resolv.conf ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: nameserver 221.128.255.254
          search courrier.intra.laposte.fr</RESULT></EXEC><log start="12:16:31" severity="debug">Command ps aux  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep dhclient  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep -v grep is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="13">
          		<CMD>[CDATA: ps aux | grep dhclient | grep -v grep ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: ERROR_CODE:1]</RESULT></EXEC><log start="12:16:31" severity="debug">can't list dhcp enabled interfaces: Output is empty</log><log start="12:16:31" severity="debug">adding alternate cmd='/sbin/ip addr show'</log><log start="12:16:31" severity="debug">adding alternate cmd='ip addr show'</log><log start="12:16:31" severity="debug">Command /sbin/ip addr show is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="3">
          		<CMD>[CDATA: /sbin/ip addr show ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: 1: lo: </RESULT></EXEC><log start="12:16:31" severity="debug">command='/sbin/ip addr show' ended successfully</log><log start="12:16:31" severity="debug">Command ls /proc/net/bonding is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="17">
          		<CMD>[CDATA: ls /proc/net/bonding ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: /bin/ls: /proc/net/bonding: No such file or directory
          ERROR_CODE:2]</RESULT></EXEC><log start="12:16:31" severity="debug">can't list bonding interfaces</log><log start="12:16:31" severity="debug">Host key was found: 005056B053BA</log><log start="12:16:31" severity="debug">Command uptime </log><EXEC start="12:16:31" duration="4">
          		<CMD>[CDATA: uptime </CMD><RESULT>[CDATA: 12:16pm  up 376 days 21:53,  1 user,  load average: 0.16, 0.03, 0.01
          2014-05-07 10:16:33</RESULT></EXEC><log start="12:16:31" severity="debug">Command dmidecode -t system  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command dmidecode -t system  is matched by privileged command pattern dmidecode</log><log start="12:16:31" severity="debug">Command dmidecode -t system  is matched by privileged command pattern dmidecode</log><log start="12:16:31" severity="debug">Command dmidecode -t system  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command dmidecode -t system  will be prefixed with /usr/bin/sudo</log><EXEC start="12:16:31" duration="8">
          		<CMD>[CDATA: /usr/bin/sudo dmidecode -t system | grep -A 6 "System Information" ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: System Information
          	Manufacturer: VMware, Inc.</RESULT></EXEC><log start="12:16:31" severity="debug">Command dmesg  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep eth2  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep Up is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="6">
          		<CMD>[CDATA: dmesg | grep eth2 | grep Up ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: eth2: NIC Link is Up 10000 Mbps
          eth2: NIC Link is Up 10000 Mbps</RESULT></EXEC><log start="12:16:31" severity="debug">Command mii-diag eth2 is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="2">
          		<CMD>[CDATA: mii-diag eth2 ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: -bash: mii-diag: command not found
          ERROR_CODE:127]</RESULT></EXEC><log start="12:16:31" severity="debug">Command dmesg  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep eth1  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep Up is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="6">
          		<CMD>[CDATA: dmesg | grep eth1 | grep Up ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: eth1: NIC Link is Up 10000 Mbps
          eth1: NIC Link is Up 10000 Mbps</RESULT></EXEC><log start="12:16:31" severity="debug">Command mii-diag eth1 is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="5">
          		<CMD>[CDATA: mii-diag eth1 ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: -bash: mii-diag: command not found
          ERROR_CODE:127]</RESULT></EXEC><log start="12:16:31" severity="debug">Command dmesg  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep eth0  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command grep Up is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="9">
          		<CMD>[CDATA: dmesg | grep eth0 | grep Up ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: eth0: NIC Link is Up 10000 Mbps
          eth0: NIC Link is Up 10000 Mbps</RESULT></EXEC><log start="12:16:31" severity="debug">Command mii-diag eth0 is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="12">
          		<CMD>[CDATA: mii-diag eth0 ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: -bash: mii-diag: command not found
          ERROR_CODE:127]</RESULT></EXEC><log start="12:16:31" severity="debug">adding alternate cmd='uname -r'</log><log start="12:16:31" severity="debug">adding alternate cmd='/usr/bin/uname -r'</log><log start="12:16:31" severity="debug">Command uname -r is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="5">
          		<CMD>[CDATA: uname -r ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: 2.6.16.60-0.69.1-smp
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:31" severity="debug">command='uname -r' ended successfully</log><log start="12:16:31" severity="debug">Command hostname is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="6">
          		<CMD>[CDATA: hostname ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: CQYV0215
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:31" severity="debug">Command dnsdomainname is configured to run with sudo on destination.</log><EXEC start="12:16:31" duration="4">
          		<CMD>[CDATA: dnsdomainname ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: courrier.intra.laposte.fr
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:31" severity="debug">Command dmidecode --version is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command dmidecode --version is matched by privileged command pattern dmidecode</log><log start="12:16:31" severity="debug">Command dmidecode --version is matched by privileged command pattern dmidecode</log><log start="12:16:31" severity="debug">Command dmidecode --version is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command dmidecode --version will be prefixed with /usr/bin/sudo</log><EXEC start="12:16:31" duration="11">
          		<CMD>[CDATA: /usr/bin/sudo dmidecode --version ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: 2.9
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:31" severity="debug">Command dmidecode -t system  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command dmidecode -t system  is matched by privileged command pattern dmidecode</log><log start="12:16:31" severity="debug">Command dmidecode -t system  is matched by privileged command pattern dmidecode</log><log start="12:16:31" severity="debug">Command dmidecode -t system  is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command dmidecode -t system  will be prefixed with /usr/bin/sudo</log><EXEC start="12:16:31" duration="11">
          		<CMD>[CDATA: /usr/bin/sudo dmidecode -t system | grep "SMBIOS" ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: SMBIOS 2.4 present.
          ERROR_CODE:0]</RESULT></EXEC><log start="12:16:31" severity="debug">The version of dmidecode detected:2.9</log><log start="12:16:31" severity="debug">The global setting 'setBiosUuidToMicrosoftStandart':false</log><log start="12:16:31" severity="debug">The bios uuid has already been in the correct format.</log><log start="12:16:31" severity="debug">Command netstat -r -n is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command netstat -r -n is matched by privileged command pattern .*netstat</log><log start="12:16:31" severity="debug">Command netstat -r -n is matched by privileged command pattern .*netstat</log><log start="12:16:31" severity="debug">Command netstat -r -n is configured to run with sudo on destination.</log><log start="12:16:31" severity="debug">Command netstat -r -n will be prefixed with /usr/bin/sudo</log><EXEC start="12:16:46" duration="14999">
          		<CMD>[CDATA: /usr/bin/sudo netstat -r -n ; echo ERROR_CODE:$?]</CMD><RESULT IS_NULL="Y"/>
          		<ERROR class="com.hp.ucmdb.discovery.library.clients.protocols.command.TimeoutException">
          			<message>[CDATA: Command timed out: Exceeded timeout after 15000 milliseconds]</message><stacktrace>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommandSSH" file="SSHAgent.java" line="944"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommand" file="SSHAgent.java" line="784"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient$1" method="executePrivateString" file="ShellClient.java" line="154"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.StringExecutor" method="executePrivate" file="StringExecutor.java" line="21"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.Executor" method="execute" file="Executor.java" line="26"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.BaseClient" method="exec" file="BaseClient.java" line="411"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient" method="executeCmd" file="ShellClient.java" line="157"/>
          				<frame class="sun.reflect.GeneratedMethodAccessor112" method="invoke" file="unknown" line="-1"/>
          				<frame class="sun.reflect.DelegatingMethodAccessorImpl" method="invoke" file="DelegatingMethodAccessorImpl.java" line="43"/>
          				<frame class="java.lang.reflect.Method" method="invoke" file="Method.java" line="601"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="186"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="204"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="441"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="447"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="154"/>
          				<frame class="org.python.pycode._pyx25" method="_UnixShell__executeCommand$182" file="shellutils" line="1925"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="_execute$192" file="shellutils" line="2034"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="execCmd$87" file="shellutils" line="835"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="157"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="338"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="139"/>
          				<frame class="org.python.pycode._pyx1844" method="getCommandsOutput$125" file="TTY_Connection_Utils" line="927"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="141"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx1844" method="discoverDefaultGateway$230" file="TTY_Connection_Utils" line="2045"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="discover$218" file="TTY_Connection_Utils" line="1949"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="getOSandStuff$293" file="TTY_Connection_Utils" line="2899"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="doDiscovery$13" file="HostConnectionByShell" line="458"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="DiscoveryMain$2" file="HostConnectionByShell" line="210"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.pycode._pyx2073" method="f$0" file="&lt;string&gt;" line="2"/>
          				<frame class="org.python.pycode._pyx2073" method="call_function" file="&lt;string&gt;" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyCode" method="call" file="PyCode.java" line="18"/>
          				<frame class="org.python.core.Py" method="runCode" file="Py.java" line="1275"/>
          				<frame class="org.python.core.Py" method="exec" file="Py.java" line="1319"/>
          				<frame class="org.python.util.PythonInterpreter" method="exec" file="PythonInterpreter.java" line="206"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="251"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="226"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="222"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScripts" file="ExecutionEngineImpl.java" line="139"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="execute" file="ExecutionEngineImpl.java" line="96"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.TablesProcessorUtil" method="processDestinationTables" file="TablesProcessorUtil.java" line="136"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.DynamicService" method="discover" file="DynamicService.java" line="76"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter" method="launchTask" file="JobExecuter.java" line="1199"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="launch" file="JobExecuter.java" line="946"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="executeTask" file="JobExecuter.java" line="870"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="run" file="JobExecuter.java" line="733"/>
          			</stacktrace></ERROR></EXEC><log start="12:16:46" severity="debug">Command cat /etc/SuSE-release is configured to run with sudo on destination.</log><EXEC start="12:17:01" duration="14999">
          		<CMD>[CDATA: cat /etc/SuSE-release ; echo ERROR_CODE:$?]</CMD><RESULT IS_NULL="Y"/>
          		<ERROR class="com.hp.ucmdb.discovery.library.clients.protocols.command.TimeoutException">
          			<message>[CDATA: Command timed out: Exceeded timeout after 15000 milliseconds]</message><stacktrace>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommandSSH" file="SSHAgent.java" line="944"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommand" file="SSHAgent.java" line="784"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient$1" method="executePrivateString" file="ShellClient.java" line="154"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.StringExecutor" method="executePrivate" file="StringExecutor.java" line="21"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.Executor" method="execute" file="Executor.java" line="26"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.BaseClient" method="exec" file="BaseClient.java" line="411"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient" method="executeCmd" file="ShellClient.java" line="157"/>
          				<frame class="sun.reflect.GeneratedMethodAccessor112" method="invoke" file="unknown" line="-1"/>
          				<frame class="sun.reflect.DelegatingMethodAccessorImpl" method="invoke" file="DelegatingMethodAccessorImpl.java" line="43"/>
          				<frame class="java.lang.reflect.Method" method="invoke" file="Method.java" line="601"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="186"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="204"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="441"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="447"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="154"/>
          				<frame class="org.python.pycode._pyx25" method="_UnixShell__executeCommand$182" file="shellutils" line="1925"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="_execute$192" file="shellutils" line="2034"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="execCmd$87" file="shellutils" line="835"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="157"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="338"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="139"/>
          				<frame class="org.python.pycode._pyx1844" method="getCommandsOutput$125" file="TTY_Connection_Utils" line="927"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="141"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx1844" method="discoverOsFlavor$228" file="TTY_Connection_Utils" line="2011"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="discover$218" file="TTY_Connection_Utils" line="1949"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="getOSandStuff$293" file="TTY_Connection_Utils" line="2899"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="doDiscovery$13" file="HostConnectionByShell" line="458"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="DiscoveryMain$2" file="HostConnectionByShell" line="210"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.pycode._pyx2073" method="f$0" file="&lt;string&gt;" line="2"/>
          				<frame class="org.python.pycode._pyx2073" method="call_function" file="&lt;string&gt;" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyCode" method="call" file="PyCode.java" line="18"/>
          				<frame class="org.python.core.Py" method="runCode" file="Py.java" line="1275"/>
          				<frame class="org.python.core.Py" method="exec" file="Py.java" line="1319"/>
          				<frame class="org.python.util.PythonInterpreter" method="exec" file="PythonInterpreter.java" line="206"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="251"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="226"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="222"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScripts" file="ExecutionEngineImpl.java" line="139"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="execute" file="ExecutionEngineImpl.java" line="96"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.TablesProcessorUtil" method="processDestinationTables" file="TablesProcessorUtil.java" line="136"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.DynamicService" method="discover" file="DynamicService.java" line="76"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter" method="launchTask" file="JobExecuter.java" line="1199"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="launch" file="JobExecuter.java" line="946"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="executeTask" file="JobExecuter.java" line="870"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="run" file="JobExecuter.java" line="733"/>
          			</stacktrace></ERROR></EXEC><log start="12:17:01" severity="debug">Command cat /etc/oracle-release is configured to run with sudo on destination.</log><EXEC start="12:17:16" duration="15000">
          		<CMD>[CDATA: cat /etc/oracle-release ; echo ERROR_CODE:$?]</CMD><RESULT IS_NULL="Y"/>
          		<ERROR class="com.hp.ucmdb.discovery.library.clients.protocols.command.TimeoutException">
          			<message>[CDATA: Command timed out: Exceeded timeout after 15000 milliseconds]</message><stacktrace>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommandSSH" file="SSHAgent.java" line="944"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommand" file="SSHAgent.java" line="784"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient$1" method="executePrivateString" file="ShellClient.java" line="154"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.StringExecutor" method="executePrivate" file="StringExecutor.java" line="21"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.Executor" method="execute" file="Executor.java" line="26"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.BaseClient" method="exec" file="BaseClient.java" line="411"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient" method="executeCmd" file="ShellClient.java" line="157"/>
          				<frame class="sun.reflect.GeneratedMethodAccessor112" method="invoke" file="unknown" line="-1"/>
          				<frame class="sun.reflect.DelegatingMethodAccessorImpl" method="invoke" file="DelegatingMethodAccessorImpl.java" line="43"/>
          				<frame class="java.lang.reflect.Method" method="invoke" file="Method.java" line="601"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="186"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="204"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="441"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="447"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="154"/>
          				<frame class="org.python.pycode._pyx25" method="_UnixShell__executeCommand$182" file="shellutils" line="1925"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="_execute$192" file="shellutils" line="2034"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="execCmd$87" file="shellutils" line="835"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="157"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="338"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="139"/>
          				<frame class="org.python.pycode._pyx1844" method="getCommandsOutput$125" file="TTY_Connection_Utils" line="927"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="141"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx1844" method="discoverOsFlavor$228" file="TTY_Connection_Utils" line="2011"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="discover$218" file="TTY_Connection_Utils" line="1949"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="getOSandStuff$293" file="TTY_Connection_Utils" line="2899"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="doDiscovery$13" file="HostConnectionByShell" line="458"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="DiscoveryMain$2" file="HostConnectionByShell" line="210"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.pycode._pyx2073" method="f$0" file="&lt;string&gt;" line="2"/>
          				<frame class="org.python.pycode._pyx2073" method="call_function" file="&lt;string&gt;" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyCode" method="call" file="PyCode.java" line="18"/>
          				<frame class="org.python.core.Py" method="runCode" file="Py.java" line="1275"/>
          				<frame class="org.python.core.Py" method="exec" file="Py.java" line="1319"/>
          				<frame class="org.python.util.PythonInterpreter" method="exec" file="PythonInterpreter.java" line="206"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="251"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="226"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="222"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScripts" file="ExecutionEngineImpl.java" line="139"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="execute" file="ExecutionEngineImpl.java" line="96"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.TablesProcessorUtil" method="processDestinationTables" file="TablesProcessorUtil.java" line="136"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.DynamicService" method="discover" file="DynamicService.java" line="76"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter" method="launchTask" file="JobExecuter.java" line="1199"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="launch" file="JobExecuter.java" line="946"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="executeTask" file="JobExecuter.java" line="870"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="run" file="JobExecuter.java" line="733"/>
          			</stacktrace></ERROR></EXEC><log start="12:17:16" severity="debug">Command cat /etc/redhat-release is configured to run with sudo on destination.</log><EXEC start="12:17:31" duration="15000">
          		<CMD>[CDATA: cat /etc/redhat-release ; echo ERROR_CODE:$?]</CMD><RESULT IS_NULL="Y"/>
          		<ERROR class="com.hp.ucmdb.discovery.library.clients.protocols.command.TimeoutException">
          			<message>[CDATA: Command timed out: Exceeded timeout after 15000 milliseconds]</message><stacktrace>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommandSSH" file="SSHAgent.java" line="944"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.agents.ssh.SSHAgent" method="doExecuteCommand" file="SSHAgent.java" line="784"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient$1" method="executePrivateString" file="ShellClient.java" line="154"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.StringExecutor" method="executePrivate" file="StringExecutor.java" line="21"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.executors.Executor" method="execute" file="Executor.java" line="26"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.BaseClient" method="exec" file="BaseClient.java" line="411"/>
          				<frame class="com.hp.ucmdb.discovery.library.clients.shell.ShellClient" method="executeCmd" file="ShellClient.java" line="157"/>
          				<frame class="sun.reflect.GeneratedMethodAccessor112" method="invoke" file="unknown" line="-1"/>
          				<frame class="sun.reflect.DelegatingMethodAccessorImpl" method="invoke" file="DelegatingMethodAccessorImpl.java" line="43"/>
          				<frame class="java.lang.reflect.Method" method="invoke" file="Method.java" line="601"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="186"/>
          				<frame class="org.python.core.PyReflectedFunction" method="__call__" file="PyReflectedFunction.java" line="204"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="441"/>
          				<frame class="org.python.core.PyObject" method="__call__" file="PyObject.java" line="447"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="154"/>
          				<frame class="org.python.pycode._pyx25" method="_UnixShell__executeCommand$182" file="shellutils" line="1925"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="_execute$192" file="shellutils" line="2034"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="149"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx25" method="execCmd$87" file="shellutils" line="835"/>
          				<frame class="org.python.pycode._pyx25" method="call_function" file="shellutils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="157"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="338"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="139"/>
          				<frame class="org.python.pycode._pyx1844" method="getCommandsOutput$125" file="TTY_Connection_Utils" line="927"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="141"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="327"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="124"/>
          				<frame class="org.python.pycode._pyx1844" method="discoverOsFlavor$228" file="TTY_Connection_Utils" line="2011"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="discover$218" file="TTY_Connection_Utils" line="1949"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.core.PyMethod" method="__call__" file="PyMethod.java" line="109"/>
          				<frame class="org.python.pycode._pyx1844" method="getOSandStuff$293" file="TTY_Connection_Utils" line="2899"/>
          				<frame class="org.python.pycode._pyx1844" method="call_function" file="TTY_Connection_Utils" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="doDiscovery$13" file="HostConnectionByShell" line="458"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="301"/>
          				<frame class="org.python.core.PyFunction" method="function___call__" file="PyFunction.java" line="376"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="371"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="361"/>
          				<frame class="org.python.pycode._pyx1853" method="DiscoveryMain$2" file="HostConnectionByShell" line="210"/>
          				<frame class="org.python.pycode._pyx1853" method="call_function" file="HostConnectionByShell" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyBaseCode" method="call" file="PyBaseCode.java" line="134"/>
          				<frame class="org.python.core.PyFunction" method="__call__" file="PyFunction.java" line="317"/>
          				<frame class="org.python.pycode._pyx2073" method="f$0" file="&lt;string&gt;" line="2"/>
          				<frame class="org.python.pycode._pyx2073" method="call_function" file="&lt;string&gt;" line="-1"/>
          				<frame class="org.python.core.PyTableCode" method="call" file="PyTableCode.java" line="165"/>
          				<frame class="org.python.core.PyCode" method="call" file="PyCode.java" line="18"/>
          				<frame class="org.python.core.Py" method="runCode" file="Py.java" line="1275"/>
          				<frame class="org.python.core.Py" method="exec" file="Py.java" line="1319"/>
          				<frame class="org.python.util.PythonInterpreter" method="exec" file="PythonInterpreter.java" line="206"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="251"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="226"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScript" file="ExecutionEngineImpl.java" line="222"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="executeScripts" file="ExecutionEngineImpl.java" line="139"/>
          				<frame class="com.hp.ucmdb.discovery.library.execution.impl.ExecutionEngineImpl" method="execute" file="ExecutionEngineImpl.java" line="96"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.TablesProcessorUtil" method="processDestinationTables" file="TablesProcessorUtil.java" line="136"/>
          				<frame class="com.hp.ucmdb.discovery.probe.services.dynamic.core.DynamicService" method="discover" file="DynamicService.java" line="76"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter" method="launchTask" file="JobExecuter.java" line="1199"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="launch" file="JobExecuter.java" line="946"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="executeTask" file="JobExecuter.java" line="870"/>
          				<frame class="com.hp.ucmdb.discovery.probe.agents.probemgr.taskexecuter.JobExecuter$JobExecuterWorker" method="run" file="JobExecuter.java" line="733"/>
          			</stacktrace></ERROR></EXEC><log start="12:17:31" severity="debug">Command uname -a is configured to run with sudo on destination.</log><EXEC start="12:17:31" duration="5">
          		<CMD>[CDATA: uname -a ; echo ERROR_CODE:$?]</CMD><RESULT>[CDATA: Linux CQYV0215 2.6.16.60-0.69.1-smp #1 SMP Fri Sep 17 17:07:54 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
          ERROR_CODE:0]</RESULT></EXEC><log start="12:17:31" severity="warn">Manufacturer is VMware, assuming node is virtual machine</log><log start="12:17:32" severity="debug">locals after defining discoverer: {'langBund': java.util.PropertyResourceBundle@3aa189b0, 'discoverer': </log><log start="12:17:32" severity="debug">mac address in trigger IP is not found, will not set to discovered ip CI</log><DISCONNECT start="12:17:32" duration="1" CMD="client_disconnect" IS_NULL="Y" type="ssh" credentialsId="691_1_CMS"/>
          	<log start="12:17:32" severity="info">Execution current time:2014/05/07 12:17:32</log></execution>

          Vous allez retrouver mes différentes balises.

          Je voudrais déjà récupérer les lignes qui m’intéresse, à savoir celle log start et EXEC start. Puis, récupérer ses valeurs ( des balises) et les mettre dans un fichier .csv

          Je vous passe aussi le fichier ( de présentation pour les headers).


          Merci beaucoup

          Scratt

          • Partager sur Facebook
          • Partager sur Twitter

          Linux , le marché en zone libre

            14 mai 2014 à 19:38:23

            Clairement c'est du XML, donc tu devrais pouvoir utiliser ElementTree pour parser ton fichier de façon plus efficace. Sinon je n'ai pas encore jeté un oeil à ton code. Dès que j'ai un peu de temps j'essaierai de te faire un retour.

            • Partager sur Facebook
            • Partager sur Twitter
            Zeste de Savoir, le site qui en a dans le citron !
              14 mai 2014 à 19:45:28

              Oui, c'est ça Nohar ! Je connais ElementTree, mais je galère !!! Pour afficher le contenu des balises surtout !! Mais si non, l'ensemble de mon projet tu la compris ?

              • Partager sur Facebook
              • Partager sur Twitter

              Linux , le marché en zone libre

                14 mai 2014 à 19:52:30

                Oui, pas de problème, c'est pas un truc vraiment complexe, tu as juste à extraire des données d'un fichier .record pour le présenter dans un CSV.

                À partir de là, il me semble évident qu'il faut séparer ton code en plusieurs fonctions (parce que c'est inutile de faire des classes pour un programme aussi petit) :

                • Lecture du fichier : si le chemin est passé en argument du programme, par exemple en glissant-déposant le fichier .record sur l'exécutable, il te suffit d'utiliser la liste sys.argv. file_path = sys.argv[1]

                • Extraction des lignes d'information qui t'intéressent. Tu peux les stocker dans une ou plusieurs listes de tuples en les ayant extraites avec ElementTree : pas le temps de rentrer dans les détails, mais ça se fait plutôt bien. Je me demande si tu ne peux pas tout simplement les extraire en te servant du xpath des champs qui t'intéressent.

                • Écriture du fichier csv. Clairement, en te servant du module standard csv.

                -
                Edité par nohar 14 mai 2014 à 19:53:43

                • Partager sur Facebook
                • Partager sur Twitter
                Zeste de Savoir, le site qui en a dans le citron !
                  14 mai 2014 à 20:28:53

                  Ok, merci Nohar !! Je vais essayé. Pour la lecture du fichier, j'ai compris. Je te passe ce que j'ai fait en fonction de ta réponse.

                  ça ferait un truc comme ça ? si j'ai bien compris la logique

                  pathname = os.path.dirname(sys.argv[0])
                  localdir = os.path.join(os.path.abspath(pathname),"locale")

                  def main() :
                      if len(sys.argv) == 1 :
                          help()
                      elif len(sys.argv) >= 2:
                          if sys.argv[1] == '-h' or sys.argv[1] == '--help':
                              help()
                          elif sys.argv[1] == '-U' or sys.argv[1] == '--Extraction':
                              Extraction()
                          elif sys.argv[1] == '-C' or sys.argv[1] == '--csv':
                             csv()
                      return 0
                  
                  if __name__ == '__main__':
                  	main()
                  	
                  	
                  


                  Merci

                  • Partager sur Facebook
                  • Partager sur Twitter

                  Linux , le marché en zone libre

                    14 mai 2014 à 23:21:07

                    Bonsoir,

                    Merci pour tes explications très utile. j'ai donc ce soir, continué à travailler mon application. J'ai donc fait je pense, un gros travail. Par contre, je ne sais pas comment lier mes extractions et les mettres dans le fichier csv. J'ai essayé de mettre en dur les en têtes du fichier csv, mais je ne sais pas si c'est bon.

                    Pourrais tu regarder mon code et me corriger STP ? cela serait sympa. Sais tu aussi te servir de py2exe ? pour une fois terminé, générer un .EXE pour windows. Faudra que je me renseigne.

                    Je te passe ce que j'ai fait. J'ai pris en considération tes conseils.

                    Merci

                    Scratt

                    #!/usr/bin/env python
                    # -*- coding: utf-8 -*-
                      
                    import sys
                    import os
                    import time
                    import subprocess
                    import shlex
                    import gettext
                    from xml.dom import minidom
                    
                    ### Global variables
                    infoFile = os.path.expanduser('~/.cmdb')
                    ## Update interval (in hours)
                    updateInterval = 24
                    ## Colors
                    # BG :
                    On_Yellow='\033[43m'        # Yellow
                    On_Black='\033[40m'         # Black
                    # Normal
                    Black='\033[0;30m'          # Black
                    White='\033[0;37m'          # White
                    Red='\033[0;31m'            # Red
                    Yellow='\033[0;33m'         # Yellow
                    Purple='\033[0;35m'         # Purple
                    Cyan='\033[0;36m'           # Cyan
                    Green='\033[0;32m'          # Green
                    NoColor='\033[0m'           # Text Reset
                    
                    ### i18n
                    pathname = os.path.dirname(sys.argv[0])
                    localdir = os.path.join(os.path.abspath(pathname),
                                            "locale")
                    gettext.install("messages", localdir)
                    def help():
                        '''Print how to use cmdb parsing'''
                        print(_('''\
                    usage: {0} <votre recherche>
                        -p ou --parsing : parsing du fichier .record
                        -g ou --generation csv : generation du fichier de sortie en csv
                        -h ou --help : affiche ce message d\'aide\
                              ''').format(sys.argv[0]))
                    	sys.exit(1)
                                   
                     def colorprint(txt,nl=False,txtcolor=White,bgcolor=On_Black):
                        '''print txt in txtcolor on bgcolor'''
                        if nl:
                            print('{0}{1}{2}{3} '.format(txtcolor,bgcolor,txt,NoColor))
                        else:
                            print('{0}{1}{2}{3} '.format(txtcolor,bgcolor,txt,NoColor), sep='',end='')
                    
                    def printchoicedialog():
                    	print('---')
                    	print(_('Entrez n° (séparés par des espaces) des paquets à installer'))
                    	colorprint('==>',False,Yellow)
                    	print(_('Pour plus de résultats, taper +'))
                    	colorprint('==>',True,Yellow)	
                    	
                    def check_choice(nbchoice):
                        '''Check if the answer is correct and return it'''
                        while True:
                            try:
                                choice = input().split(' ')
                            except KeyboardInterrupt:
                                print('Okay, bye bye!')
                                sys.exit(0)
                            if choice[0] == '+':
                                colorprint(_('-> On fait une recherche plus poussée :'),True,Red)
                                return('+')
                            for i in choice:
                                if i.isdigit() :
                                    if int(i) >= 0 and int(i) <= nbchoice:
                                        return(choice)
                    				else:
                                        colorprint(_('-> Choix invalide!'),True,Red)
                                        colorprint(_('Votre sélection ne fait pas partie de la liste'),\
                                                   True,Red)
                                        colorprint('==>',False,Yellow)
                                        printchoicedialog()
                                        break
                                else:
                                    colorprint(_('-> Choix invalide!'),True,Red)
                                    colorprint(_('-> Veuillez entrer un/des nombres'),True,Red)
                                    printchoicedialog()
                                    break	
                    				
                    #parsing du fichier chargé
                    #élément log start
                     def parse_xml():
                        xmldom = minidom.parse(tool.xml_path)
                     
                        #Se rendre à l'element
                        to_list = xmldom.getElementsByTagName("log start")
                     
                        #Recuperation et affiche chaque valeur.
                        for each in to_list:
                           print each.childNodes[0].nodeValue
                     
                        #Get Attribute
                        headings_list = xmldom.getElementsByTagName("severity")
                        debug = heading_list[0].getAttribute('debug')
                        print debug
                     
                        #recuperation des elements recherches
                        headings_list = xmldom.getElementsByTagName("severity")
                        child_list = headings_list[0].getElementsByTagName("</log>")
                        print child_list[0].childNodes[0].nodeValue
                    
                    #élement EXEC start
                    
                    	
                    	
                    	
                    	
                    	
                    	
                    	
                    	
                    	
                    #génération fichier csv avec le dialect d'excel
                    def csv(): 
                    data = [ ['EXEC/ log', 'start', 'duration/ severity', 'CMD / event','RESULT' ] ]
                    
                    fd = open('cmdb_out.csv', 'wb')
                    try:
                        writer = csv.writer(fd, dialect='excel', quotechar='"', quoting=csv.QUOTE_ALL)
                        writer.writerows(data)
                    
                    finally:
                        fd.close()
                     
                     
                     def main() :
                        if len(sys.argv) == 1 :
                            help()
                        elif len(sys.argv) >= 2:
                            if sys.argv[1] == '-h' or sys.argv[1] == '--help':
                                help()
                            elif sys.argv[1] == '-p' or sys.argv[1] == '--parsing':
                                parse_xml()
                            elif sys.argv[1] == '-g' or sys.argv[1] == '--generation cvs':
                                csv()(True)
                            else : 
                                research = ''
                                for i in sys.argv[1:]:
                                    research += i
                                    research += ' '
                    	return 0
                    				
                    if __name__ == '__main__':
                    	main()



                    • Partager sur Facebook
                    • Partager sur Twitter

                    Linux , le marché en zone libre

                      14 mai 2014 à 23:56:36

                      Ok.

                      Quelques petites remarques en survolant ton code. Vraiment du détail.

                      D'abord, cette condition :

                      if int(i) >= 0 and int(i) <= nbchoice:
                      

                      Tu pourrais l'exprimer un peu plus naturellement comme ceci :

                      if 0 <= int(i) <= nbchoice:
                      

                      Ensuite, tu dis que tu comptes exécuter ce programme sous Windows. Ça va bloquer :

                      • Les accents ne sont pas supportés par l'encodage de la console Windows,
                      • Les codes de couleurs non plus.

                      Après il y a cette ligne :

                          xmldom = minidom.parse(tool.xml_path)
                      

                      Que désigne tool ? Je ne le vois défini ou importé nulle part.

                      Ensuite, c'est pas mal. Tu n'as plus qu'à récupérer les données qui t'intéressent dans une liste plutôt que de les afficher avec un print. Pour les headers, c'est pas gênant de laisser comme ça. Ça ne va pas non plus changer tous les 4 matins, et puis au moins on voit tout de suite la forme des colonnes de ton fichier csv de façon explicite, ce qui rend le programme plus facile à comprendre.

                      En ce qui concerne Py2Exe, par contre, je ne peux pas vraiment t'aider. Je ne tourne que sous Linux.

                      -
                      Edité par nohar 15 mai 2014 à 0:16:31

                      • Partager sur Facebook
                      • Partager sur Twitter
                      Zeste de Savoir, le site qui en a dans le citron !
                        15 mai 2014 à 9:48:49

                        Bonjour,

                        Merci pour ton message. OK, j'ai corrigé en fonction.

                        Oui, tu as raison, pour le xmldom. C'est une boulette de ma part. Mais, comment dois je faire pour indiquer un chemin "absolu" ?  juste xmldom = minidom.parse(...) ?

                        Comment faire pour récupérer les données et les mettre dans une liste ? Je comprends l'idée mais, je ne vois pas comment procéder.

                        Oui, le headers du csv seront toujours fixes, donc sans soucis. Une autre question, comment les mettre dans le csv avec la récupération qui m'intéresse ?

                        Je dois récupérer les éléments contenant les éléments dans log start et EXEC start ( cf mon fichier .record qui est en fait un xml ).

                        Je vais chercher pour Py2Exe.

                        Je te passe mes modifications

                        Merci d'avance

                        Scratt

                        #!/usr/bin/env python
                        # -*- coding: utf-8 -*-
                          
                        import sys
                        import os
                        import time
                        import subprocess
                        import shlex
                        import gettext
                        from xml.dom import minidom
                        
                        ### Global variables
                        infoFile = os.path.expanduser('~/.cmdb')
                        ## Update interval (in hours)
                        updateInterval = 24
                        
                        ### i18n
                        pathname = os.path.dirname(sys.argv[0])
                        localdir = os.path.join(os.path.abspath(pathname),"locale")
                        gettext.install("messages", localdir)
                        def help():
                            '''Print how to use cmdb parsing'''
                            print(_('''\usage: {0} <votre recherche>
                        		-p ou --parsing : parsing du fichier .record
                        		-g ou --generation csv : generation du fichier de sortie en csv
                        		-h ou --help : affiche ce message d\'aide\''').format(sys.argv[0]))
                        		sys.exit(1)
                                       
                        def printchoicedialog():
                        	print('---')
                        	print(_('Entrez n° (séparés par des espaces)'))
                        	print(_('Pour plus de résultats, taper +'))
                        	
                        def check_choice(nbchoice):
                        #Check if the answer is correct and return it
                        	while True:
                        		try:
                        			choice = input().split(' ')
                        			except KeyboardInterrupt:
                        				print('Okay, bye bye!')
                        				sys.exit(0)
                        				if choice[0] == '+':
                        					return('+')
                        					for i in choice:
                        						if i.isdigit() :
                        							if 0 <= int(i) <= nbchoice:
                        								return(choice)
                        								else:
                        									printchoicedialog()
                        									break
                        									else:
                        										printchoicedialog()
                        										break	
                        				
                        #parsing du fichier chargé
                        #élément log start
                        def parse_xml():
                        	xmldom = minidom.parse(xml_path)
                            #Se rendre à l'element
                        	to_list = xmldom.getElementsByTagName("log start")
                         
                            #Recuperation et affiche chaque valeur.
                        	for each in to_list:
                        		print each.childNodes[0].nodeValue
                         
                            #Get Attribute
                        	headings_list = xmldom.getElementsByTagName("severity")
                        	debug = heading_list[0].getAttribute('debug')
                        	print debug
                         
                            #recuperation des elements recherches
                        	headings_list = xmldom.getElementsByTagName("severity")
                        	child_list = headings_list[0].getElementsByTagName("</log>")
                        	print child_list[0].childNodes[0].nodeValue
                        
                        #élement EXEC start
                        
                        	
                        	
                        	
                        	
                        	
                        	
                        	
                        	
                        	
                        #génération fichier csv avec le dialect d'excel
                        def csv(): 
                        data = [ ['EXEC/ log', 'start', 'duration/ severity', 'CMD / event','RESULT' ] ]
                        	
                        fd = open('cmdb_out.csv', 'wb')
                        try:
                        	writer = csv.writer(fd, dialect='excel', quotechar='"', quoting=csv.QUOTE_ALL)
                        	writer.writerows(data)
                        
                        finally:
                        	fd.close()
                            
                        def main() :
                        	if len(sys.argv) == 1 :
                        		help()
                        	elif len(sys.argv) >= 2:
                        		if sys.argv[1] == '-h' or sys.argv[1] == '--help':
                        			help()
                        		elif sys.argv[1] == '-p' or sys.argv[1] == '--parsing':
                        			parse_xml()
                        		elif sys.argv[1] == '-g' or sys.argv[1] == '--generation cvs':
                        			csv()
                        		else : 
                        			research = ''
                        			for i in sys.argv[1:]:
                        					research += i
                        					research += ' '
                        	return 0
                        				
                        if __name__ == '__main__':
                        	main()



                        • Partager sur Facebook
                        • Partager sur Twitter

                        Linux , le marché en zone libre

                          15 mai 2014 à 12:27:10

                          re !

                          Je viens de finir mes recherches sur mon fichier .record. Pourriez vous me dire si ça va ? Maintenant, comment récupérer les résultats  de ces recherches et le mettre dans le fichier csv ? Je veux dire, mettre les résultats en dessous des bonnes colonnes correspondantes ?

                          Je pense que mon architecture de l'application est complète. Pourriez vous tester de votre côté ? J'ai fait exprès de commenter la ligne 57 et 76 car je ne sais pas pas comment mettre un chemin absolu qui pointe sur le fichier .record.

                          Comment faire ( pour l'utilisateur) pour utiliser le programme ? Il faut qu'il fasse ./.....py -p -g pour faire le parsing et enregistrer les résultats dans le csv ? Faut il qui rajouter le nom du fichier d'entrée à savoir le .record ?

                          J'ai fait une REG pour les recherches, est ce plus rapide ?

                          J'ai fait ça, est ce bon ? Si oui, ou l'intégrer et récupérer les résultats et les mettre dans le csv ?

                          REG : <log start.*?<\/log|< EXEC start.*?<\/EXEC|<EXEC start.*?\/>

                          Merci beaucoup

                          #!/usr/bin/env python
                          # -*- coding: utf-8 -*-
                            
                          import sys
                          import os
                          import time
                          import subprocess
                          import shlex
                          import gettext
                          from xml.dom import minidom
                          
                          ### Global variables
                          infoFile = os.path.expanduser('~/.cmdb')
                          ## Update interval (in hours)
                          updateInterval = 24
                          
                          ### i18n
                          pathname = os.path.dirname(sys.argv[0])
                          localdir = os.path.join(os.path.abspath(pathname),"locale")
                          gettext.install("messages", localdir)
                          
                          def help():
                          	print(_('''\usage: {0} <votre recherche>
                          		-p ou --parsing : parsing du fichier .record
                          		-g ou --generation csv : generation du fichier de sortie en csv
                          		-h ou --help : affiche ce message d\'aide\''').format(sys.argv[0]))
                          		sys.exit(1)
                                         
                          def printchoicedialog():
                          	print('---')
                          	print(_('Entrez n° (séparés par des espaces)'))
                          	print(_('Pour plus de résultats, taper +'))
                          	
                          def check_choice(nbchoice):
                          #Check if the answer is correct and return it
                          	while True:
                          		try:
                          			choice = input().split(' ')
                          			except KeyboardInterrupt:
                          				print('Okay, bye bye!')
                          				sys.exit(0)
                          				if choice[0] == '+':
                          					return('+')
                          					for i in choice:
                          						if i.isdigit() :
                          							if 0 <= int(i) <= nbchoice:
                          								return(choice)
                          								else:
                          									printchoicedialog()
                          									break
                          									else:
                          										printchoicedialog()
                          										break					
                          #parsing du fichier chargé
                          #élément log start
                          def parse_xml():
                          	#xmldom = minidom.parse(xml_path)
                              #Se rendre à l'element
                          	to_list = xmldom.getElementsByTagName("log start")
                           
                              #Recuperation et affiche chaque valeur.
                          	for each in to_list:
                          		print each.childNodes[0].nodeValue
                           
                              #Get Attribute
                          	headings_list = xmldom.getElementsByTagName("severity")
                          	debug = heading_list[0].getAttribute('debug')
                          	print debug
                           
                              #recuperation des elements recherches
                          	headings_list = xmldom.getElementsByTagName("severity")
                          	child_list = headings_list[0].getElementsByTagName("</log>")
                          	print child_list[0].childNodes[0].nodeValue
                          
                          #élement EXEC start
                          #xmldom = minidom.parse(xml_path)
                              #Se rendre à l'element
                          	to_list = xmldom.getElementsByTagName("EXEC start")
                           
                              #Recuperation et affiche chaque valeur.
                          	for each in to_list:
                          		print each.childNodes[0].nodeValue
                           
                              #Get Attribute
                          	headings_list = xmldom.getElementsByTagName("duration")
                          	RESULT = heading_list[0].getAttribute('RESULT')
                          	print RESULT
                           
                              #recuperation des elements recherches
                          	headings_list = xmldom.getElementsByTagName("CMD")
                          	child_list = headings_list[0].getElementsByTagName("/>")
                          	print child_list[0].childNodes[0].nodeValue
                          		
                          #génération fichier csv avec le dialect d'excel
                          def csv(): 
                          data = [ ['EXEC/ log', 'start', 'duration/ severity', 'CMD / event','RESULT' ] ]
                          	
                          fd = open('cmdb_out.csv', 'wb')
                          try:
                          	writer = csv.writer(fd, dialect='excel', quotechar='"', quoting=csv.QUOTE_ALL)
                          	writer.writerows(data)
                          
                          finally:
                          	fd.close()
                              
                          def main() :
                          	if len(sys.argv) == 1 :
                          		help()
                          	elif len(sys.argv) >= 2:
                          		if sys.argv[1] == '-h' or sys.argv[1] == '--help':
                          			help()
                          		elif sys.argv[1] == '-p' or sys.argv[1] == '--parsing':
                          			parse_xml()
                          		elif sys.argv[1] == '-g' or sys.argv[1] == '--generation cvs':
                          			csv()
                          		else : 
                          			research = ''
                          			for i in sys.argv[1:]:
                          					research += i
                          					research += ' '
                          	return 0
                          				
                          if __name__ == '__main__':
                          	main()



                          Scratt

                          • Partager sur Facebook
                          • Partager sur Twitter

                          Linux , le marché en zone libre

                            15 mai 2014 à 12:42:54

                            re

                            J'ai oublié de mentionné : Serait il possible par exemple que l'utilisateur ne clique que sur l'exécutable et que le programme fasse tout tout seul ? Je veux dire sans qu'il est à rentrer des arguments ?

                            Pour cela, j'imagine qu'il faut qu'il drag and drop le fichier .record sur l'exécutable. Comment je peux programmer ça ?

                            Voila ! Encore merci pour vos aides

                            Scratt

                            • Partager sur Facebook
                            • Partager sur Twitter

                            Linux , le marché en zone libre

                              16 mai 2014 à 12:54:23

                              Bonjour,

                              J'ai modifié ma fonction de parsing. Pourriez vous me dire si c'est OK ? y a t'il des erreurs de code selon vous ?

                              J'ai cree une variable pour stoker mes résultats de mon parsing, mais je ne comprends pas comment ecrire ses résultats dans mon CSV sous  les en tête qui correspondes. J'ai fait une liste, mais vide.

                              Je vous remercie d'avance

                              Scrat

                              #!/usr/bin/env python
                              # -*- coding: utf-8 -*-
                                
                              import sys
                              import os
                              import time
                              import subprocess
                              import shlex
                              import gettext
                              from xml.dom import minidom
                              
                              ###Global variables
                              infoFile = os.path.expanduser('~/.cmdb')
                              ## Update interval (in hours)
                              updateInterval = 24
                              ###liste pour stocker les resulats du parsing
                              list = []
                              ### i18n
                              pathname = os.path.dirname(sys.argv[0])
                              localdir = os.path.join(os.path.abspath(pathname),"locale")
                              gettext.install("messages", localdir)
                              
                              def help():
                              	print(_('''\usage: {0} <votre recherche>
                              		-p ou --parsing : parsing du fichier .record
                              		-g ou --generation csv : generation du fichier de sortie en csv
                              		-h ou --help : affiche ce message d\'aide\''').format(sys.argv[0]))
                              		sys.exit(1)
                                             
                              def printchoicedialog():
                              	print('---')
                              	print(_('Entrez n° (séparés par des espaces)'))
                              	print(_('Pour plus de résultats, taper +'))
                              	
                              def check_choice(nbchoice):
                              #Check if the answer is correct and return it
                              	while True:
                              		try:
                              			choice = input().split(' ')
                              			except KeyboardInterrupt:
                              				print('Okay, bye bye!')
                              				sys.exit(0)
                              				if choice[0] == '+':
                              					return('+')
                              					for i in choice:
                              						if i.isdigit() :
                              							if 0 <= int(i) <= nbchoice:
                              								return(choice)
                              								else:
                              									printchoicedialog()
                              									break
                              									else:
                              										printchoicedialog()
                              										break					
                              #parsing du fichier .record
                              def parse_xml():
                              	# Lecture des lignes des balises xml
                              	doc = minidom.parse(......)
                              	nodes = doc.getElementsByTagName('log start')
                                 for node in nodes:
                                 	print node.firstChild.nodeValue
                              	nodes = doc.getElementsByTagName('EXEC start')
                              	for node in nodes:
                              		print node.firstChild.nodeValue
                              		   	
                                 #Get Attributes pour la balise log start
                                 doc = minidom.parse(......)
                              	nodes = doc.getElementsByname('log start')
                              	for node in nodes:
                              		if node.attributes.has_key('log'):
                              			print node.attributes['log'].value
                              		if node.attributes.has_key('start'):
                              			print node.attributes['start'].value
                              		if node.attributes.has_key('severity'):
                              			print node.attributes['severity'].value
                              		if node.attributes.has_key('CMD'):
                              			print node.attributes['CMD'].value
                              			
                              	#Get Attributes pour la balise EXEC start
                              	node = doc.getElementsByname('EXEC start'):
                              		for node in nodes:
                              			if node.attributes.has_key('start'):
                              				print node.attributes.has_key('start')
                              			if node.attributes.has_key('duration')	:
                              				print node.attributes.has_key('duration')
                              			if node.attributes.has_key('CMD':)
                              				print node.attributes.has_key('CMD')
                              			if node.attributes.has_key('RESULT'):
                              				print node.attributes.has_key('RESULT')		
                              
                              #génération fichier csv avec le dialect d'excel
                              def csv(): 
                              data = [ ['EXEC/ log', 'start', 'duration/ severity', 'CMD / event','RESULT' ] ]
                              	
                              fd = open('cmdb_out.csv', 'wb')
                              try:
                              	writer = csv.writer(fd, dialect='excel', quotechar='"', quoting=csv.QUOTE_ALL)
                              	writer.writerows(data)
                              
                              finally:
                              	fd.close()
                                  
                              def main() :
                              	if len(sys.argv) == 1 :
                              		help()
                              	elif len(sys.argv) >= 2:
                              		if sys.argv[1] == '-h' or sys.argv[1] == '--help':
                              			help()
                              		elif sys.argv[1] == '-p' or sys.argv[1] == '--parsing':
                              			parse_xml()
                              		elif sys.argv[1] == '-g' or sys.argv[1] == '--generation cvs':
                              			csv()
                              		else : 
                              			research = ''
                              			for i in sys.argv[1:]:
                              					research += i
                              					research += ' '
                              	return 0
                              	
                              	if __name__ == '__main__':
                              		main()



                              • Partager sur Facebook
                              • Partager sur Twitter

                              Linux , le marché en zone libre

                                16 mai 2014 à 14:30:58

                                Ligne 93 tu crées une liste data.

                                Tu devrais simplement créer celle-ci dans le scope global du module et faire en sorte de rajouter les lignes qui vont bien (dans cette liste) en même temps que tu parses le xml.

                                • Partager sur Facebook
                                • Partager sur Twitter
                                Zeste de Savoir, le site qui en a dans le citron !
                                  16 mai 2014 à 14:33:01

                                  Merci, mais j'ai pas compris. Si est ce que mon code contient des erreurs ?
                                  • Partager sur Facebook
                                  • Partager sur Twitter

                                  Linux , le marché en zone libre

                                    19 mai 2014 à 12:50:14

                                    Bonjour tout le monde !

                                    J'ai modifié mon code ce matin avec l'idée de nohar mais, je ne parvient pas à enregistrer le résultat de mon parsing dans ma liste. J'ai corrigé les erreurs d'indentations ( enfin, je pense).

                                    Pourriez vous m'aider à faire fonctionner mon programme SVP ?

                                    Comment dois je faire pour mettre un chemin absolu pour mon fichier d'entrée .record ?

                                    Je pense que mon architecture du programme est bonne et prête.

                                    Je vous remercie par avance de vos aides

                                    Scrat

                                    Mon code modifié ci dessous :

                                    #!/usr/bin/env python
                                    # -*- coding: utf-8 -*-
                                    # Fichier smdb_beta.py  
                                    """
                                    
                                    Auteur : 
                                    Licence : GNU General Public Licence
                                    Société : 
                                    Description :
                                    	A partir d'une fichier en entrée .RECORD récupérer
                                    	les informations recherchées et les exporter dans un 
                                    	fichier csv pour son exploitation.
                                    """
                                    import sys
                                    import os
                                    import time
                                    import subprocess
                                    import shlex
                                    import gettext
                                    from xml.dom import minidom
                                    
                                    #variables globales
                                    infoFile = os.path.expanduser('~/.cmdb')
                                    #Intervales de mise à jour (en heures)
                                    updateInterval = 24
                                    #liste pour stocker les resulats du parsing
                                    list_data = [row[0],row[1], row[2], row[3], row[4]]
                                    pathname = os.path.dirname(sys.argv[0])
                                    localdir = os.path.join(os.path.abspath(pathname),"locale")
                                    gettext.install("messages", localdir)
                                    
                                    #fonctions
                                    def help():
                                    	''' Affichage de l'utilisation du programme'''
                                    	print(_('''\
                                    usage: {0} <votre recherche> 
                                    		-p ou --parsing : parsing du fichier .record
                                    		-g ou --generation csv : generation du fichier de sortie en csv
                                    		-h ou --help : affiche ce message d\'aide
                                    				\''').format(sys.argv[0]))
                                    		sys.exit(1)
                                                   
                                    def printchoicedialog():
                                    	print('---')
                                    	print('Application CMDB')
                                    	print('Version Beta')
                                    	print('Developpeur PAGADOY Jean-Philippe')
                                    	print(_('Entrez le choix voulu:)'))
                                    	
                                    def check_choice(nbchoice):
                                    #Verification de la reponse de l'utilisateur
                                    	while True:
                                    		try:
                                    			choice = input().split(' ')
                                    		except KeyboardInterrupt:
                                    			print('Okay, bye bye!')
                                    			sys.exit(0)
                                    		if choice[0] == '+':
                                    			return('+')
                                    		for i in choice:
                                    			if i.isdigit() :
                                    				if 0 <= int(i) <= nbchoice:
                                    					return(choice)
                                    				else:
                                    					printchoicedialog()
                                    					break
                                    			else:
                                    				printchoicedialog()
                                    				break					
                                    #parsing du fichier .record
                                    def parse_xml():
                                    	#doc = minidom.parse(......)
                                    	nodes = doc.getElementsByTagName('log start')
                                    	for node in nodes:
                                    		print node.firstChild.nodeValue
                                    	nodes = doc.getElementsByTagName('EXEC start')
                                    	for node in nodes:
                                    		print node.firstChild.nodeValue
                                    		   	
                                    	#Recuperatiuon des Attributes pour la balise log start
                                    	#doc = minidom.parse(......)
                                    	nodes = doc.getElementsByname('log start')
                                    	for node in nodes:
                                    		if node.attributes.has_key('log'):
                                    			#print node.attributes['log'].value
                                    			row[0]
                                    		if node.attributes.has_key('start'):
                                    			#print node.attributes['start'].value
                                    			row[1]
                                    		if node.attributes.has_key('severity'):
                                    			#print node.attributes['severity'].value
                                    			row[2]
                                    		if node.attributes.has_key('CMD'):
                                    			#print node.attributes['CMD'].value
                                    			row[3]
                                    			
                                    	#Recuperation des attributes pour la balise EXEC start
                                    	node = doc.getElementsByname('EXEC start'):
                                    	for node in nodes:
                                    		if node.attributes.has_key('start'):
                                    			#print node.attributes.has_key('start')
                                    			row[1]
                                    		if node.attributes.has_key('duration')	:
                                    			#print node.attributes.has_key('duration')
                                    			row[2]
                                    		if node.attributes.has_key('CMD':)
                                    			#print node.attributes.has_key('CMD')
                                    			row[3]
                                    		if node.attributes.has_key('RESULT'):
                                    			#print node.attributes.has_key('RESULT')		
                                    			row[4]
                                    #génération fichier csv avec le dialect d'excel
                                    def csv(): 
                                    data = [ ['EXEC/ log', 'start', 'duration/ severity', 'CMD / event','RESULT' ] ]
                                    
                                    fname = "cmdb_out.csv"	
                                    file = open('fname', 'rb')
                                    try:
                                    	reader = csv.reader(file)
                                    	writer.writerows(data)
                                    	for  row in writer:
                                    		print row[0],row[1],row[2],row[3],row[4]
                                    finally:
                                    	fd.close()
                                    
                                    def main() :
                                    	if len(sys.argv) == 1 :
                                    		help()
                                    	elif len(sys.argv) >= 2:
                                    		if sys.argv[1] == '-h' or sys.argv[1] == '--help':
                                    			help()
                                    	elif sys.argv[1] == '-p' or sys.argv[1] == '--parsing':
                                    		parse_xml()
                                    	elif sys.argv[1] == '-g' or sys.argv[1] == '--generation cvs':
                                    		csv()
                                    	else : 
                                    		research = ''
                                    		for i in sys.argv[1:]:
                                    			research += i
                                    			research += ' '
                                    	return 0
                                    	
                                    if __name__ == '__main__':
                                    	main()
                                    



                                    • Partager sur Facebook
                                    • Partager sur Twitter

                                    Linux , le marché en zone libre

                                    Aide projet Python

                                    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                                    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                                    • Editeur
                                    • Markdown