mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-04 22:17:24 +00:00
add data['timestamp'] #72
to make sure, that all Plugins use the same timestamp
This commit is contained in:
parent
28936d68ec
commit
e7b5bffdd3
8 changed files with 38 additions and 17 deletions
|
|
@ -84,13 +84,13 @@ def run(typ,freq,data):
|
|||
logging.debug("Insert %s", typ)
|
||||
|
||||
if typ == "FMS":
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableFMS")+" (time, fms, status, direction, directionText, tsi, description) VALUES (NOW(),%s,%s,%s,%s,%s,%s)", (data["fms"], data["status"], data["direction"], data["directionText"], data["tsi"], data["description"]))
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableFMS")+" (time, fms, status, direction, directionText, tsi, description) VALUES (FROM_UNIXTIME(%s),%s,%s,%s,%s,%s,%s)", (data["timestamp"], data["fms"], data["status"], data["direction"], data["directionText"], data["tsi"], data["description"]))
|
||||
|
||||
elif typ == "ZVEI":
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time, zvei, description) VALUES (NOW(),%s,%s)", (data["zvei"], data["description"]))
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time, zvei, description) VALUES (FROM_UNIXTIME(%s),%s,%s)", (data["timestamp"], data["zvei"], data["description"]))
|
||||
|
||||
elif typ == "POC":
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tablePOC")+" (time, ric, function, functionChar, msg, bitrate, description) VALUES (NOW(),%s,%s,%s,%s,%s,%s)", (data["ric"], data["function"], data["functionChar"], data["msg"], data["bitrate"], data["description"]))
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tablePOC")+" (time, ric, function, functionChar, msg, bitrate, description) VALUES (FROM_UNIXTIME(%s),%s,%s,%s,%s,%s,%s)", (data["timestamp"], data["ric"], data["function"], data["functionChar"], data["msg"], data["bitrate"], data["description"]))
|
||||
|
||||
else:
|
||||
logging.warning("Invalid Typ: %s", typ)
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ In the data map are the folowing informations:
|
|||
**ZVEI:**
|
||||
- zvei
|
||||
- description
|
||||
- timestamp
|
||||
|
||||
**FMS:**
|
||||
- fms
|
||||
|
|
@ -181,6 +182,7 @@ In the data map are the folowing informations:
|
|||
- directionText
|
||||
- tsi
|
||||
- description
|
||||
- timestamp
|
||||
|
||||
**POCSAG:**
|
||||
- ric
|
||||
|
|
@ -189,3 +191,4 @@ In the data map are the folowing informations:
|
|||
- msg
|
||||
- bitrate
|
||||
- description
|
||||
- timestamp
|
||||
|
|
@ -11,7 +11,6 @@ eMail-Plugin to dispatch FMS-, ZVEI- and POCSAG - messages via eMail/SMTP
|
|||
|
||||
import logging # Global logger
|
||||
|
||||
import time
|
||||
import smtplib #for the SMTP client
|
||||
from email.mime.text import MIMEText # Import the email modules we'll need
|
||||
from email.utils import formatdate # need for confirm to RFC2822 standard
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ from urlparse import urlparse #for split the URL into url and path
|
|||
|
||||
from includes import globals # Global variables
|
||||
|
||||
from includes.helper import timeHandler
|
||||
from includes.helper import wildcardHandler
|
||||
from includes.helper import configHandler
|
||||
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ def run(typ,freq,data):
|
|||
# build event and msg
|
||||
# pyNMA expect strings are not in UTF-8
|
||||
event = stringConverter.convertToUnicode(data['description'])
|
||||
msg = timeHandler.curtime()
|
||||
msg = timeHandler.getDateTime(data['timestamp'])
|
||||
if ("POC" in typ) and (len(data['msg']) > 0):
|
||||
msg += "\n" + data['msg']
|
||||
msg = stringConverter.convertToUnicode(msg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue