mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
This commit is contained in:
@@ -31,7 +31,7 @@ Also consider decreasing the scanned subnet, e.g. from `/16` to `/24` if need be
|
|||||||
|
|
||||||
# Store temporary files in memory
|
# Store temporary files in memory
|
||||||
|
|
||||||
You can also store temporary files in application memory (`/app/api` and `/app/log` folders).
|
You can also store temporary files in application memory (`/app/api` and `/app/log` folders). See highlighted lines `◀` below.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
version: "3"
|
||||||
@@ -49,8 +49,8 @@ services:
|
|||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- local/path/logs:/app/log
|
- local/path/logs:/app/log
|
||||||
# (API: OPTION 1) use for performance
|
# (API: OPTION 1) use for performance
|
||||||
- type: tmpfs
|
- type: tmpfs # ◀
|
||||||
target: /app/api
|
target: /app/api # ◀
|
||||||
# (API: OPTION 2) use when debugging issues
|
# (API: OPTION 2) use when debugging issues
|
||||||
# - local/path/api:/app/api
|
# - local/path/api:/app/api
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1007,7 +1007,7 @@ function generateFormHtml(set, overrideValue) {
|
|||||||
id="${`${event}_${setKey}`}"
|
id="${`${event}_${setKey}`}"
|
||||||
data-myparam-setkey="${setKey}"
|
data-myparam-setkey="${setKey}"
|
||||||
data-myparam="${setKey}"
|
data-myparam="${setKey}"
|
||||||
data-myparam-plugin="${setTypeObject.prefix || ''}"
|
data-myparam-plugin="${setKey.split('_')[0] || ''}"
|
||||||
data-myevent="${event}"
|
data-myevent="${event}"
|
||||||
onclick="execute_settingEvent(this)">
|
onclick="execute_settingEvent(this)">
|
||||||
<i title="${getString(event + "_event_tooltip")}" class="fa ${getString(event + "_event_icon")}"></i>
|
<i title="${getString(event + "_event_tooltip")}" class="fa ${getString(event + "_event_icon")}"></i>
|
||||||
|
|||||||
0
front/php/templates/language/ca_ca.json
Normal file → Executable file
0
front/php/templates/language/ca_ca.json
Normal file → Executable file
0
front/php/templates/language/es_es.json
Normal file → Executable file
0
front/php/templates/language/es_es.json
Normal file → Executable file
0
front/php/templates/language/fr_fr.json
Normal file → Executable file
0
front/php/templates/language/fr_fr.json
Normal file → Executable file
0
front/php/templates/language/it_it.json
Normal file → Executable file
0
front/php/templates/language/it_it.json
Normal file → Executable file
0
front/php/templates/language/ru_ru.json
Normal file → Executable file
0
front/php/templates/language/ru_ru.json
Normal file → Executable file
0
front/php/templates/language/uk_ua.json
Normal file → Executable file
0
front/php/templates/language/uk_ua.json
Normal file → Executable file
@@ -13,7 +13,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from plugin_utils import get_plugins_configs
|
from plugin_utils import get_plugins_configs
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import pluginsPath, fullDbPath, logPath
|
from const import pluginsPath, fullDbPath, logPath
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import write_notification
|
from notification import write_notification
|
||||||
@@ -22,6 +22,9 @@ import conf
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = '<unique_prefix>'
|
pluginName = '<unique_prefix>'
|
||||||
|
|
||||||
# Define the current path and log file paths
|
# Define the current path and log file paths
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import conf
|
|||||||
from const import apiPath, confFileName, logPath
|
from const import apiPath, confFileName, logPath
|
||||||
from plugin_utils import getPluginObject
|
from plugin_utils import getPluginObject
|
||||||
from plugin_helper import Plugin_Objects
|
from plugin_helper import Plugin_Objects
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value, bytes_to_string, sanitize_string, cleanDeviceName
|
from helper import timeNowTZ, get_setting_value, bytes_to_string, sanitize_string, cleanDeviceName
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB, get_device_stats
|
from database import DB, get_device_stats
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
import conf
|
import conf
|
||||||
from const import confFileName, logPath
|
from const import confFileName, logPath
|
||||||
from plugin_helper import Plugin_Objects
|
from plugin_helper import Plugin_Objects
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -24,6 +24,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'APPRISE'
|
pluginName = 'APPRISE'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
import conf
|
import conf
|
||||||
from const import confFileName, logPath
|
from const import confFileName, logPath
|
||||||
from plugin_helper import Plugin_Objects
|
from plugin_helper import Plugin_Objects
|
||||||
from logger import mylog, append_line_to_file, print_log
|
from logger import mylog, Logger, append_line_to_file, print_log
|
||||||
from helper import timeNowTZ, get_setting_value, hide_email
|
from helper import timeNowTZ, get_setting_value, hide_email
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -33,6 +33,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'SMTP'
|
pluginName = 'SMTP'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import conf
|
|||||||
from const import apiPath, confFileName, logPath
|
from const import apiPath, confFileName, logPath
|
||||||
from plugin_utils import getPluginObject
|
from plugin_utils import getPluginObject
|
||||||
from plugin_helper import Plugin_Objects
|
from plugin_helper import Plugin_Objects
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value, bytes_to_string, sanitize_string, normalize_string
|
from helper import timeNowTZ, get_setting_value, bytes_to_string, sanitize_string, normalize_string
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB, get_device_stats
|
from database import DB, get_device_stats
|
||||||
@@ -35,6 +35,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'MQTT'
|
pluginName = 'MQTT'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
import conf
|
import conf
|
||||||
from const import confFileName, logPath
|
from const import confFileName, logPath
|
||||||
from plugin_helper import Plugin_Objects, handleEmpty
|
from plugin_helper import Plugin_Objects, handleEmpty
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -27,6 +27,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'NTFY'
|
pluginName = 'NTFY'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Objects, handleEmpty # noqa: E402
|
from plugin_helper import Plugin_Objects, handleEmpty # noqa: E402
|
||||||
from logger import mylog # noqa: E402
|
from logger import mylog, Logger # noqa: E402
|
||||||
from helper import timeNowTZ, get_setting_value, hide_string # noqa: E402
|
from helper import timeNowTZ, get_setting_value, hide_string # noqa: E402
|
||||||
from notification import Notification_obj # noqa: E402
|
from notification import Notification_obj # noqa: E402
|
||||||
from database import DB # noqa: E402
|
from database import DB # noqa: E402
|
||||||
@@ -21,6 +21,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = "PUSHOVER"
|
pluginName = "PUSHOVER"
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
import conf
|
import conf
|
||||||
from const import confFileName, logPath
|
from const import confFileName, logPath
|
||||||
from plugin_helper import Plugin_Objects, handleEmpty
|
from plugin_helper import Plugin_Objects, handleEmpty
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value, hide_string
|
from helper import timeNowTZ, get_setting_value, hide_string
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -27,6 +27,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'PUSHSAFER'
|
pluginName = 'PUSHSAFER'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
import conf
|
import conf
|
||||||
from const import confFileName, logPath
|
from const import confFileName, logPath
|
||||||
from plugin_helper import Plugin_Objects
|
from plugin_helper import Plugin_Objects
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -24,6 +24,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'TELEGRAM'
|
pluginName = 'TELEGRAM'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
import conf
|
import conf
|
||||||
from const import logPath, confFileName
|
from const import logPath, confFileName
|
||||||
from plugin_helper import Plugin_Objects, handleEmpty
|
from plugin_helper import Plugin_Objects, handleEmpty
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value, hide_string, write_file
|
from helper import timeNowTZ, get_setting_value, hide_string, write_file
|
||||||
from notification import Notification_obj
|
from notification import Notification_obj
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -30,6 +30,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'WEBHOOK'
|
pluginName = 'WEBHOOK'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from database import DB
|
from database import DB
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, handleEmpty
|
from plugin_helper import Plugin_Object, Plugin_Objects, handleEmpty
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath
|
from const import logPath, applicationPath
|
||||||
import conf
|
import conf
|
||||||
@@ -24,6 +24,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'ARPSCAN'
|
pluginName = 'ARPSCAN'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from plugin_utils import get_plugins_configs
|
from plugin_utils import get_plugins_configs
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import pluginsPath, fullDbPath, logPath
|
from const import pluginsPath, fullDbPath, logPath
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import write_notification
|
from notification import write_notification
|
||||||
@@ -25,6 +25,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'AVAHISCAN'
|
pluginName = 'AVAHISCAN'
|
||||||
|
|
||||||
# Define the current path and log file paths
|
# Define the current path and log file paths
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
import conf
|
import conf
|
||||||
@@ -24,6 +24,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'CSVBCKP'
|
pluginName = 'CSVBCKP'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
import conf
|
import conf
|
||||||
@@ -24,6 +24,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'DBCLNP'
|
pluginName = 'DBCLNP'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value, check_IP_format
|
from helper import timeNowTZ, get_setting_value, check_IP_format
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
import conf
|
import conf
|
||||||
@@ -27,6 +27,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'DDNS'
|
pluginName = 'DDNS'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, handleEmpty, is_mac
|
from plugin_helper import Plugin_Object, Plugin_Objects, handleEmpty, is_mac
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from dhcp_leases import DhcpLeases
|
from dhcp_leases import DhcpLeases
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
import conf
|
import conf
|
||||||
@@ -23,6 +23,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName= 'DHCPLSS'
|
pluginName= 'DHCPLSS'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Objects, Plugin_Object
|
from plugin_helper import Plugin_Objects, Plugin_Object
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
import conf
|
import conf
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
@@ -19,6 +19,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
mylog('verbose', ['[DHCPSRVS] In script'])
|
mylog('verbose', ['[DHCPSRVS] In script'])
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from plugin_utils import get_plugins_configs
|
from plugin_utils import get_plugins_configs
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import pluginsPath, fullDbPath, logPath
|
from const import pluginsPath, fullDbPath, logPath
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import write_notification
|
from notification import write_notification
|
||||||
@@ -31,6 +31,9 @@ import conf
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value("TIMEZONE"))
|
conf.tz = timezone(get_setting_value("TIMEZONE"))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'FREEBOX'
|
pluginName = 'FREEBOX'
|
||||||
|
|
||||||
# Define the current path and log file paths
|
# Define the current path and log file paths
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -30,6 +30,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'ICMP'
|
pluginName = 'ICMP'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, check_IP_format, get_setting_value
|
from helper import timeNowTZ, check_IP_format, get_setting_value
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
import conf
|
import conf
|
||||||
@@ -28,6 +28,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'INTRNT'
|
pluginName = 'INTRNT'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Objects
|
from plugin_helper import Plugin_Objects
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
import conf
|
import conf
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
@@ -21,6 +21,9 @@ from const import logPath
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'INTRSPD'
|
pluginName = 'INTRSPD'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmpty
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmpty
|
||||||
from plugin_utils import get_plugins_configs
|
from plugin_utils import get_plugins_configs
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import pluginsPath, fullDbPath, logPath
|
from const import pluginsPath, fullDbPath, logPath
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import write_notification
|
from notification import write_notification
|
||||||
@@ -25,6 +25,9 @@ import conf
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'IPNEIGH'
|
pluginName = 'IPNEIGH'
|
||||||
|
|
||||||
# Define the current path and log file paths
|
# Define the current path and log file paths
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath
|
from const import logPath, applicationPath
|
||||||
import conf
|
import conf
|
||||||
@@ -25,6 +25,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'MAINT'
|
pluginName = 'MAINT'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -30,6 +30,9 @@ from librouteros.exceptions import TrapError
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'MTSCAN'
|
pluginName = 'MTSCAN'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from plugin_utils import get_plugins_configs
|
from plugin_utils import get_plugins_configs
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import pluginsPath, fullDbPath, logPath
|
from const import pluginsPath, fullDbPath, logPath
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import write_notification
|
from notification import write_notification
|
||||||
@@ -25,6 +25,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'NBTSCAN'
|
pluginName = 'NBTSCAN'
|
||||||
|
|
||||||
# Define the current path and log file paths
|
# Define the current path and log file paths
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value, extract_between_strings, extract_ip_addresses, extract_mac_addresses
|
from helper import timeNowTZ, get_setting_value, extract_between_strings, extract_ip_addresses, extract_mac_addresses
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -31,6 +31,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'NMAPDEV'
|
pluginName = 'NMAPDEV'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath
|
from const import logPath, applicationPath
|
||||||
import conf
|
import conf
|
||||||
@@ -23,6 +23,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'NMAP'
|
pluginName = 'NMAP'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
from database import DB
|
from database import DB
|
||||||
@@ -30,6 +30,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'NSLOOKUP'
|
pluginName = 'NSLOOKUP'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -44,14 +44,19 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from plugin_utils import get_plugins_configs
|
from plugin_utils import get_plugins_configs
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import pluginsPath, fullDbPath, logPath
|
from const import pluginsPath, fullDbPath, logPath
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from notification import write_notification
|
from notification import write_notification
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
import conf
|
import conf
|
||||||
|
|
||||||
conf.tz = timezone(get_setting_value("TIMEZONE"))
|
# Make sure the TIMEZONE for logging is correct
|
||||||
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
PARALLELISM = 4
|
PARALLELISM = 4
|
||||||
|
|
||||||
pluginName = "OMDSDN"
|
pluginName = "OMDSDN"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ INSTALL_PATH = "/app"
|
|||||||
sys.path.append(f"{INSTALL_PATH}/front/plugins")
|
sys.path.append(f"{INSTALL_PATH}/front/plugins")
|
||||||
sys.path.append(f'{INSTALL_PATH}/server')
|
sys.path.append(f'{INSTALL_PATH}/server')
|
||||||
|
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import confFileName
|
from const import confFileName
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmpty, normalize_mac
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmpty, normalize_mac
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath
|
from const import logPath, applicationPath
|
||||||
import conf
|
import conf
|
||||||
@@ -21,6 +21,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = "SNMPDSC"
|
pluginName = "SNMPDSC"
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
|||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from plugin_utils import get_plugins_configs, decode_and_rename_files
|
from plugin_utils import get_plugins_configs, decode_and_rename_files
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from const import pluginsPath, fullDbPath, logPath
|
from const import pluginsPath, fullDbPath, logPath
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from crypto_utils import encrypt_data
|
from crypto_utils import encrypt_data
|
||||||
@@ -27,6 +27,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'SYNC'
|
pluginName = 'SYNC'
|
||||||
|
|
||||||
# Define the current path and log file paths
|
# Define the current path and log file paths
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath
|
from const import logPath, applicationPath
|
||||||
import conf
|
import conf
|
||||||
@@ -21,14 +21,15 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'UNDIS'
|
pluginName = 'UNDIS'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
LOG_FILE = os.path.join(LOG_PATH, f'script.{pluginName}.log')
|
LOG_FILE = os.path.join(LOG_PATH, f'script.{pluginName}.log')
|
||||||
RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
# the script expects a parameter in the format of devices=device1,device2,...
|
# the script expects a parameter in the format of devices=device1,device2,...
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, rmBadChars, is_typical_router_ip, is_mac
|
from plugin_helper import Plugin_Object, Plugin_Objects, rmBadChars, is_typical_router_ip, is_mac
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from helper import timeNowTZ, get_setting_value, normalize_string
|
from helper import timeNowTZ, get_setting_value, normalize_string
|
||||||
import conf
|
import conf
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
@@ -29,6 +29,9 @@ from const import logPath
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'UNFIMP'
|
pluginName = 'UNFIMP'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ INSTALL_PATH="/app"
|
|||||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||||
|
|
||||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmpty
|
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmpty
|
||||||
from logger import mylog, append_line_to_file
|
from logger import mylog, Logger, append_line_to_file
|
||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
from const import logPath, applicationPath, fullDbPath
|
from const import logPath, applicationPath, fullDbPath
|
||||||
from device import query_MAC_vendor
|
from device import query_MAC_vendor
|
||||||
@@ -26,6 +26,9 @@ from pytz import timezone
|
|||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'VNDRPDT'
|
pluginName = 'VNDRPDT'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,23 +18,33 @@ from const import logPath
|
|||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
import conf
|
import conf
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
from logger import mylog, Logger
|
||||||
|
|
||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
pluginName = 'WEBMON'
|
pluginName = 'WEBMON'
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
||||||
|
|
||||||
def main():
|
|
||||||
parser = argparse.ArgumentParser(description='Simple URL monitoring tool')
|
|
||||||
parser.add_argument('urls', action="store", help="URLs to check separated by ','")
|
|
||||||
values = parser.parse_args()
|
|
||||||
|
|
||||||
if values.urls:
|
mylog('verbose', [f'[{pluginName}] In script'])
|
||||||
|
|
||||||
|
def main():
|
||||||
|
|
||||||
|
values = get_setting_value('WEBMON_urls_to_check')
|
||||||
|
|
||||||
|
mylog('verbose', [f'[{pluginName}] Checking URLs: {values}'])
|
||||||
|
|
||||||
|
|
||||||
|
if len(values) > 0:
|
||||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||||
plugin_objects = service_monitoring(values.urls.split('=')[1].split(','), plugin_objects)
|
# plugin_objects = service_monitoring(values.urls.split('=')[1].split(','), plugin_objects)
|
||||||
|
plugin_objects = service_monitoring(values, plugin_objects)
|
||||||
plugin_objects.write_result_file()
|
plugin_objects.write_result_file()
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|||||||
0
log/.gitignore
vendored
Normal file → Executable file
0
log/.gitignore
vendored
Normal file → Executable file
0
log/plugins/.gitignore
vendored
Normal file → Executable file
0
log/plugins/.gitignore
vendored
Normal file → Executable file
@@ -19,7 +19,6 @@ import random
|
|||||||
import string
|
import string
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
|
||||||
|
|
||||||
import conf
|
import conf
|
||||||
from const import *
|
from const import *
|
||||||
from logger import mylog, logResult
|
from logger import mylog, logResult
|
||||||
@@ -336,13 +335,7 @@ def get_setting_value(key):
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Convert the setting value to the corresponding python type
|
# Convert the setting value to the corresponding python type
|
||||||
import json
|
|
||||||
import base64
|
|
||||||
import hashlib
|
|
||||||
|
|
||||||
import json
|
|
||||||
import base64
|
|
||||||
import hashlib
|
|
||||||
|
|
||||||
def setting_value_to_python_type(set_type, set_value):
|
def setting_value_to_python_type(set_type, set_value):
|
||||||
value = '----not processed----'
|
value = '----not processed----'
|
||||||
|
|||||||
@@ -22,7 +22,16 @@ debugLevels = [
|
|||||||
('none', 0), ('minimal', 1), ('verbose', 2), ('debug', 3), ('trace', 4)
|
('none', 0), ('minimal', 1), ('verbose', 2), ('debug', 3), ('trace', 4)
|
||||||
]
|
]
|
||||||
|
|
||||||
currentLevel = 0
|
# use the LOG_LEVEL from the config, may be overridden
|
||||||
|
currentLevel = conf.LOG_LEVEL
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
class Logger:
|
||||||
|
def __init__(self, LOG_LEVEL='verbose'):
|
||||||
|
global currentLevel
|
||||||
|
|
||||||
|
currentLevel = LOG_LEVEL
|
||||||
|
|
||||||
|
|
||||||
def mylog(requestedDebugLevel, n):
|
def mylog(requestedDebugLevel, n):
|
||||||
setLvl = 0
|
setLvl = 0
|
||||||
@@ -30,7 +39,7 @@ def mylog(requestedDebugLevel, n):
|
|||||||
|
|
||||||
# Get debug urgency/relative weight
|
# Get debug urgency/relative weight
|
||||||
for lvl in debugLevels:
|
for lvl in debugLevels:
|
||||||
if conf.LOG_LEVEL == lvl[0]:
|
if currentLevel == lvl[0]:
|
||||||
setLvl = lvl[1]
|
setLvl = lvl[1]
|
||||||
if requestedDebugLevel == lvl[0]:
|
if requestedDebugLevel == lvl[0]:
|
||||||
reqLvl = lvl[1]
|
reqLvl = lvl[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user