OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
azurelinuxagent
/
common
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/14/2020 08:39:36 AM
rwxr-xr-x
📄
__init__.py
630 bytes
11/07/2019 12:36:56 AM
rw-r--r--
📁
__pycache__
-
10/14/2020 08:39:36 AM
rwxr-xr-x
📄
cgroup.py
8.6 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
cgroupapi.py
25.69 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
cgroupconfigurator.py
9.27 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
cgroupstelemetry.py
7.47 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
conf.py
11.08 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
datacontract.py
2.6 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
dhcp.py
14.58 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
errorstate.py
1.12 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
event.py
19.03 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
exception.py
6.38 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
future.py
3.08 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
logger.py
7.64 KB
11/07/2019 12:36:56 AM
rw-r--r--
📁
osutil
-
10/14/2020 08:39:36 AM
rwxr-xr-x
📁
protocol
-
10/14/2020 08:39:36 AM
rwxr-xr-x
📄
rdma.py
16.13 KB
11/07/2019 12:36:56 AM
rw-r--r--
📄
telemetryevent.py
1.52 KB
11/07/2019 12:36:56 AM
rw-r--r--
📁
utils
-
10/14/2020 08:39:36 AM
rwxr-xr-x
📄
version.py
7.36 KB
11/07/2019 12:36:56 AM
rw-r--r--
Editing: errorstate.py
Close
from datetime import datetime, timedelta ERROR_STATE_DELTA_DEFAULT = timedelta(minutes=15) ERROR_STATE_DELTA_INSTALL = timedelta(minutes=5) ERROR_STATE_HOST_PLUGIN_FAILURE = timedelta(minutes=5) class ErrorState(object): def __init__(self, min_timedelta=ERROR_STATE_DELTA_DEFAULT): self.min_timedelta = min_timedelta self.count = 0 self.timestamp = None def incr(self): if self.count == 0: self.timestamp = datetime.utcnow() self.count += 1 def reset(self): self.count = 0 self.timestamp = None def is_triggered(self): if self.timestamp is None: return False delta = datetime.utcnow() - self.timestamp if delta >= self.min_timedelta: return True return False @property def fail_time(self): if self.timestamp is None: return 'unknown' delta = round((datetime.utcnow() - self.timestamp).seconds / 60.0, 2) if delta < 60: return '{0} min'.format(delta) delta_hr = round(delta / 60.0, 2) return '{0} hr'.format(delta_hr)