From a69764e45d08f7cf6de9860c145a7554025ba9c3 Mon Sep 17 00:00:00 2001
From: Tristan Smith <tristan@monotreme.org>
Date: Wed, 5 Feb 2025 22:02:39 -0500
Subject: [PATCH] looking for specifics

---
 errors.json  |  13 +-
 errors2.json |  12 ++
 finder.py    |  13 +-
 ips.txt      | 381 ++++++++++++++++++++++++++++++++++++++++++++++++---
 results.csv  |  66 ---------
 5 files changed, 387 insertions(+), 98 deletions(-)
 create mode 100644 errors2.json
 delete mode 100644 results.csv

diff --git a/errors.json b/errors.json
index 1b4813b..638283f 100644
--- a/errors.json
+++ b/errors.json
@@ -1,16 +1,5 @@
 {
     "error_keywords": {
-        "ERROR_TEMP_TOO_HIGH": "Temperature Error",
-        "ERROR_NETWORK_DISCONNECTED": "probably doesn't exist",
-        "ERROR_POWER_LOST: power voltage rise or drop": "voltage drop",
-        "_pic_write_iic failed!": "PIC Error",
-        "PLL read exceeded wait time": "PLL Error",
-        "ERROR_SOC_INIT: soc init failed": "SoC failure",
-        "fail to read 0:1": "eeprom",
-        "fail to write 0:1": "eeprom",
-        "bitmain_get_power_status failed": "PSU",
-        "power voltage can not meet the target": "PSU",
-        "reg crc error": "black hole",
-        "ERROR_POWER_LOST: pic check voltage drop": "voltage drop"
+        "BLOCK ACCEPTED": "Block found"
     }
 }
diff --git a/errors2.json b/errors2.json
new file mode 100644
index 0000000..c8c9c52
--- /dev/null
+++ b/errors2.json
@@ -0,0 +1,12 @@
+        // "ERROR_TEMP_TOO_HIGH": "Temperature Error",
+        // "ERROR_NETWORK_DISCONNECTED": "probably doesn't exist",
+        // "ERROR_POWER_LOST: power voltage rise or drop": "voltage drop",
+        // "_pic_write_iic failed!": "PIC Error",
+        // "PLL read exceeded wait time": "PLL Error",
+        // "ERROR_SOC_INIT: soc init failed": "SoC failure",
+        // "fail to read 0:1": "eeprom",
+        // "fail to write 0:1": "eeprom",
+        // "bitmain_get_power_status failed": "PSU",
+        // "power voltage can not meet the target": "PSU",
+        // "reg crc error": "black hole",
+        // "ERROR_POWER_LOST: pic check voltage drop": "voltage drop",
\ No newline at end of file
diff --git a/finder.py b/finder.py
index 5464f73..aa89433 100644
--- a/finder.py
+++ b/finder.py
@@ -33,11 +33,22 @@ def check_logs(ip, ssh_client, worker_id, current_date):
     results = []  # Using list to avoid duplicate entries
     try:
         print(f"Checking logs on {ip}")
-        stdin, stdout, stderr = ssh_client.exec_command("find /var/log/ -type f")
+        stdin, stdout, stderr = ssh_client.exec_command("find /nvdata/2025/01/29/ -type f")
         log_files = stdout.readlines()
         for log_file in log_files:
             log_file = log_file.strip()
             print(f"Checking file: {log_file}")  # Debug statement
+
+            # directory?
+            if is_directory:
+                for nested_file in nested_files:
+                    stdin, stdout, stderr = ssh_client.exec_command(f"cat '{nested_file_path}'")
+                    log_content = stdout.read().decode('utf-8', errors='ignore')
+                    print(f"Content of {nested_file_path}: {log_content[:500]}")
+            else:
+                stdin, stdout, stderr = ssh_client.exec_command(f"cat '{log_file}'")
+                log_content = stdout.read().decode('utf-8', errors='ignore')
+                print(f"Content of {log_file}: {log_content[:500]}")                    
             
             # Read the log file content directly
             stdin, stdout, stderr = ssh_client.exec_command(f"cat {log_file}")
diff --git a/ips.txt b/ips.txt
index 7a959db..053241d 100644
--- a/ips.txt
+++ b/ips.txt
@@ -1,20 +1,363 @@
-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.19
+10.0.10.24
+10.0.10.27
+10.0.10.35
+10.0.10.42
+10.0.10.46
+10.0.10.50
+10.0.10.57
+10.0.10.70
+10.0.10.71
+10.0.10.77
+10.0.10.81
+10.0.10.85
+10.0.10.94
+10.0.10.108
+10.0.10.112
+10.0.10.119
+10.0.10.135
+10.0.10.146
 10.0.10.169
-10.0.100.54
+10.0.10.176
+10.0.10.177
+10.0.10.178
+10.0.10.185
+10.0.10.197
+10.0.10.198
+10.0.10.203
+10.0.10.204
+10.0.10.205
+10.0.10.212
+10.0.10.214
+10.0.10.235
+10.0.10.240
+10.0.11.13
+10.0.11.40
+10.0.11.47
+10.0.11.165
+10.0.11.192
+10.0.11.208
+10.0.11.221
+10.0.20.8
+10.0.20.10
+10.0.20.12
+10.0.20.14
+10.0.20.21
+10.0.20.24
+10.0.20.26
+10.0.20.34
+10.0.20.35
+10.0.20.36
+10.0.20.37
+10.0.20.38
+10.0.20.43
+10.0.20.48
+10.0.20.50
+10.0.20.52
+10.0.20.58
+10.0.20.60
+10.0.20.61
+10.0.20.68
+10.0.20.71
+10.0.20.75
+10.0.20.76
+10.0.20.81
+10.0.20.83
+10.0.20.84
+10.0.20.89
+10.0.20.90
+10.0.20.92
+10.0.20.105
+10.0.20.106
+10.0.20.107
+10.0.20.113
+10.0.20.114
+10.0.20.119
+10.0.20.120
+10.0.20.134
+10.0.20.135
+10.0.20.137
+10.0.20.141
+10.0.20.149
+10.0.20.151
+10.0.20.153
+10.0.20.155
+10.0.20.165
+10.0.20.168
+10.0.20.170
+10.0.20.174
+10.0.20.175
+10.0.20.177
+10.0.20.189
+10.0.20.190
+10.0.20.194
+10.0.20.196
+10.0.20.198
+10.0.20.202
+10.0.20.203
+10.0.20.206
+10.0.20.216
+10.0.20.219
+10.0.20.232
+10.0.20.233
+10.0.20.241
+10.0.20.244
+10.0.20.245
+10.0.20.246
+10.0.20.247
+10.0.30.9
+10.0.30.10
+10.0.30.15
+10.0.30.19
+10.0.30.22
+10.0.30.25
+10.0.30.35
+10.0.30.36
+10.0.30.37
+10.0.30.42
+10.0.30.49
+10.0.30.50
+10.0.30.55
+10.0.30.56
+10.0.30.57
+10.0.30.61
+10.0.30.69
+10.0.30.78
+10.0.30.85
+10.0.30.94
+10.0.30.98
+10.0.30.100
+10.0.30.101
+10.0.30.102
+10.0.30.108
+10.0.30.122
+10.0.30.132
+10.0.30.137
+10.0.30.138
+10.0.30.142
+10.0.30.149
+10.0.30.152
+10.0.30.153
+10.0.30.160
+10.0.30.164
+10.0.30.167
+10.0.30.168
+10.0.30.169
+10.0.30.176
+10.0.30.182
+10.0.30.183
+10.0.30.184
+10.0.30.188
+10.0.30.197
+10.0.30.198
+10.0.30.207
+10.0.30.208
+10.0.30.213
+10.0.30.217
+10.0.30.218
+10.0.30.219
+10.0.30.227
+10.0.30.229
+10.0.30.239
+10.0.30.245
+10.0.40.12
+10.0.40.14
+10.0.40.21
+10.0.40.68
+10.0.40.106
+10.0.40.113
+10.0.40.119
+10.0.40.139
+10.0.40.148
+10.0.40.186
+10.0.40.196
+10.0.40.203
+10.0.40.212
+10.0.40.230
+10.0.40.233
+10.0.50.16
+10.0.50.18
+10.0.50.19
+10.0.50.22
+10.0.50.23
+10.0.50.24
+10.0.50.27
+10.0.50.30
+10.0.50.31
+10.0.50.34
+10.0.50.37
+10.0.50.39
+10.0.50.42
+10.0.50.43
+10.0.50.45
+10.0.50.49
+10.0.50.54
+10.0.50.73
+10.0.50.74
+10.0.50.78
+10.0.50.82
+10.0.50.86
+10.0.50.88
+10.0.50.90
+10.0.50.93
+10.0.50.96
+10.0.50.99
+10.0.50.100
+10.0.50.102
+10.0.50.105
+10.0.50.107
+10.0.50.108
+10.0.50.109
+10.0.50.115
+10.0.50.116
+10.0.50.117
+10.0.50.123
+10.0.50.125
+10.0.50.126
+10.0.50.127
+10.0.50.129
+10.0.50.131
+10.0.50.138
+10.0.50.139
+10.0.50.141
+10.0.50.143
+10.0.50.147
+10.0.50.152
+10.0.50.155
+10.0.50.156
+10.0.50.157
+10.0.50.158
+10.0.50.160
+10.0.50.161
+10.0.50.168
+10.0.50.169
+10.0.50.170
+10.0.50.171
+10.0.50.172
+10.0.50.180
+10.0.50.181
+10.0.50.197
+10.0.50.198
+10.0.50.200
+10.0.50.201
+10.0.50.205
+10.0.50.211
+10.0.50.212
+10.0.50.213
+10.0.50.215
+10.0.50.220
+10.0.50.221
+10.0.50.223
+10.0.50.226
+10.0.50.227
+10.0.50.229
+10.0.50.232
+10.0.50.234
+10.0.50.235
+10.0.50.238
+10.0.50.239
+10.0.50.240
+10.0.50.242
+10.0.50.243
+10.0.50.244
+10.0.50.249
+10.0.50.253
+10.0.60.14
+10.0.60.57
+10.0.60.87
+10.0.60.94
+10.0.60.167
+10.0.60.185
+10.0.60.196
+10.0.60.210
+10.0.60.214
+10.0.60.223
+10.0.70.97
+10.0.70.134
+10.0.70.147
+10.0.70.175
+10.0.70.189
+10.0.70.194
+10.0.70.198
+10.0.80.20
+10.0.80.25
+10.0.80.59
+10.0.80.63
+10.0.80.64
+10.0.80.65
+10.0.80.66
+10.0.80.69
+10.0.80.99
+10.0.80.111
+10.0.80.134
+10.0.80.146
+10.0.80.150
+10.0.80.155
+10.0.80.165
+10.0.80.192
+10.0.80.196
+10.0.80.226
+10.0.80.228
+10.0.80.231
+10.0.90.39
+10.0.90.40
+10.0.90.44
+10.0.90.48
+10.0.90.58
+10.0.90.63
+10.0.90.64
+10.0.90.83
+10.0.90.88
+10.0.90.104
+10.0.90.111
+10.0.90.126
+10.0.90.128
+10.0.90.155
+10.0.90.159
+10.0.90.163
+10.0.90.171
+10.0.90.190
+10.0.90.191
+10.0.90.192
+10.0.90.201
+10.0.90.218
+10.0.90.222
+10.0.90.224
+10.0.90.249
+10.0.90.251
+10.0.91.63
+10.0.91.192
+10.0.91.202
+10.0.100.12
+10.0.100.25
+10.0.100.37
+10.0.100.42
+10.0.100.56
+10.0.100.73
+10.0.100.84
+10.0.100.97
+10.0.100.105
+10.0.100.108
+10.0.100.111
+10.0.100.115
+10.0.100.117
+10.0.100.118
+10.0.100.119
+10.0.100.124
+10.0.100.138
+10.0.100.139
+10.0.100.142
+10.0.100.148
+10.0.100.149
+10.0.100.152
+10.0.100.154
+10.0.100.160
+10.0.100.162
+10.0.100.164
+10.0.100.170
+10.0.100.172
+10.0.100.175
+10.0.100.176
+10.0.100.181
+10.0.100.183
+10.0.100.184
\ No newline at end of file
diff --git a/results.csv b/results.csv
deleted file mode 100644
index 5eda4bd..0000000
--- a/results.csv
+++ /dev/null
@@ -1,66 +0,0 @@
-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