Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cheking ethernet status

Status
Not open for further replies.

TDdata

Technical User
Oct 21, 2008
1
0
0
US
Hi,


I need a script for redHat that will monitor all the installed ethernet cards and if one of them goes down it will put others down as well.

What i thought is ,writing a script to get a file output of the ethernet status one by one. and check whether the file name is exist or not. If file is there stop other ethernet cards. I put a crontab entry for every second checking.

I am sure someone knows a better way. Can you please advice?


Kind Regards
 
That is a strange requirement... out of curiosity, why do you want to do this?

cron can't run jobs every second; a better way would be to write a script that loops continuously, sleeping for a second between each loop.

You can use the ethtool command to check the state of each interface (check for "Link detected: yes"). No need to create files, you can just use the logic in your script to offline the other interfaces as soon as one is discovered that is down.

Annihilannic.
 
I'd also be interested in why...
There might be a better solution...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top