Technical Forum
Ask questions. Discover Answers.
cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 

using grep to list all nodes with a specific intervall

Evergrim
Nimbostratus
Nimbostratus

Hi guys,

I am trying to figure out how to display all nodes that have an interval not equal to "300".

Example:
list ltm node | grep -v "interval 300" -B 5

but this way it shows me all other lines that don't have "interval 300". Consequently ALL nodes but not the one line...
I hope you can follow me. πŸ˜„

does anyone have an idea how I can do this better?

Best regards
Basti

4 REPLIES 4

Paulius
MVP
MVP

@Evergrim This will show you all node names followed by lines that have the value not equal to 300 so you can then remove all the nodes that are not followed by a line with an interval value manually.

 

list ltm node | grep -E "node|interval " | grep -v "interval 300"

 

 

 

There's a problem with this .. default "interval" is 3600 and won't be displayed by this command so you will have nodes followed by nothing that might actually have 3600 interval πŸ™‚ 

that is correct.
I took this command, it worked best for my purpose:

list ltm node all-properties fqdn-templates | grep -E "node|interval" | grep -v "interval 300"


Thanks everyone for the help!

CA_Valli
MVP
MVP

should be pretty easy, try this

tmsh list ltm node all all-properties one-line | grep -v "interval 300" | grep "ltm node" --color

 

[edit] you could also possibly copy ^this output^ into notepad++ and bulk edit all lines to " tmsh modify ltm node X  fqdn { interval 300 } "