I have an expect script that runs some basic commands on a router and writes the output to a logfile thats date stamped. This is part of morning checks, which are then emailed to me for me to review. I'm not a heavy unix user or programer, but what I'd like to do is create a small script to compare certain field or just pull out cetain fields redirect is another file which is then emailed What I'm wondering is what would be the best way to do the following tasks with which filtering command.
*search router1.270109 output file for the following line and output it to the file to be emailed. Note: the uptime changes. So I'd need to be able to pull the entire line.
BGP state = Established, up for 45w3d
* seach router1.270109 and router1.2601009
pull the interface resets or collisions from the 2 file and compare them and place the output to the file to be email.
1 output errors, 0 collisions, 1 interface resets
any help would be appreciated.
*search router1.270109 output file for the following line and output it to the file to be emailed. Note: the uptime changes. So I'd need to be able to pull the entire line.
BGP state = Established, up for 45w3d
* seach router1.270109 and router1.2601009
pull the interface resets or collisions from the 2 file and compare them and place the output to the file to be email.
1 output errors, 0 collisions, 1 interface resets
any help would be appreciated.