forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/syslog_telemetry_shared' into re…
…manava_final
- Loading branch information
Showing
24 changed files
with
1,366 additions
and
68 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,7 +170,7 @@ | |
"3": "3", | ||
"4": "4", | ||
"5": "5", | ||
"6": "6", | ||
"6": "1", | ||
"7": "7", | ||
"8": "1" | ||
}, | ||
|
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 |
---|---|---|
|
@@ -322,7 +322,7 @@ | |
"3": "3", | ||
"4": "4", | ||
"5": "5", | ||
"6": "6", | ||
"6": "1", | ||
"7": "7", | ||
"8": "1" | ||
}, | ||
|
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 |
---|---|---|
|
@@ -321,7 +321,7 @@ | |
"3": "3", | ||
"4": "4", | ||
"5": "5", | ||
"6": "6", | ||
"6": "1", | ||
"7": "7", | ||
"8": "1" | ||
}, | ||
|
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
36 changes: 36 additions & 0 deletions
36
dockers/docker-macsec/cli/clear/plugins/clear_macsec_counter.py
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,36 @@ | ||
import os | ||
import click | ||
|
||
import show.plugins.macsec as show_macsec | ||
import utilities_common.cli as clicommon | ||
from sonic_py_common import multi_asic | ||
|
||
@click.group(cls=clicommon.AliasedGroup) | ||
def macsec(): | ||
pass | ||
|
||
|
||
@macsec.command('macsec') | ||
@click.option('--clean-cache', type=bool, required=False, default=False, help="If the option of clean cache is true, next show commands will show the raw counters which based on the service booted instead of the last clear command.") | ||
def macsec_clear_counters(clean_cache): | ||
""" | ||
Clear MACsec counts. | ||
This clear command will generated a cache for next show commands which will base on this cache as the zero baseline to show the increment of counters. | ||
""" | ||
|
||
if clean_cache: | ||
for namespace in multi_asic.get_namespace_list(): | ||
if os.path.isfile(show_macsec.CACHE_FILE.format(namespace)): | ||
os.remove(show_macsec.CACHE_FILE.format(namespace)) | ||
print("Cleaned cache") | ||
return | ||
|
||
clicommon.run_command("show macsec --dump-file") | ||
print("Clear MACsec counters") | ||
|
||
def register(cli): | ||
cli.add_command(macsec_clear_counters) | ||
|
||
|
||
if __name__ == '__main__': | ||
macsec_clear_counters(None) |
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.