Script to monitor amount of NCP connections

A customer of mine has multiple eDirectory servers. We noticed that the load of the servers various. The problem is that we did not know howmany connections are made to the particular server. So I wrote a simple scipt. If you put this script in /usr/local/bin and put it in your Cron for example of every 5 min you will get a pretty good overview.

#!/bin/bash
# Date: 18-12-2008
# Author: Michael Wilmsen
# Purpose: To display the amount of TCP connections and NCP connections
# Output: Date,Hostname,TotalConnections
echo “$(date ‘+%m/%d/%y %H:%M:%S’),$HOSTNAME,$(netstat -na | wc -l),$(netstat -an | grep “:524″ | wc -l),$(cat /proc/loadavg)”

The output is like this:

12/18/08 12:40:04,edirall201,3522,3253,4.50 3.49 3.80 5/412 24008

date time,hostname,#TCPConnections,#NCPConnections,load average

About Michael

Michael Wilmsen is a VMware training/consultant (no specific order) with more than 15 years in the IT industry. Main focus is VMware vSphere, Horizon View and Site Recovery Manager with a deepdive to performance.
Michael is VCDX 210, VCAP 4/5 certified, has been rewarded with the vExpert title from 2011, is a PernixPro, Nutanix Tech Champion and a Nutanix Platform Professional.

4 Comments to “Script to monitor amount of NCP connections”

  1. By Jasper, September 14, 2009 @ 09:24

    Hi,

    Just a quick question… What are ‘sound’ values for the number of NCP Connections to a fileserver? How would an overcrouded server look like in a network trace?

    Thanks,

    J

    • By Mike, September 14, 2009 @ 09:42

      Jasper, What do you mean with ‘sound’ values? When a server is to busy?
      I don’t think you can monitor this with a network trace. A better way is to use ncptop or just normal top (this is what the script also logs). If the load is more than the number of cores than the server is to busy.

      Obvious if you have 4 cores and the load is 3.8 this is high also. What do you experience?

      Mike

  2. By Jasper, September 14, 2009 @ 09:24

    Hi,

    Just a quick question… What are ‘sound’ values for the number of NCP Connections to a fileserver? How would an overcrouded server look like in a network trace?

    Thanks,

    J

    • By Mike, September 14, 2009 @ 09:42

      Jasper, What do you mean with ‘sound’ values? When a server is to busy?
      I don’t think you can monitor this with a network trace. A better way is to use ncptop or just normal top (this is what the script also logs). If the load is more than the number of cores than the server is to busy.

      Obvious if you have 4 cores and the load is 3.8 this is high also. What do you experience?

      Mike

RSS feed for comments on this post. TrackBack URI

Leave a Reply

You must be logged in to post a comment.