#!/bin/bash # # purp: diagnose novell datasync server logs # date: 27th september 2012 # auth: dan taylor [dan at taylor dot gen dot nz] # # log directory LOGD=/var/log/datasync LOGT=/scripts/tmp SYSADMIN="email@domain.com" #Can't stop, won't stop trap 'echo -e "" 1>&2' INT QUIT TERM clear ; echo ans=N while [ "x$ans"=xN ] do clear echo " Hello Datasync Admin - Maximise Window for Best Results" echo " " echo " A. Checks for active device threads, CTRL+C to EXIT" echo " B. Checks for THREADPOOL and pending queue, CTRL+C to EXIT" echo " C. Counts POA SLAPS [SecureLogin Attribute Provisioning], CTRL+C to EXIT" echo " D. Type of EVENTS coming from GroupWise" echo " E. Queue of tasks waiting to be synced from groupwise" echo " F. Queue of tasks waiting to be synced from engine" echo " G. Enter userID to run log trace on pipeline logs then email to sysadmin" echo " H. Run diag report on A-F then email to sysadmin" echo " J. Explanation of log files - Webadmin, Config + Sync Engine" echo " K. Explanation of log files - Connection Manager" echo " L. Explanation of log files - Connector Application Interface + Pipelines" echo " The following will continously show the last entries from each log file" echo " R. Webadmin - /webadmin/server.log" echo " S. Config Engine - /configengine/configengine.log" echo " T. Sync Engine - /syncengine/engine.log" echo " U. Connector Manager - /syncengine/connectorManager.log" echo " V. Connectors - /connectors/default.pipeline1.groupwise.log" echo " W. *Connectors - /connectors/default.pipeline1.groupwise-AppInterface.log" echo " X. Connectors - /connectors/default.pipeline1.mobility.log" echo " Y. *Connectors - /connectors/default.pipeline1.mobility-AppInterface.log" echo " Z. Exit" echo -e " Enter the letter for the required action A-Z: \c" read ans case ${ans} in A|a) echo " " echo "Active thread pools" echo " " echo "current time: CTRL+C to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/connectors/default.pipeline1.mobility-AppInterface.log | grep "Idle Threads" echo " " ;; B|b) echo " " echo "Threadpools and pending queue" echo " " echo "current time: CTRL+C to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/syncengine/engine.log | grep -i queue ;; C|c) echo " " echo "Count POA SLAPS [SecureLogin Attribute Provisioning]" echo " " echo "current time: CTRL+C to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log | grep queue ;; D|d) echo " " echo "Received event items from groupwise" echo " " echo "current time: Press ENTER to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " grep "Received event from GroupWise" $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log | tail -20 echo " " echo " Press ENTER to exit back to MENU!" read n ;; E|e) echo " " echo "Queue waiting groupwise" echo " " echo "current time: Press ENTER to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " grep "queue" $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log | tail -20 echo " " echo " Press ENTER to exit back to MENU!" read n ;; F|f) echo " " echo "Queue waiting engine" echo " " echo "current time: Press ENTER to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " grep "queue" $LOGD/syncengine/engine.log echo " " echo " Press ENTER to exit back to MENU!" read n ;; G|g) echo " " echo " Enter the users ID to start fault trace " while [ x"$USERID1" = x ]; do echo -e "\tLogin ID: \c" read -e USERID1 done USERID=`echo $USERID1 | tr "" "_"` ULOG=$LOGT/fault.trace.$USERID.`date +%F_%H.%M.%S`.txt ELOG=$LOGD/connectors/default.pipeline1.mobility-AppInterface.log ELOCK=`grep -i $USERID $ELOG | grep "LDAP authentication problem"` if [ $ELOCK -gt 0 ]; then LOCKSTATUS="Not Locked" else LOCKSTATUS="Logs indicate $USERID recently has LOCKED out" fi echo " " clear echo " " | tee -a $ULOG echo " Intruder Lockout status and last 10 entries in logs for selected user" | tee -a $ULOG echo " " | tee -a $ULOG echo " User ID: $USERID" | tee -a $ULOG echo " Date: `date`" | tee -a $ULOG echo " Server: `hostname` " | tee -a $ULOG echo " " | tee -a $ULOG echo " Intruder Lockout: $LOCKSTATUS" | tee -a $ULOG echo " " | tee -a $ULOG echo "--" | tee -a $ULOG echo "logfile1: default.pipeline1.groupwise-AppInterface.log" | tee -a $ULOG echo " " | tee -a $ULOG grep -i $USERID $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log | tail -10 | tee -a $ULOG echo " " | tee -a $ULOG echo "--" | tee -a $ULOG echo "logfile2: default.pipeline1.groupwise.log" | tee -a $ULOG echo " " | tee -a $ULOG grep -i $USERID $LOGD/connectors/default.pipeline1.groupwise.log | tail -10 | tee -a $ULOG echo " " | tee -a $ULOG echo "--" | tee -a $ULOG echo "logfile3: default.pipeline1.mobility-AppInterface.log" | tee -a $ULOG echo " " | tee -a $ULOG grep -i $USERID $LOGD/connectors/default.pipeline1.mobility-AppInterface.log | tail -10 | tee -a $ULOG echo " " | tee -a $ULOG echo "--" | tee -a $ULOG echo "logfile4: default.pipeline1.mobility.log" | tee -a $ULOG echo " " | tee -a $ULOG grep -i $USERID $LOGD/connectors/default.pipeline1.mobility.log | tail -10 | tee -a $ULOG echo " " | tee -a $ULOG echo "--" | tee -a $ULOG echo " Press ENTER to exit back to MENU" mailx -s "Mobilesync Log Trace for $USERID" $SYSADMIN < $ULOG read n ;; H|h) echo " " echo " Run DIAG report on items A thru F" 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: `hostname` " | tee -a $XLOG echo " #########################################" | tee -a $XLOG echo " " | tee -a $XLOG echo " # Option A. 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 " # Option B. 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 " # Option C. 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 " # Option D. 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 " # Option E. 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 " # Option F. 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 echo " Press ENTER to exit back to MENU" mailx -s "Diag Report for Datasync" $SYSADMIN < $XLOG read n ;; I|i) echo " " echo " RESERVED for future use, Press ENTER to go back to the menu " read n ;; J|j) clear echo " " echo " Novell Datasync Log Files - Web Admin, Config + Sync Engine" echo " " echo " # Web admin - /var/log/datasync/webadmin/server.log" echo "The Web Admin log file (server.log) reports problems with the Synchronizer" echo "Web Admin interface. Typically, you would not see problems here unless you" echo "edited the XML source for one of the Configuration pages and introduced" echo "invalid XML. If a Configuration page does not display correctly after you" echo "edit the XML source, you can check this log file for help resolving the" echo "problem with the XML." echo " " echo " # Config Engine - /var/log/datasync/configengine/configengine.log" echo "The Config Engine log file (configengine.log) reports on configuration" echo "setting changes made in Synchronizer Web Admin and on any effects of " echo "those changes on the connections between the Sync Engine and connectors." echo "It also logs issues with starting and stopping connectors and tracks" echo "the poll cycle for changes in LDAP groups." echo " " echo " # Sync Engine - /var/log/datasync/syncengine/engine.log" echo "The Sync Engine log file (engine.log) reports on events that pass through" echo "the Sync Engine as they transfer from connector to connector. It logs" echo "problems with the physical connection to each connector and with" echo "communication between connectors." echo " " echo " Press ENTER to return to main menu..." read n ;; K|k) clear echo " " echo " Novell DataSync Log Files - Connector Manager" echo " " echo " # Connector Manager - /var/log/datasync/syncengine/connectorManager.log" echo "The Connector Manager log file (connectorManager.log) reports problems" echo "with loading a connector with the configuration provided on the" echo "connector’s Configuration page." echo " " echo "The Connector Manager starts one Python thread for itself and an" echo "additional Python thread for each connector that it manages." echo "When you list Connector Manager threads or Python threads in a terminal" echo "window, you cannot tell which Python thread is associated with the" echo "Connector Manager and which Python thread is associated with each" echo "connector. The Connector Manager log file lists each component and the" echo "PID number associated with each one. This can be very useful for" echo "troubleshooting." echo " " echo " Press ENTER to return to main menu..." read n ;; L|l) clear echo " " echo " Novell DataSync Log Files - Connector Application Interface + Pipelines" echo " " echo " # Connector Application Interface log files" echo "The connector application interface log file for each connector" echo "(default.pipeline1.connector_name-AppInterface.log)" echo "reports on problems that occur during event processing by the connector." echo " " echo " # Connector Pipeline log files" echo "The connector pipeline log file for each connector" echo "(default.pipeline1.connector_name.log)" echo "reports on problems with the event XML files that transfer back and" echo "forth between the Sync Engine and the connector. It logs the results" echo "as events pass through filters and transformations." echo " " echo " Press ENTER to return to main menu..." read n ;; M|m) echo " " echo " RESERVED for future use, Press ENTER to go back to the menu " read n ;; N|n) echo " " echo " RESERVED for future use, Press ENTER to go back to the menu " read n ;; O|o) echo " " echo " RESERVED for future use, Press ENTER to go back to the menu " read n ;; P|p) echo " " echo " RESERVED for future use, Press ENTER to go back to the menu " read n ;; Q|q) echo " " echo " RESERVED for future use, Press ENTER to go back to the menu " read n ;; R|r) echo " " echo " Webadmin log - server.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/webadmin/server.log read n ;; S|s) echo " " echo " Config Engine - configengine.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/configengine/configengine.log read n ;; T|t) echo " " echo " Sync Engine - /syncengine/engine.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/syncengine/engine.log read n ;; U|u) echo " " echo " Connection Manager - syncengine/connectorManager.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/syncengine/connectorManager.log read n ;; V|v) echo " " echo " Connectors - connectors/default.pipeline1.groupwise.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/connectors/default.pipeline1.groupwise.log read n ;; W|w) echo " " echo " Connectors - connectors/default.pipeline1.groupwise-AppInterface.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/connectors/default.pipeline1.groupwise-AppInterface.log read n ;; X|x) echo " " echo " Connectors - connectors/default.pipeline1.mobility.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/connectors/default.pipeline1.mobility.log read n ;; Y|y) echo " " echo " Connectors - connectors/default.pipeline1.mobility-AppInterface.log" echo " " echo "current time: CTRL+C then Enter to exit back to MENU!" date "+%Y-%m-%d %H:%M:%S.%N" | cut -c 1-23 echo " " tail -f $LOGD/connectors/default.pipeline1.mobility-AppInterface.log read n ;; Z|z) echo " " echo " Good Bye";echo;exit;; esac done