-
Notifications
You must be signed in to change notification settings - Fork 756
Juniper junos show system configuration database usage #2087
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
base: master
Are you sure you want to change the base?
Juniper junos show system configuration database usage #2087
Conversation
@jnicholson56 Are those units always in megabytes? In the meanwhile, I do have some whitespace regex suggestions I'll start putting out there. |
ntc_templates/templates/juniper_junos_show_system_configuration_database_usage.textfsm
Outdated
Show resolved
Hide resolved
In all the examples I have on my network (100's), they are all labeled as MB. The output is the same on both Classic and EVO as well. Thanks for the suggestions. I had a few mistakes that I have committed as well. Hopefully tests pass this time :D |
…n_database_usage.textfsm Co-authored-by: Michael Bear <[email protected]>
This is ready to go unless there are more suggestions. |
And now that I look at the raw cli output again, I do notice some values are more than a thousand and are still in MB units. All good. 😀 😅 |
Juniper is nothing if not inconsistent across the CLI :) |
ntc_templates/templates/juniper_junos_show_system_configuration_database_usage.textfsm
Outdated
Show resolved
Hide resolved
^\s*Actual\s+database\s+usage:\s+${ACTUAL_DB_SIZE}\s* | ||
^\s*Available\s+database\s+space:\s+${AVAIL_DB_SPACE}\s* -> Record | ||
^{(master|backup)}\s*$$ | ||
^\s*Cannot\s+proceed,\s+database\s+is\s+currently\s+being\s+modified -> Error |
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.
@jnicholson56
Would you by chance add raw output to this PR for an instance where "cannot proceed" is present?
Please and thank you!
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.
@jnicholson56
In hindsight this may will not work out well for the unit tests since this triggers the Error
action.
As a suggestion, please test on your local machine with invoke
first to make sure it's kosher before committing/pushing the changes up to GitHub. (This way you should be able to save yourself the hassle of having to revert the changes if this turns out to be a bad idea.)
- https://github.com/networktocode/ntc-templates/blob/master/docs/dev/dev_parser.md#testing
- https://github.com/networktocode/ntc-templates/blob/master/docs/dev/dev_environment.md#invoke
Update: 👋
This was bothering me and I couldn't help myself so I staged this output up the best I could. Since that throws the Error
action that output will fail to parse and thus also fail the unit tests so it doesn't appear to helpful.
Apologies for the silly suggestion before I fully considered the Error
action on that line. 😮💨
Yes I can do that. It might take me a day or two to stage the conditions
required.
…On Thu, Apr 3, 2025, 19:28 Michael Bear ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
ntc_templates/templates/juniper_junos_show_system_configuration_database_usage.textfsm
<#2087 (comment)>
:
> @@ -0,0 +1,17 @@
+Value MAX_DB_SIZE (\S+)
+Value CURR_DB_SIZE (\S+)
+Value ACTUAL_DB_SIZE (\S+)
+Value AVAIL_DB_SPACE (\S+)
+
+# If the database is being modified, a "cannot proceed" message will be displayed
+# Otherwise, the database usage will be displayed
+
+Start
+ ^\s*Maximum\s+size\s+of\s+the\s+database:\s+${MAX_DB_SIZE}\s*
+ ^\s*Current\s+database\s+size\s+on\s+disk:\s+${CURR_DB_SIZE}\s*
+ ^\s*Actual\s+database\s+usage:\s+${ACTUAL_DB_SIZE}\s*
+ ^\s*Available\s+database\s+space:\s+${AVAIL_DB_SPACE}\s* -> Record
+ ^{(master|backup)}\s*$$
+ ^\s*Cannot\s+proceed,\s+database\s+is\s+currently\s+being\s+modified -> Error
@jnicholson56 <https://github.com/jnicholson56>
Would you by chance add raw output to this PR for an instance where
"cannot proceed" is present?
Please and thank you!
—
Reply to this email directly, view it on GitHub
<#2087 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AILVUEXZLAVQ3VPOFSFD5ST2XXG4JAVCNFSM6AAAAABZWFAWASVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDONBRGQ4TMMRVGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Adding new file juniper_junos_show_system_configuration_database_usage.textfsm.
Send PR as draft for feedback before finalizing it.