NDSD Process Monitor

NDSD Process Monitor

NDSD Process Monitor is an automated tool to collect the NDSD process statistics like the number of connections on ports (389, 636, 524), Total Memory, Virtual Memory, Thread and CPU Usage by NDSD process on a Novell eDirectory Server. This is a Cross-Platform (Linux, AIX, SunOS) tool based on BASH Scripting.

Steps to run the tool.


  1. Just download the "NDSD_PROCESS_Monitor.tar.gz"

  2. Extract it (#tar -zxvf NDSD_PROCESS_Monitor.tar.gz)

  3. Just Do!




# ./NDSD_PROCESS_Monitor

usage: ./NDSD_PROCESS_Monitor options

This script will get defined process statistics.

Mandatory OPTIONS:

-o Os Name or Platform :: Linux / SunOS / AIX :: Default: Mandatory from out of three
-H IP of the HOST :: Default: Mandatory
-m e-Mail ID for sending alert massages

OPTIONS:
-f Log file name with path :: Default: /var/tmp/YYYYMMDD_HHMM.log
-h To show this message
-i Interval between two different stat of Process :: Must be in Second :: Default: 30
-c Check for ndsd core at every given interval on given location :: default: /var/opt/novell/eDirectory/data/dib

Examples:

./NDSD_PROCESS_Monitor -h

To show this message

$0 -o Linux -H XXX.XXX.XXX.XXX -m your@email.com

To get "ndsd" pocess statistics

$0 -o AIX -H XXX.XXX.XXX.XXX -m your@email.com -i 60 -f /root/tmp/ndsd_process_stat.log
.
To get "ndsd" process statistics on AIX platform for every 60 seconds

#



Note: Tool has been tested with all SLES version, Solaris 10, AIX 5.3. Please comment for any Support / BUG related to tool.


 
 
 
Labels (1)
Attachments

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Comments
You say, that you tested it with all SLES versions, but my SLES 9 and 10 return, when I issue command hostname, an alias, which is hostname without domain. But when you test actual hostname against IP address which was in command line, you read second column from /etc/hosts :


local ACT_HOSTNAME=`hostname`
### locate the hostname from /etc/hosts file using supplied IP ###
local GET_HOSTNAME_FILE=`cat /etc/hosts | grep $IP | awk '{print $2}'`


where isn't alias, but whole hostname with domain name. Your code should be :


local ACT_HOSTNAME=`hostname`
### locate the hostname from /etc/hosts file using supplied IP ###
local GET_HOSTNAME_FILE=`cat /etc/hosts | grep $IP | awk '{print $3}'`


or


local ACT_HOSTNAME=`hostname -f`
### locate the hostname from /etc/hosts file using supplied IP ###
local GET_HOSTNAME_FILE=`cat /etc/hosts | grep $IP | awk '{print $2}'`


Second code snippet check FQDN with hostname -f against second column, where is placed FQDN record for servers hostname.
Bug 1)
PATH is not set. If /usr/sbin is not in the path of the caller, the script does not work.
Bug 2)
IP address should be compared. Resolve IP from name using getent e.g.:
if [ "$IP" != `getent hosts "$ACT_HOSTNAME" | awk '{print $1}'` ]
Bug 3)
non printable characters in getopts. I guess this is a sideeffect from the wish to use a question mark in the options. The correct way to do this is to quote the options argument of getopts e.g.:
while getopts 'hf:i:o:p:t:H:c:m:?' OPTION
Bug 4)
possibly empty variables are not quoted.
Line 451 reads
if [ -z $OS ] || [ -z $HOST_IP ] || [ -z $EMAIL_ID ]
what on Solaris leads to error message, when called like shown above. Should be e.g.
if [ -z "$OS" -o -z "$HOST_IP" -o -z "$EMAIL_ID" ]
Bug 5)
Program uses top . top is normally not present on vanilla Solaris.
Bug 6)
Program gives no notable output (while i wonder, what is useful in the output of this program at all), if the TCP ports have been changed. In the script 389 and 636 are hardcoded.
Insufficiency 1)
The implemented hardcoded escape sequences work only in terminals of certain type and break normal editors when inspecting the produced logfile using vi or whatever. Better don't use fancy coloury escape sequences at all.
Insufficiency 2)
Program could trivially made working with sh. Just leave off "function",
so bash is not needed. bash is not necessarily present on Solaris.
Strangeness 1)
Download is a .tar.gz and there is only 1 file inside. So why tar ?
Strangeness 2)
Why must the platform and IP-address be given, if it is determined automatically
anyway and compared ?

Overall opinion: The benefit of the program is ridiculous compared to the effort to make it work. Most stuff could better be determined using ps -o ... , lsof instead of looking into /proc/.... Thus being root would be mostly avoidable.
The program has probably been tested on Solaris, but obviously with a Solaris installation, that has been extended by programs, that do not come with the normal image.
Top Contributors
Version history
Revision #:
3 of 3
Last update:
‎2020-03-10 17:30
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.