Skip to content

Latest commit

 

History

History
167 lines (139 loc) · 7.24 KB

comware_log_module.rst

File metadata and controls

167 lines (139 loc) · 7.24 KB

comware_log

Added in version 1.8

get the device diagnostic information and upload to file server

parameter required default choices comments
service_dir no the dir in server which you want to upload the diag file from device
flash no 'flash:/'
ftpupload no true
  • true
  • false
whether upload the diagnostic information to the service.
servertype no
  • ftp
  • scp
choose the diagnostic file upload server type.
server_hostname no the remote server hostname e.g.192.168.1.199.
server_name no the name to login in remote server.
server_pwd no the password to login in remote server.
dst_dir no remote dir where the file save.
state no
  • present
  • default
  • loadtoserver
The state of operation
hostname yes IP Address or hostname of the Comware v7 device that has NETCONF enabled
username yes Username used to login to the switch
password yes Password used to login to the switch
port no 830 The Comware port used to connect to the switch
look_for_keys no False Whether searching for discoverable private key files in ~/.ssh/


# e.g.ensure the dir exsits
      - name: get diagnostic information to the file server
        comware_log:  diag_dir=flash:/diaglog service_dir=/root/ansible-hpe-cw7-master/diaglog/ ftpupload=true
        username={{ username }} password={{ password }} hostname={{ inventory_hostname }}

      - name: delete diagnostic information in device
        comware_log:  state=loadtoserver servertype=ftp server_hostname=192.168.1.199 server_name=fc server_pwd=111111
        diag_dir=flash:/diaglog service_dir=/root/ansible-hpe-cw7-master/diaglog/ dst_dir=
        username={{ username }} password={{ password }} hostname={{ inventory_hostname }}

      # - name: delete diagnostic information in device
        # comware_log:  state=loadtoserver servertype=scp server_hostname=192.168.1.185 server_name=h3c server_pwd=h3c
        diag_dir=flash:/diaglog service_dir=/root/ansible-hpe-cw7-master/diaglog/ dst_dir=flash:/
        username={{ username }} password={{ password }} hostname={{ inventory_hostname }}

      - name: delete diagnostic information in device
        comware_log:  diag_dir=flash:/diaglog state=default username={{ username }} password={{ password }} hostname={{ inventory_hostname }}

Note

Getting device diagnostic information will take some time , here give 300s to get the information,if result goes to time out , check the timeout 300s first.if state is present , you will get the diag file with .tar.gz , and it will upload to ansibleserver.-