Compare commits
No commits in common. "78b7ea714611878759ef55eeefab143ce39dc45b" and "f24181ff7912c0baa7874c2bddbf71afb3b02010" have entirely different histories.
78b7ea7146
...
f24181ff79
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,8 +1,9 @@
|
|||||||
.idea
|
.idea
|
||||||
.venv
|
.venv
|
||||||
/data/
|
/data/
|
||||||
/configs/config.*
|
/configs/config.json
|
||||||
/configs/metrics.*
|
/configs/config.yaml
|
||||||
/configs/metrics_win.*
|
/configs/metrics.json
|
||||||
|
/configs/metrics_win.json
|
||||||
/__pycache__/
|
/__pycache__/
|
||||||
/metrics/__pycache__/
|
/metrics/__pycache__/
|
||||||
@ -35,7 +35,7 @@ def read_prop(filepath, sep='=', comment_char='#'):
|
|||||||
conf[key] = value
|
conf[key] = value
|
||||||
return conf
|
return conf
|
||||||
|
|
||||||
def read_yaml(name):
|
def read_yaml(name): #ToDo: need to be tested!
|
||||||
conf = {}
|
conf = {}
|
||||||
with open(name, 'r') as f:
|
with open(name, 'r') as f:
|
||||||
y_conf = yaml.safe_load(f)
|
y_conf = yaml.safe_load(f)
|
||||||
|
|||||||
@ -4,7 +4,6 @@ from abc import abstractmethod
|
|||||||
import time
|
import time
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
from linecache import cache
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import psutil
|
import psutil
|
||||||
@ -114,13 +113,8 @@ def get_shell_value(command, args, callback=None):
|
|||||||
def is_ping(ip, count, callback=None):
|
def is_ping(ip, count, callback=None):
|
||||||
param = '-n' if platform.system().lower() == 'windows' else '-c'
|
param = '-n' if platform.system().lower() == 'windows' else '-c'
|
||||||
command = ['ping', param, str(count), ip]
|
command = ['ping', param, str(count), ip]
|
||||||
try:
|
output = subprocess.check_output(command)
|
||||||
output = subprocess.check_output(command)
|
result = 'unreachable' not in str(output) and 'could not find' not in str(output) and 'time out' not in str(output)
|
||||||
result = ('unreachable'.upper() not in str(output).upper() and
|
|
||||||
'could not find'.upper() not in str(output).upper() and
|
|
||||||
'time out'.upper() not in str(output).upper())
|
|
||||||
except:
|
|
||||||
result = False
|
|
||||||
if callback is not None:
|
if callback is not None:
|
||||||
callback(result)
|
callback(result)
|
||||||
else:
|
else:
|
||||||
|
|||||||
BIN
metrics/__pycache__/DataStructures.cpython-312.pyc
Normal file
BIN
metrics/__pycache__/DataStructures.cpython-312.pyc
Normal file
Binary file not shown.
BIN
metrics/__pycache__/MetricClasses.cpython-312.pyc
Normal file
BIN
metrics/__pycache__/MetricClasses.cpython-312.pyc
Normal file
Binary file not shown.
BIN
metrics/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
metrics/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user