-
Notifications
You must be signed in to change notification settings - Fork 760
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
ntc_templates/templates/juniper_junos_show_system_configuration_database_usage.textfsm
Outdated
Show resolved
Hide resolved
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:
***@***.***>
|
Originally this template was failing when the configuration was being
updated. The configuration database gets locked and can't be polled. I
added the error as a way to let me know it failed for that reason and that
I could ignore the issue. There may be a better way to handle it but this
worked for me in my ignorance.
…On Mon, May 5, 2025, 19:44 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
Yes I can do that. It might take me a day or two to stage the conditions
required.
@jnicholson56 <https://github.com/jnicholson56>
I guess we'll let this one ride as it is.
*Question:* ❓
I suppose the idea was to rather have the output not parse because it
throws an error as opposed to parse and contain empty strings for each key?
—
Reply to this email directly, view it on GitHub
<#2087 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AILVUEUJIZT432YOU6KZKAT25AAYPAVCNFSM6AAAAABZWFAWASVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQMJWGQ4TMMJTGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Gotcha
I'll make suggestion(s) and you can decide. If the config db was locked the result would be an empty list which is easy to test for in Python. ---
parsed_sample: [] (An empty list evaluates to the boolean |
My original solution for the problem a few years back now. I am using
netconf to poll and the model is a bit more forgiving. If you want I can
remove this error from the template. Since this has been dangling for some
time I suspect you guys want to get it completed and pushed through.
…On Wed, May 7, 2025, 20:27 Michael Bear ***@***.***> wrote:
*mjbear* left a comment (networktocode/ntc-templates#2087)
<#2087 (comment)>
Originally this template was failing when the configuration was being
updated. The configuration database gets locked and can't be polled. I
added the error as a way to let me know it failed for that reason and that
I could ignore the issue.
Gotcha
There may be a better way to handle it but this worked for me in my
ignorance.
I'll make suggestion(s) and you can decide.
If the config db was locked the result would be an empty list which is
easy to test for in Python.
---parsed_sample: []
(An empty list evaluates to the boolean False in Python.)
🥳 I'd go with this solution if it were me. 😅
—
Reply to this email directly, view it on GitHub
<#2087 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AILVUETHVEWKRM2WZZ23K2L25KXHVAVCNFSM6AAAAABZWFAWASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNRRGE2DENBVGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
How about keeping the message in the template, but remove the (Ultimately since nothing matches we end up with an empty Python list which is easy to test for in the code that will use the list of parsed data.)
Things got busy -- breaking changes were held to the side for a major release and normal changes piled up a bit too. 😀 I'm looking to merge a few to reduce our number of remaining PRs. 🙂 |
…n_database_usage.textfsm Co-authored-by: Michael Bear <[email protected]>
@mjbear That works for me. |
- Remove the Error directive from the "currently being modified" line - Add test data for the "currently being modified" cli output
My commit message is a bit off - it was from my testing with that line in a test output file. I have since pushed the test output file (with the config db locked message) to this branch so we have test coverage. Apologies for any confusion ... I should have amended my commit message. 😐 |
Adding new file juniper_junos_show_system_configuration_database_usage.textfsm.
Send PR as draft for feedback before finalizing it.