mirror of https://github.com/nicolargo/glances.git
Correct timestamp on alert for terminal mode
This commit is contained in:
parent
af49f970e3
commit
dbbdc34bf0
|
|
@ -1,3 +1,3 @@
|
|||
FROM nicolargo/glances:latest as glancesminimal
|
||||
FROM glances:local-alpine-minimal as glancesminimal
|
||||
COPY glances.conf /glances/conf/glances.conf
|
||||
CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -10,6 +10,8 @@
|
|||
"""Alert plugin."""
|
||||
|
||||
from datetime import datetime
|
||||
from time import tzname
|
||||
import pytz
|
||||
|
||||
from glances.logger import logger
|
||||
from glances.events import glances_events
|
||||
|
|
@ -211,8 +213,8 @@ class PluginModel(GlancesPluginModel):
|
|||
# New line
|
||||
ret.append(self.curse_new_line())
|
||||
# Start
|
||||
# TODO: Related to #2591, manege TZ in order to make it work inside containers
|
||||
msg = str(datetime.fromtimestamp(alert[0]))
|
||||
msg = str(datetime.fromtimestamp(alert[0],
|
||||
tz=pytz.timezone(tzname[0] if tzname[0] else 'UTC')))
|
||||
ret.append(self.curse_add_line(msg))
|
||||
# Duration
|
||||
if alert[1] > 0:
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ packaging
|
|||
ujson<4; python_version >= "3.5" and python_version < "3.6"
|
||||
ujson<5; python_version >= "3.6" and python_version < "3.7"
|
||||
ujson>=5.4.0; python_version >= "3.7"
|
||||
pytz
|
||||
|
|
|
|||
Loading…
Reference in New Issue