Results 1 to 12 of 12
  1. #1
    Join Date
    Oct 2002
    Posts
    30

    Monitoring eth0 status

    Is there a way of monitoring if eth0 is up or not and if it isnt to restart the service.

    Thanks

  2. #2
    Join Date
    May 2003
    Posts
    472
    type 'ifconfig eth0'

  3. #3
    Join Date
    Jun 2003
    Location
    UK
    Posts
    6,601
    IF you can reach your server it means that eth0 is up. If you bring it down you will lose contact with the serve
    r
    Rus
    Russ Foster - Industry Curmudgeon

  4. #4
    Join Date
    Oct 2002
    Posts
    30
    I was more talking about a script running on the server which would monitor eth0 and if it wasnt responding to maybe restart the service or something.

  5. #5
    Join Date
    Jun 2003
    Location
    UK
    Posts
    6,601
    if [ -z "`/sbin/ifconfig eth0 | grep UP`" ] ; then /etc/init.d/network* restart ; done

    Rus
    Russ Foster - Industry Curmudgeon

  6. #6
    Join Date
    Apr 2003
    Location
    UK
    Posts
    2,560
    are you sure you arent just trying to make sure you still have a network connection, and if not try and re-establish one?

  7. #7
    Join Date
    Oct 2002
    Posts
    30
    No, last night we had a server go off because eth0 crashed. Just trying to stop it happening again.

    and if it does happen, im trying to get it restarted.

  8. #8
    Join Date
    Apr 2003
    Location
    UK
    Posts
    2,560
    ive not heard of an 'eth0 crash'

    what did logs (messages/dmesg) say?

    it might be better to work out why it went down in teh first place

  9. #9
    Join Date
    Oct 2002
    Posts
    30
    the one and only log msg... nothing had happened on the server for 5 minutes prior to this...

    May 24 22:53:06 **** kernel: eth0: Media Link Off

  10. #10
    Join Date
    Jun 2003
    Location
    UK
    Posts
    6,601
    That looks like someone pulled the cable out..

    Rus
    Russ Foster - Industry Curmudgeon

  11. #11
    Join Date
    Oct 2002
    Posts
    30
    Perhaps.

    Hence the need to check eth0 status and attempt to restart the network services if it is Down.

    btw, thanks for the script

  12. #12
    Join Date
    Apr 2003
    Location
    UK
    Posts
    2,560
    better to get a script to make it beep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •