Monitoring Many Traces at Once

0 Likes
over 13 years ago
In my development environment, and even some of my production clients, I run multiple instances of eDirectory on one server to support the various directories. This methodology and script will help you display multiple traces from multiple drivers and multiple instances all at once on Linux.

Whenever I am dealing with multiple drivers, I find it helpful to be able to watch the traces - both the global trace and all the individual traces.

I usually work on a SLED desktop because the toolset is much better, so this discussion assumes a Linux desktop and also a Linux server.

I take advantage of SSH to make this happen, so you need to have sshd running on the Linux server.

Assumptions

Each monitored driver has the DirXML-TraceFile attribute set to place their files in one directory - in my case, /var/opt/novell/log - and each file is named with drivername_log.

I am assuming running this as root. The scripts also assume the default installation locations to find the instances.0 file.

Using the Script

I place this script in /usr/bin and name it trace.idm.


################BEGIN SCRIPT##################
#!/bin/bash

directory=/var/opt/novell/log

for file in $( ls $directory/*log )
do
echo "xterm -T $file -e 'tail -f <$directory/$file' &"
xterm -T $file -e "tail -f <$file" &
done

cat /etc/opt/novell/eDirectory/conf/.edir/instances.0 | while read line
do
echo $line
treename=`cat $line|grep n4u.base.tree-name`
TREE=${treename:19}
xterm -T $TREE -e "ndstrace --config-file $line" &
done
################END SCRIPT##################



To use this, I ssh into my Linux server from my SLED client using a command similar to this:


ssh -X root@192.168.230.100



The -X switch allows the X Windows client on the Linux server to use the client workstation as an X Server. It should be noted that this is sometimes considered a questionable long term security practice, so this might be something you do only for test system purposes.

On the Linux server, in this SSH window, enter trace.idm. Your workstation will have a number of windows appear. For each driver the log file will be tailed, so you have black-on-white windows containing the individual driver traces tailed with the -f switch, so they act as a live log. You will also get, for each instance, a white-on-black ndstrace screen. Note: If you want IDM info, you will need to enter "ndstrace DVRS DXML" in those trace screens.

Tags:

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended