-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T6641: Add vyos-network-event-logger Service
The service parses and logs network events for improved monitoring and diagnostics. Supported event types include: - `RTM_NEWROUTE`, `RTM_DELROUTE` - `RTM_NEWLINK`, `RTM_DELLINK` - `RTM_NEWADDR`, `RTM_DELADDR` - `RTM_NEWNEIGH`, `RTM_DELNEIGH`, `RTM_GETNEIGH` - `RTM_NEWRULE`, `RTM_DELRULE` Added operational mode commands for filtered log retrieval: - `show log network-event <event-type> <interface>`: Retrieve logs filtered by event type and interface. - `show interfaces <type> <name> event-log <event-type>`: Display interface-specific logs filtered by event type.
- Loading branch information
1 parent
3ed6f02
commit b9e3eb8
Showing
27 changed files
with
1,804 additions
and
0 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
interface-definitions/service_monitoring_network_event.xml.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0"?> | ||
<interfaceDefinition> | ||
<node name="service"> | ||
<children> | ||
<node name="monitoring"> | ||
<properties> | ||
<help>Monitoring services</help> | ||
</properties> | ||
<children> | ||
<node name="network-event" owner="${vyos_conf_scripts_dir}/service_monitoring_network_event.py"> | ||
<properties> | ||
<help>Network event logger</help> | ||
<priority>1280</priority> | ||
</properties> | ||
<children> | ||
<node name="event"> | ||
<properties> | ||
<help>Network event type</help> | ||
</properties> | ||
<children> | ||
<leafNode name="route"> | ||
<properties> | ||
<help>Log routing table update events</help> | ||
<valueless/> | ||
</properties> | ||
</leafNode> | ||
<leafNode name="link"> | ||
<properties> | ||
<help>Log link status changes events</help> | ||
<valueless/> | ||
</properties> | ||
</leafNode> | ||
<leafNode name="addr"> | ||
<properties> | ||
<help>Log address assignment and removal events</help> | ||
<valueless/> | ||
</properties> | ||
</leafNode> | ||
<leafNode name="neigh"> | ||
<properties> | ||
<help>Log neighbor (ARP/ND) table update events</help> | ||
<valueless/> | ||
</properties> | ||
</leafNode> | ||
<leafNode name="rule"> | ||
<properties> | ||
<help>Log policy routing rule change events</help> | ||
<valueless/> | ||
</properties> | ||
</leafNode> | ||
</children> | ||
</node> | ||
<leafNode name="queue-size"> | ||
<properties> | ||
<help>Internal message queue size</help> | ||
<valueHelp> | ||
<format>u32:100-999999</format> | ||
<description>Queue size</description> | ||
</valueHelp> | ||
<constraint> | ||
<validator name="numeric" argument="--range 1-999999"/> | ||
</constraint> | ||
<constraintErrorMessage>Queue size must be between 100 and 999999</constraintErrorMessage> | ||
</properties> | ||
</leafNode> | ||
<leafNode name="log-level"> | ||
<properties> | ||
<help>Set log-level. Log must be enable</help> | ||
<completionHelp> | ||
<list>info debug</list> | ||
</completionHelp> | ||
<valueHelp> | ||
<format>info</format> | ||
<description>Info log level</description> | ||
</valueHelp> | ||
<valueHelp> | ||
<format>debug</format> | ||
<description>Debug log level</description> | ||
</valueHelp> | ||
<constraint> | ||
<regex>(info|debug)</regex> | ||
</constraint> | ||
</properties> | ||
</leafNode> | ||
</children> | ||
</node> | ||
</children> | ||
</node> | ||
</children> | ||
</node> | ||
</interfaceDefinition> |
11 changes: 11 additions & 0 deletions
11
op-mode-definitions/include/log/network-event-type-interface.xml.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- included start from isis-common.xml.i --> | ||
<tagNode name="interface"> | ||
<properties> | ||
<help>Show log for specific interface</help> | ||
<completionHelp> | ||
<script>${vyos_completion_dir}/list_interfaces</script> | ||
</completionHelp> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$4\]" | tr '[:lower:]' '[:upper:]')" | grep "\b$6\b"</command> | ||
</tagNode> | ||
<!-- included end --> |
40 changes: 40 additions & 0 deletions
40
op-mode-definitions/include/show-interface-type-event-log.xml.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- included start from show-nht.xml.i --> | ||
<node name="event-log"> | ||
<properties> | ||
<help>Show interface network event log</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "\b$4\b"</command> | ||
<children> | ||
<leafNode name="route"> | ||
<properties> | ||
<help>Show log for route network events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$6\]" | tr '[:lower:]' '[:upper:]')" | grep "\b$4\b"</command> | ||
</leafNode> | ||
<leafNode name="link"> | ||
<properties> | ||
<help>Show log for link network events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$6\]" | tr '[:lower:]' '[:upper:]')" | grep "\b$4\b"</command> | ||
</leafNode> | ||
<leafNode name="addr"> | ||
<properties> | ||
<help>Show log for addr network events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$6\]" | tr '[:lower:]' '[:upper:]')" | grep "\b$4\b"</command> | ||
</leafNode> | ||
<leafNode name="neigh"> | ||
<properties> | ||
<help>Show log for neigh network events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$6\]" | tr '[:lower:]' '[:upper:]')" | grep "\b$4\b"</command> | ||
</leafNode> | ||
<leafNode name="rule"> | ||
<properties> | ||
<help>Show log for rule network events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$6\]" | tr '[:lower:]' '[:upper:]')" | grep "\b$4\b"</command> | ||
</leafNode> | ||
</children> | ||
</node> | ||
<!-- included end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.