Hey guys. I have a .pl script that scans my hosts to see if they are down or up. I can run it anytime I want. The script uses a conf file that contains text lines of the IP addresses of the servers. I run the script from the command line of my terminal (MAC OS)
I run:
sudo ./scanner.pl
brings back:
10.0.1.1 - DOWN
10.0.1.2 - DOWN
10.0.2.3 - UP
10.0.2.4 - DOWN
10.0.3.5 - UP
10.0.3.6 - UP
I want to only have displayed for me the results of the two xx.x.3.x results
but if I run this:
sudo ./scanner.pl | grep 3
OR
sudo ./scanner.pl | grep UP
then I get this:
10.0.2.3 - UP
10.0.3.5 - UP
10.0.3.6 - UP
But I only care about the last 2 results (3.5 and 3.6)
so I tried:
sudo ./scanner.pl | grep UP 3.
hoping that it would be able to grab the lines that have both of those parameters, but that doesnt work....
How do I specify 2 things to grab from one line?
For Example, I only want to display:
10.0.3.5 - UP
10.0.3.6 - UP
THANKS IN ADVANCE