Tool

dantaylor's picture
tool
Reads:

2599

Score:
2.25
2.3
8
 
Comments:

1

Novell Data Synchronizer Log Diagnosing Tool

Author Info

5 October 2012 - 10:13am
Submitted by: dantaylor

(View Disclaimer)

license: 
nil

This is my first Cool Solution so go easy on me :)

This article is related to the Data Synchronizer server running on SLES11.

During the initial setup phase of our Datasync server and through to the troubleshooting with devices we had to access the logs frequently, this soon got rather cumbersome.

There must be a better way to diagnose these logs ... let's make something!

We have numerous non-Linux people in our Operations Team who will need ongoing access to these logs to diagnose issues and I needed a way for these people to quickly access the logs to locate the information, so I created a simple script.

This is just a simple bash script with letters to corresponding sequences that grep's and tail's files to show specific information easily.

Here is a screenshot of the interface start screen

Options A thru F are taken from the following link, under Connector Monitoring

Data Synchronizer Mobility Pack Best Practices >

They show:

  • Active Device Threads
  • Threadpool and pending queue
  • Counts POA slaps
  • Types of items coming from GroupWise
  • Queue of tasks waiting to be synced, on both GroupWise AppInterface and Sync Engines

Option G is one I thought would be useful, by entering the user's email ID the script will then search [grep] for that user's ID from the Pipeline logs.

Option H is handy as it runs options A thru F then emails the output to the system administrator.

Options J, K and L give a brief run down on the log files and what they log.

Options R thru Y continuously output the eight log files so you can watch them live.

Assuming that your log folder is under /var/log/datasync these actions will show you the information specified in each option.

At the top of each of these outputs the 'current time' has been configured to show the same format as the log files, this makes it easy to see when each entry has occurred.

After each option is selected the information from the log is displayed, some options simply search [grep] then display, other options will tail -f [continuously display] and a CTRL+C then ENTER is required to return back to the menu.

After you have explored the menu, selected a couple of options, seen the output and returned to the menu you will get the hang of it.

There are several things to confirm / check before running the script.

  1. the log folder, default is /var/log/datasync, change this if your location is different
  2. options G and H output to a file location under /scripts/tmp, change to /tmp is also fine
  3. specify an email address for the outputs to get sent to, this could be altered to prompt for input

The initial start screen has been optimized for the default putty screen size of 80x24, if you maximize the putty window you will be able to see more information.

Further development suggestion and possible modifications.

  1. build in a prompt for the sysadmin email address
  2. setup a datasync admin user login, add this script to be executed via the users profile, then the non-Linux person has to simply login then is presented with this interface
  3. add other options to perform more actions, have left I, M thru Q without actions, of course the screen would roll of the edge of the default putty window [80x24]
AttachmentSize
datasync.log_.check_.0.3.txt14.83 KB

Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

tokeeffefcc's picture

Using crontab to automate status

Submitted by tokeeffefcc on 3 June 2013 - 11:55am.

Hi

I added to your script by taking section H and tweaked the echos a little in order to have a status email automagically sent through crontab.

tim

<<>>
To edit cron job:
crontab -e

example running every 30 minutes:
*/30 * * * * /root/scripts/datasynccheck.sh

example of script. some variables will need to be edited for appropriate information

<<>>
#!/bin/bash

#######################################################
# Name: datasynccheck.sh
#
# Purpose: To diagnose Novell Datasync server logs
# Date: 27th september 2012
# Author: dan taylor [dan at taylor dot gen dot nz]
#
# Editor: Tim O'Keeffe, Frederick Community College
#
# Change control:
# 1. 6/03/2013 - Created new script to be used for cron job
# combined best features of both.
#######################################################

# Variables
# log directory
LOGD=/var/log/datasync
LOGT=/tmp
tree=yourtree
server=yourserver
EMAIL1=root
EMAIL2=admin1@yourdomain.com
EMAIL3=admin2l@yourdomain.com

#Can't stop, won't stop
trap 'echo -e "" 1>&2' INT QUIT TERM

# Generate unique timestamp for each file name
timestamp="$(date +'%m-%d-%I:%M')" #get timestamp to use on files
echo "Timestamp = $timestamp"

echo " "
XLOG=$LOGT/diag.report.A-F.`date +%F_%H.%M.%S`.txt
echo " " | tee -a $XLOG
echo " Datasync diag report" | tee -a $XLOG
echo " Date: `date`" | tee -a $XLOG
echo " Server: $server " | tee -a $XLOG
echo " Recipients: $EMAIL2,$EMAIL3 " | tee -a $XLOG
echo " ##########################################################" | tee -a $XLOG
echo " " | tee -a $XLOG

echo " #Active thread pools" | tee -a $XLOG
echo " " | tee -a $XLOG
echo "Current Time:" | tee -a $XLOG
date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 | tee -a $XLOG
echo " " | tee -a $XLOG
tail $LOGD/connectors/default.pipeline1.mobility-AppInterface.log | grep "Idle Threads" | tee -a $XLOG
echo " " | tee -a $XLOG
echo "--" | tee -a $XLOG

echo " #Threadpools and pending queue" | tee -a $XLOG
echo " " | tee -a $XLOG
echo "Current Time:" | tee -a $XLOG
date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 | tee -a $XLOG
echo " " | tee -a $XLOG
tail $LOGD/syncengine/engine.log | grep -i queue | tee -a $XLOG
echo " " | tee -a $XLOG
echo "--" | tee -a $XLOG

echo " #Count POA SLAPS [SecureLogin Attribute Provisioning]" | tee -a $XLOG
echo " " | tee -a $XLOG
echo "Current Time:" | tee -a $XLOG
date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 | tee -a $XLOG
echo " " | tee -a $XLOG
tail $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log | grep queue | tee -a $XLOG
echo " " | tee -a $XLOG
echo "--" | tee -a $XLOG

echo " #Received event items from GroupWise" | tee -a $XLOG
echo " " | tee -a $XLOG
echo "Current Time:" | tee -a $XLOG
date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 | tee -a $XLOG
echo " " | tee -a $XLOG
grep "Received event from GroupWise" $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log | tail -20 | tee -a $XLOG
echo " " | tee -a $XLOG
echo "--" | tee -a $XLOG

echo " #Queue waiting GroupWise" | tee -a $XLOG
echo " " | tee -a $XLOG
echo "current time:" | tee -a $XLOG
date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 | tee -a $XLOG
echo " " | tee -a $XLOG
grep "queue" $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log | tail -20 | tee -a $XLOG
echo " " | tee -a $XLOG
echo "--" | tee -a $XLOG

echo " #Queue waiting engine" | tee -a $XLOG
echo " " | tee -a $XLOG
echo "current time:" | tee -a $XLOG
date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 | tee -a $XLOG
echo " " | tee -a $XLOG
grep "queue" $LOGD/syncengine/engine.log | tee -a $XLOG
echo " " | tee -a $XLOG
echo "--" | tee -a $XLOG

mail -s "Diag Report for Datasync" $EMAIL1,$EMAIL2,$EMAIL3 < $XLOG

# End of Script

© 2013 Novell