Skip to content
This repository has been archived by the owner on Jul 13, 2019. It is now read-only.

Commit

Permalink
Merge pull request #25 from geertw/develop
Browse files Browse the repository at this point in the history
Release 1.4.3
  • Loading branch information
geertw authored Jul 21, 2016
2 parents 9d85164 + 2cec75e commit a8cc995
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.4.3

* Detectie op DVS-berichten die minder dan 70 minuten voor vertrek worden ontvangen
* Vertalingen bijgewerkt

## 1.4.2

* Vertalingen bijgewerkt
Expand Down
8 changes: 8 additions & 0 deletions contrib/munin/rdt-dvs_berichten_fail
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ berichten_dubbel.info Aantal dubbele berichten
berichten_dubbel.type DERIVE
berichten_dubbel.min 0
berichten_dubbel.colour 9300aa
berichten_laat.colour aa1300
berichten_laat.label te laat
berichten_laat.info Aantal te late berichten
berichten_laat.type DERIVE
berichten_laat.min 0
berichten_laat.colour ff8000
EOM
exit 0;;
Expand All @@ -29,3 +35,5 @@ printf "berichten_ouder.value "
/opt/rdt/infoplus-dvs/dvs-dump.py count/ouder -q
printf "berichten_dubbel.value "
/opt/rdt/infoplus-dvs/dvs-dump.py count/dubbel -q
printf "berichten_laat.value "
/opt/rdt/infoplus-dvs/dvs-dump.py count/laat -q
13 changes: 12 additions & 1 deletion dvs-daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def main():
counters['msg'] = 0
counters['dubbel'] = 0
counters['ouder'] = 0
counters['laat'] = 0
counters['gc_station'] = 0
counters['gc_trein'] = 0
counters['injecties'] = 0
Expand Down Expand Up @@ -315,6 +316,15 @@ def run(self):
# Trein kwam op dit station nog niet voor, voeg toe:
station_store[rit_station_code][trein.treinnr] = trein

if system_status['status'] == 'UP':
# Check op timestamp bericht:
# Tel als te laat indien vertrek < 70 minuten vanaf nu
verschil_vertrektijd = trein.vertrek - datetime.now(pytz.utc)
if verschil_vertrektijd.total_seconds() < 69*60:
counters['laat'] += 1
self.logger.warn('Trein %s/%s: te laat ontvangen: vertrek over %d minuten',
trein.treinnr, trein.rit_station.code, float(verschil_vertrektijd.total_seconds()) / 60)

# Update of insert trein aan trein store:
if rit_station_code in trein_store[trein.treinnr]:
# Trein komt reeds voor in trein store voor dit treinnr
Expand Down Expand Up @@ -531,7 +541,8 @@ def run(self):
system_status['status'] = 'DOWN'
if system_status['down_since'] == None:
# Downtime start nu
system_status['down_since'] = datetime.now()
system_status['down_since'] = datetime.utcnow()

system_status['recovering_since'] = None

else:
Expand Down
1 change: 1 addition & 0 deletions infoplus_dvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ def oorzaak_engels(self):
'door een seinstoring': 'signal failure',
'door een sein- en wisselstoring': 'signalling and points failure',
'door een sein-en wisselstoring': 'signalling and points failure',
'door een grote sein- en wisselstoring': 'a large signalling failure',
'door een storing aan bediensysteem seinen en wissels': 'a control system failure',
'door een storing in de bediening van seinen': 'a control system failure',
'door defect materieel': 'a broken down train',
Expand Down

0 comments on commit a8cc995

Please sign in to comment.