troublesooting commands/files

hello,

A connection to a remote server is lost frequently.

what files should I check for any hardware or network problems?

how to check what NIC card is active? how to check if any NIC card has/had problems?

I am using RHEL4.

thx

Is this an SSH connection ? If yes, add the following line in /etc/ssh/ssh_config :
ServerAliveInterval 60
and see if it fixes the issue.
Else, troubleshooting NIC : dmesg | grep eth0 (#or appropriate NIC id), ethtool eth0 - to check the status, netstats -s - to check for dropped packets, collisions.

And ifconfig -a to see what network cards you have on which IP addresses in the first place. Perhaps route can help you figure out what connections use which routes.

System logging depends a lot on the platform, if dmesg is uninformative then messages.log or syslog.log might be worth looking at, as well as other files in /var/log (or wherever you have the logs). /etc/syslog.conf or some approximation will tell you how logging is set up but again, this is somewhat system-dependent; there are different syslog daemons and different conventions for how they are usually configured.