oops
This commit is contained in:
parent
119617b952
commit
46bc73185d
5 changed files with 104 additions and 69 deletions
|
@ -1,34 +0,0 @@
|
||||||
Date,Worker ID,IP Address,Log File,Error Type,Error Message
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/domokun,ASIC Error,Chain 2 has failed with 0 ASICs found and will power off hash board 2
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/new2.log,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426394.log,EEPROM Error,Data load fail for chain 1
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426394.log,Chip Bin Error,No chip bin for chain 0
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426394.log,Chip Bin Error,No chip bin for chain 1
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426394.log,Chip Bin Error,No chip bin for chain 2
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_6974116.log,ASIC Error,Chain 1 has failed with 0 ASICs found and will power off hash board 1
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426352.log,EEPROM Error,Data load fail for chain 1
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426352.log,EEPROM Error,Data load fail for chain 2
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/new1.log,ASIC Error,Chain 0 has failed with 96 ASICs found and will power off hash board 0
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/failures,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/failures,ASIC Error,Chain 1 has failed with 104 ASICs found and will power off hash board 1
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/new2.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_3174359.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_3174359.log,PSU,bitmain_get_power_status failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_3174359.log,PSU,power voltage can not meet the target
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_4594191.log,voltage drop,ERROR_POWER_LOST: power voltage rise or drop
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_4594191.log,black hole,reg crc error
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426394.log,Temperature Error,ERROR_TEMP_TOO_HIGH
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_7426394.log,PIC Error,_pic_write_iic failed!
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_19-00-57/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_19-00-57/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_18-53-25/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_18-53-25/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_19-07-47/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_19-07-47/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_20-51-43/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_20-51-43/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_18-01-31/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/2024-03/06/cglog_init_2024-03-06_18-01-31/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/Miner_6024072.log,voltage drop,ERROR_POWER_LOST: pic check voltage drop
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/test,voltage drop,ERROR_POWER_LOST: power voltage rise or drop
|
|
||||||
2024-05-27,mw3446,192.168.1.171,/var/log/new1.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
|
|
50
finder.py
50
finder.py
|
@ -1,9 +1,8 @@
|
||||||
import paramiko
|
import paramiko
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
import os
|
import csv
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import pandas as pd
|
|
||||||
|
|
||||||
# Load credentials from a JSON file
|
# Load credentials from a JSON file
|
||||||
def load_credentials(file_path):
|
def load_credentials(file_path):
|
||||||
|
@ -15,14 +14,6 @@ def load_error_keywords(file_path):
|
||||||
with open(file_path, 'r') as file:
|
with open(file_path, 'r') as file:
|
||||||
return json.load(file)['error_keywords']
|
return json.load(file)['error_keywords']
|
||||||
|
|
||||||
# Define paths to the configuration files
|
|
||||||
CREDENTIALS_FILE = 'credentials.json'
|
|
||||||
ERRORS_FILE = 'errors.json'
|
|
||||||
|
|
||||||
# Load credentials and error keywords
|
|
||||||
credentials = load_credentials(CREDENTIALS_FILE)
|
|
||||||
error_keywords = load_error_keywords(ERRORS_FILE)
|
|
||||||
|
|
||||||
# Regex patterns for ASIC chip errors and power-off messages
|
# Regex patterns for ASIC chip errors and power-off messages
|
||||||
asic_pattern = re.compile(r"Chain\[(\d+)\]: find (\d+) asic, times \d+")
|
asic_pattern = re.compile(r"Chain\[(\d+)\]: find (\d+) asic, times \d+")
|
||||||
power_off_pattern = re.compile(r"Chain (\d+) only find (\d+) asic, will power off hash board (\d+)")
|
power_off_pattern = re.compile(r"Chain (\d+) only find (\d+) asic, will power off hash board (\d+)")
|
||||||
|
@ -47,16 +38,8 @@ def check_logs(ip, ssh_client, worker_id, current_date):
|
||||||
for log_file in log_files:
|
for log_file in log_files:
|
||||||
log_file = log_file.strip()
|
log_file = log_file.strip()
|
||||||
print(f"Checking file: {log_file}") # Debug statement
|
print(f"Checking file: {log_file}") # Debug statement
|
||||||
# Check if file should be ignored
|
|
||||||
if log_file.endswith(('tmp', 'utmp', 'btmp', 'wtmp')):
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Check if file is a binary file
|
|
||||||
stdin, stdout, stderr = ssh_client.exec_command(f"file {log_file}")
|
|
||||||
file_type = stdout.read().decode('utf-8')
|
|
||||||
if 'text' not in file_type:
|
|
||||||
continue
|
|
||||||
|
|
||||||
|
# Read the log file content directly
|
||||||
stdin, stdout, stderr = ssh_client.exec_command(f"cat {log_file}")
|
stdin, stdout, stderr = ssh_client.exec_command(f"cat {log_file}")
|
||||||
log_content = stdout.read().decode('utf-8', errors='ignore')
|
log_content = stdout.read().decode('utf-8', errors='ignore')
|
||||||
print(f"Content of {log_file}: {log_content[:500]}") # Debug statement to show part of the log content
|
print(f"Content of {log_file}: {log_content[:500]}") # Debug statement to show part of the log content
|
||||||
|
@ -65,6 +48,7 @@ def check_logs(ip, ssh_client, worker_id, current_date):
|
||||||
seen_errors = set()
|
seen_errors = set()
|
||||||
for keyword, error_type in error_keywords.items():
|
for keyword, error_type in error_keywords.items():
|
||||||
if keyword in log_content and (log_file, error_type, keyword) not in seen_errors:
|
if keyword in log_content and (log_file, error_type, keyword) not in seen_errors:
|
||||||
|
print(f"Found keyword '{keyword}' in {log_file}") # Debug statement
|
||||||
logs.append((log_file, error_type, keyword))
|
logs.append((log_file, error_type, keyword))
|
||||||
seen_errors.add((log_file, error_type, keyword))
|
seen_errors.add((log_file, error_type, keyword))
|
||||||
|
|
||||||
|
@ -125,9 +109,6 @@ def main():
|
||||||
ips = read_ips('ips.txt')
|
ips = read_ips('ips.txt')
|
||||||
results = [] # Using a list to collect results
|
results = [] # Using a list to collect results
|
||||||
current_date = datetime.now().strftime('%Y-%m-%d')
|
current_date = datetime.now().strftime('%Y-%m-%d')
|
||||||
current_year = datetime.now().strftime('%Y')
|
|
||||||
current_month = datetime.now().strftime('%B')
|
|
||||||
current_day = datetime.now().strftime('%d')
|
|
||||||
|
|
||||||
for ip in ips:
|
for ip in ips:
|
||||||
print(f"Processing IP: {ip}")
|
print(f"Processing IP: {ip}")
|
||||||
|
@ -161,18 +142,21 @@ def main():
|
||||||
print(f"Connection failed for {ip} with {username}:{password} - {e}")
|
print(f"Connection failed for {ip} with {username}:{password} - {e}")
|
||||||
ssh_client.close()
|
ssh_client.close()
|
||||||
|
|
||||||
# Create the directory structure
|
# Write results to CSV
|
||||||
directory = os.path.join(current_year, current_month, current_day)
|
csv_file = 'results.csv'
|
||||||
if not os.path.exists(directory):
|
print(f"Writing results to {csv_file}")
|
||||||
os.makedirs(directory)
|
with open(csv_file, 'w', newline='') as file:
|
||||||
|
writer = csv.writer(file)
|
||||||
# Convert results to a DataFrame
|
writer.writerow(["Date", "Worker ID", "IP Address", "Log File", "Error Type", "Error Message"])
|
||||||
results_df = pd.DataFrame(results, columns=["Date", "Worker ID", "IP Address", "Log File", "Error Type", "Error Message"])
|
for result in results:
|
||||||
|
writer.writerow(result)
|
||||||
# Save the results to a CSV file
|
|
||||||
print("Writing results to CSV")
|
|
||||||
results_df.to_csv(os.path.join(directory, 'results.csv'), index=False)
|
|
||||||
print("Done")
|
print("Done")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
# Load credentials and error keywords
|
||||||
|
CREDENTIALS_FILE = 'credentials.json'
|
||||||
|
ERRORS_FILE = 'errors.json'
|
||||||
|
credentials = load_credentials(CREDENTIALS_FILE)
|
||||||
|
error_keywords = load_error_keywords(ERRORS_FILE)
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
21
ips.txt
21
ips.txt
|
@ -1 +1,20 @@
|
||||||
192.168.1.171
|
10.0.90.105
|
||||||
|
10.0.80.243
|
||||||
|
10.0.60.194
|
||||||
|
10.0.60.189
|
||||||
|
10.0.50.164
|
||||||
|
10.0.50.28
|
||||||
|
10.0.50.156
|
||||||
|
10.0.40.191
|
||||||
|
10.0.40.118
|
||||||
|
10.0.40.189
|
||||||
|
10.0.40.155
|
||||||
|
10.0.40.244
|
||||||
|
10.0.40.203
|
||||||
|
10.0.30.178
|
||||||
|
10.0.20.163
|
||||||
|
10.0.20.59
|
||||||
|
10.0.20.210
|
||||||
|
10.0.20.131
|
||||||
|
10.0.10.169
|
||||||
|
10.0.100.54
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Antminer error finder
|
# Antminer error finder
|
||||||
|
|
||||||
Checks for specific strings in log files of Antminer machines. Currently works with stock firmware (and barely at that). Expand to Braiins & LuxOS. This now outputs a csv file to a folder structure of `year/month/day/`.
|
Checks for specific strings in log files of Antminer machines. Currently works with stock firmware (and barely at that). Expand to Braiins & LuxOS.
|
||||||
|
|
||||||
Started using pandas for writing the csv and for grouping of errors based on machine.
|
Started using pandas for writing the csv and for grouping of errors based on machine.
|
||||||
|
|
66
results.csv
Normal file
66
results.csv
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
Date,Worker ID,IP Address,Log File,Error Type,Error Message
|
||||||
|
2024-05-28,mw9875,10.0.90.105,/var/log/miner.log,EEPROM Error,Data load fail for chain 1
|
||||||
|
2024-05-28,mw9875,10.0.90.105,/var/log/miner.log,EEPROM Error,Data load fail for chain 2
|
||||||
|
2024-05-28,mw9875,10.0.90.105,/var/log/messages,EEPROM Error,Data load fail for chain 1
|
||||||
|
2024-05-28,mw9875,10.0.90.105,/var/log/messages,EEPROM Error,Data load fail for chain 2
|
||||||
|
2024-05-28,mw8576,10.0.80.243,/var/log/miner.log,black hole,reg crc error
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner.log,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner/miner.log,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner/miner.log.0,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner/miner.log.1,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/messages,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner/miner.log.0,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/miner/miner.log.1,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw6643,10.0.60.194,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw5513,10.0.50.164,/var/log/miner.log,ASIC Error,Chain 1 has failed with 0 ASICs found and will power off hash board 1
|
||||||
|
2024-05-28,mw5513,10.0.50.164,/var/log/messages,ASIC Error,Chain 1 has failed with 0 ASICs found and will power off hash board 1
|
||||||
|
2024-05-28,mw5513,10.0.50.164,/var/log/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw5513,10.0.50.164,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw5423,10.0.50.28,/var/log/miner.log,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw5423,10.0.50.28,/var/log/messages,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw5383,10.0.50.156,/var/log/miner.log,black hole,reg crc error
|
||||||
|
2024-05-28,mw5383,10.0.50.156,/var/log/messages,black hole,reg crc error
|
||||||
|
2024-05-28,mw4184,10.0.40.244,/var/log/miner.log,ASIC Error,Chain 0 has failed with 96 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw4184,10.0.40.244,/var/log/messages,ASIC Error,Chain 0 has failed with 96 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw4184,10.0.40.244,/var/log/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw4184,10.0.40.244,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw4122,10.0.40.203,/var/log/miner.log,ASIC Error,Chain 2 has failed with 0 ASICs found and will power off hash board 2
|
||||||
|
2024-05-28,mw4122,10.0.40.203,/var/log/messages,ASIC Error,Chain 2 has failed with 0 ASICs found and will power off hash board 2
|
||||||
|
2024-05-28,mw4122,10.0.40.203,/var/log/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw4122,10.0.40.203,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw3514,10.0.30.178,/var/log/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw3514,10.0.30.178,/var/log/miner.log,PSU,bitmain_get_power_status failed
|
||||||
|
2024-05-28,mw3514,10.0.30.178,/var/log/miner.log,PSU,power voltage can not meet the target
|
||||||
|
2024-05-28,mw3514,10.0.30.178,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw3514,10.0.30.178,/var/log/messages,PSU,bitmain_get_power_status failed
|
||||||
|
2024-05-28,mw3514,10.0.30.178,/var/log/messages,PSU,power voltage can not meet the target
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,ASIC Error,Chain 1 has failed with 0 ASICs found and will power off hash board 1
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,ASIC Error,Chain 2 has failed with 0 ASICs found and will power off hash board 2
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,EEPROM Error,Data load fail for chain 1
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,Chip Bin Error,No chip bin for chain 0
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,Chip Bin Error,No chip bin for chain 1
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,Chip Bin Error,No chip bin for chain 2
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,Temperature Error,ERROR_TEMP_TOO_HIGH
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,PIC Error,_pic_write_iic failed!
|
||||||
|
2024-05-28,mw2564,10.0.20.163,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw2481,10.0.20.59,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw2184,10.0.20.210,/var/log/messages,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,ASIC Error,Chain 0 has failed with 0 ASICs found and will power off hash board 0
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,ASIC Error,Chain 1 has failed with 0 ASICs found and will power off hash board 1
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,ASIC Error,Chain 2 has failed with 0 ASICs found and will power off hash board 2
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,EEPROM Error,Data load fail for chain 0
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,Chip Bin Error,No chip bin for chain 0
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,Chip Bin Error,No chip bin for chain 1
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,Chip Bin Error,No chip bin for chain 2
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,Temperature Error,ERROR_TEMP_TOO_HIGH
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,PIC Error,_pic_write_iic failed!
|
||||||
|
2024-05-28,mw2144,10.0.20.131,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw1132,10.0.10.169,/var/log/miner.log,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mw1132,10.0.10.169,/var/log/messages,SoC failure,ERROR_SOC_INIT: soc init failed
|
||||||
|
2024-05-28,mwxxx2,10.0.100.54,/var/log/miner.log,ASIC Error,Chain 1 has failed with 0 ASICs found and will power off hash board 1
|
||||||
|
2024-05-28,mwxxx2,10.0.100.54,/var/log/miner.log,ASIC Error,Chain 2 has failed with 0 ASICs found and will power off hash board 2
|
||||||
|
2024-05-28,mwxxx2,10.0.100.54,/var/log/messages,ASIC Error,Chain 1 has failed with 0 ASICs found and will power off hash board 1
|
||||||
|
2024-05-28,mwxxx2,10.0.100.54,/var/log/messages,ASIC Error,Chain 2 has failed with 0 ASICs found and will power off hash board 2
|
|
Loading…
Reference in a new issue