-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T6641: Add vyos-network-event-logger Service #4216
Open
HollyGurza
wants to merge
1
commit into
vyos:current
Choose a base branch
from
HollyGurza:T6641
base: current
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,21 @@ | ||
<!-- include start from netlink/log-level.xml.i --> | ||
<leafNode name="log-level"> | ||
<properties> | ||
<help>Set log-level</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> | ||
<!-- include 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- include start from netlink/queue-size.xml.i --> | ||
<leafNode name="queue-size"> | ||
<properties> | ||
<help>Internal message queue size</help> | ||
<valueHelp> | ||
<format>u32:100-2147483647</format> | ||
<description>Queue size</description> | ||
</valueHelp> | ||
<constraint> | ||
<validator name="numeric" argument="--range 1-2147483647"/> | ||
</constraint> | ||
<constraintErrorMessage>Queue size must be between 100 and 2147483647</constraintErrorMessage> | ||
</properties> | ||
</leafNode> | ||
<!-- include end --> |
61 changes: 61 additions & 0 deletions
61
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,61 @@ | ||
<?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 change 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> | ||
#include <include/netlink/queue-size.xml.i> | ||
#include <include/netlink/log-level.xml.i> | ||
</children> | ||
</node> | ||
</children> | ||
</node> | ||
</children> | ||
</node> | ||
</interfaceDefinition> |
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
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 network-event-type-interface.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-interface-type-event-log.xml.i --> | ||
<node name="event-log"> | ||
<properties> | ||
<help>Show network interface change 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 events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service --grep "\b$4\b" | grep -i "\[$6\]"</command> | ||
</leafNode> | ||
<leafNode name="link"> | ||
<properties> | ||
<help>Show log for network link events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service --grep "\b$4\b" | grep -i "\[$6\]"</command> | ||
</leafNode> | ||
<leafNode name="addr"> | ||
<properties> | ||
<help>Show log for network address events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service --grep "\b$4\b" | grep -i "\[$6\]"</command> | ||
</leafNode> | ||
<leafNode name="neigh"> | ||
<properties> | ||
<help>Show log for neighbor table events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service --grep "\b$4\b" | grep -i "\[$6\]"</command> | ||
</leafNode> | ||
<leafNode name="rule"> | ||
<properties> | ||
<help>Show log for PBR rule change events</help> | ||
</properties> | ||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service --grep "\b$4\b" | grep -i "\[$6\]"</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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably make a skeleton node for monitoring and include everything else into it, although it's a topic for a different PR.