PLG: SNMPDSC typo

This commit is contained in:
jokob-sk
2025-10-31 20:24:13 +11:00
parent 2f7d9a02ae
commit 78ab0fbd2d
4 changed files with 36 additions and 26 deletions

View File

@@ -534,7 +534,7 @@
{
"elementType": "input",
"elementOptions": [{ "type": "password" }],
"transformers": []
"transformers": ["base64"]
}
]
},

View File

@@ -483,7 +483,7 @@
"description": [
{
"language_code": "en_us",
"string": "A list of <code>snmpwalk</code> commands to execute against IP addresses of roputers/switches with SNMP turned on. <br/> <br/> Example with the router on the IP <code>192.168.1.1</code> (the <code>-OXsq</code> is a required parameter): <br/> <code>snmpwalk -v 2c -c public -OXsq 192.168.1.1 .1.3.6.1.2.1.3.1.1.2</code> <br/><br/> Only IPv4 supported. Authentication is not supported. More info on the plugin <a href='https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/snmp_discovery' target='_blank'>here</a>."
"string": "A list of <code>snmpwalk</code> commands to execute against IP addresses of routers/switches with SNMP turned on. <br/> <br/> Example with the router on the IP <code>192.168.1.1</code> (the <code>-OXsq</code> is a required parameter): <br/> <code>snmpwalk -v 2c -c public -OXsq 192.168.1.1 .1.3.6.1.2.1.3.1.1.2</code> <br/><br/> Only IPv4 supported. Authentication is not supported. More info on the plugin <a href='https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/snmp_discovery' target='_blank'>here</a>."
},
{
"language_code": "es_es",

View File

@@ -768,11 +768,19 @@ def collect_lang_strings(json, pref, stringSqlParams):
return stringSqlParams
#-------------------------------------------------------------------------------
def checkNewVersion():
mylog('debug', [f"[Version check] Checking if new version available"])
# Get the value from the buildtimestamp.txt and initialize it if missing
def getBuildTimeStamp():
"""
Retrieves the build timestamp from 'front/buildtimestamp.txt' within the
application directory.
newVersion = False
If the file does not exist, it is created and initialized with the value '0'.
Returns:
int: The integer value of the build timestamp read from the file.
Returns 0 if the file is empty or just initialized.
"""
buildTimestamp = 0
build_timestamp_path = os.path.join(applicationPath, 'front/buildtimestamp.txt')
# Ensure file exists, initialize if missing
@@ -784,6 +792,16 @@ def checkNewVersion():
with open(build_timestamp_path, 'r') as f:
buildTimestamp = int(f.read().strip() or 0)
return buildTimestamp
#-------------------------------------------------------------------------------
def checkNewVersion():
mylog('debug', [f"[Version check] Checking if new version available"])
newVersion = False
buildTimestamp = getBuildTimeStamp()
try:
response = requests.get(
"https://api.github.com/repos/jokob-sk/NetAlertX/releases",

View File

@@ -12,7 +12,7 @@ import re
# Register NetAlertX libraries
import conf
from const import fullConfPath, applicationPath, fullConfFolder, default_tz
from helper import fixPermissions, collect_lang_strings, updateSubnets, isJsonObject, setting_value_to_python_type, timeNowTZ, get_setting_value, generate_random_string
from helper import getBuildTimeStamp, fixPermissions, collect_lang_strings, updateSubnets, isJsonObject, setting_value_to_python_type, timeNowTZ, get_setting_value, generate_random_string
from app_state import updateState
from logger import mylog
from api import update_api
@@ -378,29 +378,21 @@ def importConfigs (pm, db, all_plugins):
# HANDLE APP was upgraded message - clear cache
# Check if app was upgraded
build_timestamp_path = os.path.join(applicationPath, 'front/buildtimestamp.txt')
# Ensure the build timestamp file exists and has an initial value
if not os.path.exists(build_timestamp_path):
with open(build_timestamp_path, 'w') as f:
f.write("0")
with open(build_timestamp_path, 'r') as f:
buildTimestamp = int(f.read().strip())
cur_version = conf.VERSION
buildTimestamp = getBuildTimeStamp()
cur_version = conf.VERSION
mylog('debug', [f"[Config] buildTimestamp: '{buildTimestamp}'"])
mylog('debug', [f"[Config] conf.VERSION : '{cur_version}'"])
if str(cur_version) != str(buildTimestamp):
mylog('debug', [f"[Config] buildTimestamp: '{buildTimestamp}'"])
mylog('debug', [f"[Config] conf.VERSION : '{cur_version}'"])
mylog('none', ['[Config] App upgraded 🚀'])
# ccd(key, default, config_dir, name, inputtype, options, group, events=None, desc="", setJsonMetadata=None, overrideTemplate=None, forceDefault=False)
ccd('VERSION', buildTimestamp , c_d, '_KEEP_', '_KEEP_', '_KEEP_', '_KEEP_', None, "_KEEP_", None, None, True)
if str(cur_version) != str(buildTimestamp):
mylog('none', ['[Config] App upgraded 🚀'])
# ccd(key, default, config_dir, name, inputtype, options, group, events=None, desc="", setJsonMetadata=None, overrideTemplate=None, forceDefault=False)
ccd('VERSION', buildTimestamp , c_d, '_KEEP_', '_KEEP_', '_KEEP_', '_KEEP_', None, "_KEEP_", None, None, True)
write_notification(f'[Upgrade] : App upgraded 🚀 Please clear the cache: <ol> <li>Click OK below</li> <li>Clear the browser cache (shift + browser refresh button)</li> <li> Clear app cache with the <i class="fa-solid fa-rotate"></i> (reload) button in the header</li><li>Go to Settings and click Save</li> </ol> Check out new features and what has changed in the <a href="https://github.com/jokob-sk/NetAlertX/releases" target="_blank">📓 release notes</a>.', 'interrupt', timeNowTZ())
write_notification(f'[Upgrade] : App upgraded 🚀 Please clear the cache: <ol> <li>Click OK below</li> <li>Clear the browser cache (shift + browser refresh button)</li> <li> Clear app cache with the <i class="fa-solid fa-rotate"></i> (reload) button in the header</li><li>Go to Settings and click Save</li> </ol> Check out new features and what has changed in the <a href="https://github.com/jokob-sk/NetAlertX/releases" target="_blank">📓 release notes</a>.', 'interrupt', timeNowTZ())