terrywashington
Technical User
I need to write a script to help Sun determine why one of our E450 NFS servers periodically generates an NFS error. I am assuming that the the script will run from the crontab almost constanlty as the error message only appears as a single line, randomly about once a week. The error is below.
systema unix: WARNING: nfsauth: mountd not responding^M
The script will need to execute the below commands when the error message is generated.
#ps -ef | grep mountd
find the pid of mountd, then....
#pstack <pid of mountd> > pstack.out
#truss -o /tmp/truss.out -aelf -wall -rall -vall -p <pid of mountd>
I am very new to script-writing and am not sure of the best way to go about this. Would an if statement that greps for nfsauth, then running the other commands be the best way to go? Any suggestions would be greatly appreciated.
systema unix: WARNING: nfsauth: mountd not responding^M
The script will need to execute the below commands when the error message is generated.
#ps -ef | grep mountd
find the pid of mountd, then....
#pstack <pid of mountd> > pstack.out
#truss -o /tmp/truss.out -aelf -wall -rall -vall -p <pid of mountd>
I am very new to script-writing and am not sure of the best way to go about this. Would an if statement that greps for nfsauth, then running the other commands be the best way to go? Any suggestions would be greatly appreciated.