diff --git a/plugins/BosMon/BosMon.py b/plugins/BosMon/BosMon.py index 9b9aed6..971fcb3 100644 --- a/plugins/BosMon/BosMon.py +++ b/plugins/BosMon/BosMon.py @@ -19,6 +19,29 @@ import base64 #for the HTTP request with User/Password from includes import globals # Global variables +## +# +# onLoad function of plugin +# will be called by the pluginLoader +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine are called + + @requires: nothing + + @return: nothing + """ + try: + ########## User onLoad CODE ########## + + ########## User onLoad CODE ########## + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) + ## # # do BosMon-Request diff --git a/plugins/MySQL/MySQL.py b/plugins/MySQL/MySQL.py index 2ef31a6..34b95e5 100644 --- a/plugins/MySQL/MySQL.py +++ b/plugins/MySQL/MySQL.py @@ -18,6 +18,28 @@ import mysql.connector from includes import globals # Global variables +## +# +# onLoad function of plugin +# will be called by the pluginLoader +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine are called + + @requires: nothing + + @return: nothing + """ + try: + ########## User onLoad CODE ########## + + ########## User onLoad CODE ########## + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) ## # diff --git a/plugins/eMail/eMail.py b/plugins/eMail/eMail.py index f879431..11a38dc 100644 --- a/plugins/eMail/eMail.py +++ b/plugins/eMail/eMail.py @@ -19,6 +19,29 @@ from email.utils import make_msgid # need for confirm to RFC2822 standard from includes import globals # Global variables +## +# +# onLoad function of plugin +# will be called by the pluginLoader +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine are called + + @requires: nothing + + @return: nothing + """ + try: + ########## User onLoad CODE ########## + + ########## User onLoad CODE ########## + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) + ## # # Private helper function for a printable Timestamp diff --git a/plugins/firEmergency/firEmergency.py b/plugins/firEmergency/firEmergency.py index 83cbcb6..89be104 100644 --- a/plugins/firEmergency/firEmergency.py +++ b/plugins/firEmergency/firEmergency.py @@ -14,6 +14,29 @@ import socket from includes import globals # Global variables +## +# +# onLoad function of plugin +# will be called by the pluginLoader +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine are called + + @requires: nothing + + @return: nothing + """ + try: + ########## User onLoad CODE ########## + + ########## User onLoad CODE ########## + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) + ## # # Main function of firEmergency-plugin diff --git a/plugins/httpRequest/httpRequest.py b/plugins/httpRequest/httpRequest.py index 7c5c761..97444a4 100644 --- a/plugins/httpRequest/httpRequest.py +++ b/plugins/httpRequest/httpRequest.py @@ -15,6 +15,28 @@ from urlparse import urlparse #for split the URL into url and path from includes import globals # Global variables +## +# +# onLoad function of plugin +# will be called by the pluginLoader +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine are called + + @requires: nothing + + @return: nothing + """ + try: + ########## User onLoad CODE ########## + + ########## User onLoad CODE ########## + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) ## # diff --git a/plugins/jsonSocket/jsonSocket.py b/plugins/jsonSocket/jsonSocket.py index 010dad6..60b6f63 100644 --- a/plugins/jsonSocket/jsonSocket.py +++ b/plugins/jsonSocket/jsonSocket.py @@ -16,6 +16,29 @@ import json # for data-transfer from includes import globals # Global variables +## +# +# onLoad function of plugin +# will be called by the pluginLoader +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine are called + + @requires: nothing + + @return: nothing + """ + try: + ########## User onLoad CODE ########## + + ########## User onLoad CODE ########## + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) + ## # # Main function of jsonSocket-plugin diff --git a/plugins/template/template.py b/plugins/template/template.py index 85a92e9..afe0eaf 100644 --- a/plugins/template/template.py +++ b/plugins/template/template.py @@ -24,6 +24,29 @@ import logging # Global logger from includes import globals # Global variables +## +# +# onLoad function of plugin +# will be called by the pluginLoader +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine are called + + @requires: nothing + + @return: nothing + """ + try: + ########## User onLoad CODE ########## + + ########## User onLoad CODE ########## + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) + ## # # Main function of plugin @@ -57,19 +80,18 @@ def run(typ,freq,data): except: logging.error("cannot read config file") logging.debug("cannot read config file", exc_info=True) - # Without config, plugin couldn't work - return + else: # Without config, plugin couldn't work -########## User Plugin CODE ########## - if typ == "FMS": - logging.warning("%s not supported", typ) - elif typ == "ZVEI": - logging.warning("%s not supported", typ) - elif typ == "POC": - logging.warning("%s not supported", typ) - else: - logging.warning("Invalid Typ: %s", typ) -########## User Plugin CODE ########## + ########## User Plugin CODE ########## + if typ == "FMS": + logging.warning("%s not supported", typ) + elif typ == "ZVEI": + logging.warning("%s not supported", typ) + elif typ == "POC": + logging.warning("%s not supported", typ) + else: + logging.warning("Invalid Typ: %s", typ) + ########## User Plugin CODE ########## except: logging.error("unknown error")