I primarily work on files that lie on an NFS mounted network share. Since a recent IT upgrade, the network connection to this NFS mount seems sketchy -- every day, a couple of times during my work, I lose connectivity for a couple of seconds, causing programs to freeze or shut down, error messages like "cannot find file" when I try to save files with modifications that are open in my IDE, etc.
IT support are asking for detailed error reports before they start fixing the problem, which I cannot give them beyond "I couldn't save/copy/write this file, and then 10 seconds later I could" at the moment.
My questions are
- is there a logging utility that I can leave running in the background to monitor the connection to the NFS mount (can i get nfsiostat or icpld to do what I need, for example?) so i can just send the log to IT support after I encounter this issue for them to examine?
- how would I set up such a logger so that it contains enough / the right kind of info for them to figure out the issue?
1 Answer
It's a bit weird that you need to give proof that something is wrong but anyway, it seems to be a fact of life, so: depending on what you want/need/know, you could:
These two together:
ping -D -i 2 1.2.3.4 > /var/log/ServerName.login one minimised terminal andtail --follow /var/log/ServerName.login the other. The first couple of hours when something goes wrong have a look and see whether it's network-related or not.
AND
A script, running on your local machine that renames a file every 2 seconds on one of your NFS directories and logs the times when it cannot.
#!/bin/bash while true do mv /szNFSMount/TestFile.1 /szNFSMount/TestFile.2 if [ $? -ne 0 ]; then echo $(date) >> /var/log/NFSMount.log fi sleep 2 mv /szNFSMount/TestFile.2 /szNFSMount/TestFile.1 if [ $? -ne 0 ]; then echo $(date) >> /var/log/NFSMount.log fi sleep 2 done
Why these two together? ping is extremely low level: data link layer and the other one is extremely high level: Application layer. Together they make for unrefutable proof.
- Do NFS debugging... It's tricky stuff and you need to have root access to your own machine. Do you???