mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-03 20:27:54 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			734 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			734 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import paramiko
 | 
						|
from scp import SCPClient
 | 
						|
 | 
						|
 | 
						|
class lanforge_reports:
 | 
						|
 | 
						|
    @staticmethod
 | 
						|
    def pull_reports(hostname="localhost", port=22, username="lanforge", password="lanforge",
 | 
						|
                     report_location="/home/lanforge/html-reports/",
 | 
						|
                     report_dir="../../../reports/"):
 | 
						|
        ssh = paramiko.SSHClient()
 | 
						|
        ssh.load_system_host_keys()
 | 
						|
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
 | 
						|
        ssh.connect(hostname=hostname, username=username, password=password, port=port, allow_agent=False, look_for_keys=False)
 | 
						|
 | 
						|
        with SCPClient(ssh.get_transport()) as scp:
 | 
						|
            scp.get(remote_path=report_location, local_path=report_dir, recursive=True)
 | 
						|
            scp.close()
 |