-
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
base: current
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<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"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm always uneasy about such parameters. Why is the upper limit exactly |
||||||
<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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What exactly does "Log must be enable" (sic) mean here? |
||||||
<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> |
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 --> |
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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</properties> | ||||||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "\b$4\b"</command> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
<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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The journalctl command is duplicated a lot here. Should we make it a script? I'm also not convinced about the value of the |
||||||
</leafNode> | ||||||
<leafNode name="link"> | ||||||
<properties> | ||||||
<help>Show log for link network events</help> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</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 --> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -940,6 +940,68 @@ | |||||
</properties> | ||||||
<command>journalctl --no-hostname --boot --unit squid.service</command> | ||||||
</leafNode> | ||||||
<node name="network-event"> | ||||||
<properties> | ||||||
<help>Show log for network events</help> | ||||||
</properties> | ||||||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service</command> | ||||||
<children> | ||||||
<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 $5</command> | ||||||
</tagNode> | ||||||
<node name="route"> | ||||||
<properties> | ||||||
<help>Show log for route network events</help> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</properties> | ||||||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$4\]" | tr '[:lower:]' '[:upper:]')" </command> | ||||||
<children> | ||||||
#include <include/log/network-event-type-interface.xml.i> | ||||||
</children> | ||||||
</node> | ||||||
<node name="link"> | ||||||
<properties> | ||||||
<help>Show log for link network events</help> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</properties> | ||||||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$4\]" | tr '[:lower:]' '[:upper:]')" </command> | ||||||
<children> | ||||||
#include <include/log/network-event-type-interface.xml.i> | ||||||
</children> | ||||||
</node> | ||||||
<node name="addr"> | ||||||
<properties> | ||||||
<help>Show log for addr network events</help> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</properties> | ||||||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$4\]" | tr '[:lower:]' '[:upper:]')" </command> | ||||||
<children> | ||||||
#include <include/log/network-event-type-interface.xml.i> | ||||||
</children> | ||||||
</node> | ||||||
<node name="neigh"> | ||||||
<properties> | ||||||
<help>Show log for neigh network events</help> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</properties> | ||||||
<command>journalctl --no-hostname --boot --unit vyos-network-event-logger.service | grep "$(echo "\[$4\]" | tr '[:lower:]' '[:upper:]')" </command> | ||||||
<children> | ||||||
#include <include/log/network-event-type-interface.xml.i> | ||||||
</children> | ||||||
</node> | ||||||
<node 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 "\[$4\]" | tr '[:lower:]' '[:upper:]')" </command> | ||||||
<children> | ||||||
#include <include/log/network-event-type-interface.xml.i> | ||||||
</children> | ||||||
</node> | ||||||
</children> | ||||||
</node> | ||||||
</children> | ||||||
</node> | ||||||
</children> | ||||||
|
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.