Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/ntop/ntopng into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoBiscosi committed Jul 17, 2024
2 parents d306ed5 + 546d796 commit a6be631
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions doc/src/alerts/available_recipients.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ Checkmk messages have the following format:
Fields have the following meanings:

- :code: `sl`: an identifier of the event, used, for example, to perform searches.
- :code: `comment`: contain the information described in the Plaintext section, except for timestamp, which is assigned by checkmk to the event.
- :severity: `severity`: the severity of the alert.
- :code:`sl`: an identifier of the event, used, for example, to perform searches.
- :code:`comment`: contain the information described in the Plaintext section, except for timestamp, which is assigned by checkmk to the event.
- :code:`severity`: the severity of the alert.

An example of Checkmk alert sent to syslog is

Expand Down
17 changes: 12 additions & 5 deletions src/ParserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ bool ParserInterface::processFlow(ParsedFlow *zflow) {
if ((zflow->vlan_id == 0) && ntop->getPrefs()->do_simulate_vlans())
zflow->vlan_id = rand() % SIMULATE_VLANS_MAX_VALUE;
#ifdef NTOPNG_PRO
if (zflow->device_ip) {

u_int32_t device_id = zflow->unique_source_id;
if (!device_id)
device_id = zflow->probe_ip + zflow->device_ip;

if (device_id) {

if (!flow_interfaces_stats) {
flow_interfaces_stats = new (std::nothrow) FlowInterfacesStats();
Expand All @@ -81,7 +86,9 @@ bool ParserInterface::processFlow(ParsedFlow *zflow) {
}
}

if (!flow_interfaces_stats->checkExporters(zflow->device_ip, zflow->inIndex, zflow->outIndex, zflow->probe_ip)) {
if (!flow_interfaces_stats->checkExporters(device_id,
zflow->inIndex, zflow->outIndex,
zflow->device_ip, zflow->probe_ip)) {
static bool shown = false;

if(!shown) {
Expand Down Expand Up @@ -498,12 +505,12 @@ bool ParserInterface::processFlow(ParsedFlow *zflow) {
guessed_protocol.master_protocol = ndpi_map_ndpi_id_to_user_proto_id(get_ndpi_struct(), guessed_protocol.master_protocol);

#ifdef NTOPNG_PRO
if (zflow->device_ip) {
if (device_id) {
if (!flow_interfaces_stats)
flow_interfaces_stats = new (std::nothrow) FlowInterfacesStats();

if (flow_interfaces_stats) {
flow_interfaces_stats->incStats(now, zflow->device_ip, zflow->inIndex, flow->getStatsProtocol(),
flow_interfaces_stats->incStats(now, device_id, zflow->inIndex, flow->getStatsProtocol(),
zflow->pkt_sampling_rate * zflow->out_pkts,
zflow->pkt_sampling_rate * zflow->out_bytes,
zflow->pkt_sampling_rate * zflow->in_pkts,
Expand All @@ -516,7 +523,7 @@ bool ParserInterface::processFlow(ParsedFlow *zflow) {
double counting. */

if (zflow->outIndex != zflow->inIndex)
flow_interfaces_stats->incStats(now, zflow->device_ip, zflow->outIndex, flow->getStatsProtocol(),
flow_interfaces_stats->incStats(now, device_id, zflow->outIndex, flow->getStatsProtocol(),
zflow->pkt_sampling_rate * zflow->in_pkts,
zflow->pkt_sampling_rate * zflow->in_bytes,
zflow->pkt_sampling_rate * zflow->out_pkts,
Expand Down

0 comments on commit a6be631

Please sign in to comment.