04-18-2023 09:27 AM
I'm writing a script to get the memory from devices, with show memory free totals i get the below
I only want to get the first two lines to compare free to total memory and write it into an output file if below a certain percentage.
How can I exclude everything after the first 2 lines?
I use the output modifier 'section Head' and it returns:
I can try
However I would like to know is there a way for me to get the first two lines? It doesn't seem like the router has a feature to get the first n lines of an output, the rest of the show memory free command has a lot of lines, the same with other troubleshooting commands I've come across, and i would like to get the first few lines.
Solved! Go to Solution.
04-18-2023 09:44 AM
why you not use SNMP OID for this case ? it can give you free used memory
04-18-2023 09:44 AM
why you not use SNMP OID for this case ? it can give you free used memory
04-18-2023 04:37 PM
Thanks I will, use that for next time
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide