diff --git a/httpdocs/inc/snmp_device_id.inc b/httpdocs/inc/snmp_device_id.inc new file mode 100644 index 0000000000..afc3f5343c --- /dev/null +++ b/httpdocs/inc/snmp_device_id.inc @@ -0,0 +1,32 @@ + +function snmp_device_setID(row) { + var index = 0; + var snmp_device_key = row.find("td").eq(0).text(); + + // Set the row index to the network key + row.attr('id', snmp_device_key); + + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_index"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_chart"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_name"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_type"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_mtu"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_vlan"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_speed"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_mac"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_status"); + + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_inb"); + // row.find("td").eq(index - 1).text(bytesToSize(row.find("td").eq(index).text())); + + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_outb"); + // row.find("td").eq(index - 1).text(bytesToSize(row.find("td").eq(index).text())); + + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_in_discards"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_seen_macs"); + row.find("td").eq(index++).attr('id', snmp_device_key + "_port_last_change"); + + $("#" + snmp_device_key + '_port_inb').html(bytesToSize($("#" + snmp_device_key + '_port_inb').text())); + return row; + +} diff --git a/scripts/locales/en.lua b/scripts/locales/en.lua index 69d100d4fc..8bc46cbc9f 100644 --- a/scripts/locales/en.lua +++ b/scripts/locales/en.lua @@ -2465,7 +2465,7 @@ local lang = { ["discover_devices"] = "Discover Devices", ["enable_polling"] = "Enable Polling", ["enable_port_monitor"] = "Enable Port Monitor", - ["ifindex"] = "Interface Index", + ["ifindex"] = "Index", ["in_bytes"] = "In Bytes", ["in_discards"] = "In Discards", ["last_change"] = "Last Change", @@ -2482,7 +2482,7 @@ local lang = { ["snmp_community"] = "SNMP Community", ["snmp_device"] = "SNMP Device", ["snmp_device_does_not_respond"] = "The SNMP device does not respond.", - ["snmp_device_x"] = "SNMP Device %{device}", + ["snmp_device_x"] = "SNMP Device: %{device}", ["snmp_devices"] = "SNMP Devices", ["snmp_interface"] = "SNMP Interface", ["snmp_monitor_disable_confirm"] = "Do you really want to disable port status monitoring on SNMP device %{device}?", @@ -2493,6 +2493,7 @@ local lang = { ["snmp_port_monitor"] = "SNMP Port Monitor", ["snmp_timeseries_descr"] = "SNMP devices timeseries can be enabled from the Preferences. Few minutes are necessary to see the first data points", ["snmp_version"] = "SNMP Version", + ["all_snmp_statuses"] = "All Statuses", ["status_down"] = "Down", ["status_up"] = "Up", ["testing"] = "Testing", diff --git a/scripts/lua/modules/http_lint.lua b/scripts/lua/modules/http_lint.lua index 1b1fb6d091..ffb3375da1 100644 --- a/scripts/lua/modules/http_lint.lua +++ b/scripts/lua/modules/http_lint.lua @@ -1086,6 +1086,7 @@ local known_parameters = { ["sampling_rate"] = validateEmptyOr(validateNumber), -- if_stats.lua ["resetstats_mode"] = validateResetStatsMode, -- reset_stats.lua ["snmp_action"] = validateSnmpAction, -- snmp specific + ["snmp_status"] = validateNumber, -- snmp specific status (up: 1, down: 2, testing: 3) ["iftype_filter"] = validateSingleWord, -- SNMP iftype filter name ["host_quota"] = validateEmptyOr(validateNumber), -- max traffi quota for host ["allowed_interface"] = validateEmptyOr(validateInterface), -- the interface an user is allowed to configure