ADSM-L

[no subject]

2015-10-04 17:27:37
Dan wrote:
> My org has determined that they'd like to incorporate ADSM into our
>existing alert infrastructure.   I figure it's a matter of parsing the event
>log, formatting the information, and writing it to a logfile.  The logfile is
>then read by a daemon, and forwarded to the Alert/Logging server.
>Failed/missed backups will result in a late-nite page. (Oh goody!).
>
>Before I go about doing this though, I'd like to know about methods you
>folks have used for monitoring ADSM, how it is architectured, and any code
>you'd care to share.
>
> No sense re-inventing the wheel.
>
> Best regards,
> Dan.

Dan,

Our primary storage pool are in libraries as too the copy pools.
We run 24/7/365 and the current offsite copies average 180G daily.
Not the largest setup in this list but enough to validate what we do.
The main problem we had was monitoring of the system to a point where the 
failure rate is *very* minimal.

Although I have many scripts and C code that do different task, I feel that 
this may give you a idea of what can be done once you have determined the 
specific monitoring needs.

This script is incomplete for its intended goal. (Since as Systems Admin I do 
my programming in the spare time, accounts for the *could be written better 
aspect also:)

1) Sometimes a session would *hang*, meaning that the transfer rate dropped to 
a unacceptable point.. but continue and never fail. The problem with this when 
overall you have about two hours out of twenty four to waste.. a slow session 
that normally takes twenty minutes may take three hours, runs all the 
schedules out of bounds and causes havoc.

2) A media of drive failure can have basically the same effect.

3) Some monitoring is required from the system level. IE: disk/drive/library 
errors that you have a monitoring process which notifies.

4) Monitoring sessions during a schedule without using to many system 
resources by having a constant process running, and/or constantly querying the 
adsm server.

What this does is allow for a defined time/rate array and then using a 
standard cron job call and passing the session name, the amount of system 
resources and adsm server queries are minimal. The result is great, now when a 
session falls below the threshold set I receive a page which has the threshold 
set value, current transfer bytes per second, session id, node, state, total 
seconds running. From this I can normally tell if there is a tape/drive 
problem or schedules running into each other.. etc..

I will have this perform certain task as I get additional logic related to 
processes and such.

Hope this helps some in what can be done if the need is determined.

Sincerely,
Bart Colbert

#!/bin/ksh
# Korn Shell Script
#
# adsm.chk.ses.sh
# This shell is designed to look for a node(client_name)
# which is provided as command line arg one running as
# a session.
#
# - If it exist determines the if the session is transfering
#   data within a defined threshold.
# - Session TYPE 1 is incremental backups.
# - Session TYPE 2 is SAP/Oracle backups.
#
# - Var TH2 uses a white space delimited array of 
time:K(time=minutes):(K=x1000)
#   they values shall begin with the greatest time and reduce
#
# Written By: Bart G. Colbert 09/20/1999
#
VERSION="0.18"
#
# SYNTAX: adsm.chk.ses.sh NODE
#
# Revisions:
#
# *) 01/25/2000 Bart Colbert V0.10
#    -Version 1.0 was completely revamped fromthe changes in the adsm
#     server.
#
# *) 02/15/2000 Bart Colbert V0.12
#    -After testing a lot of the debug outputs this version is cleaning
#     up misc commented out functions.
#    -Modified small if stanzas to inline format.
#
# *) 02/22/2000 Bart Colbert V0.13
#    -Added timestamp to dsmserv process not found.
#    -Set threshold flag before calling compare_th2_data();
#
# *) 02/28/2000 Bart Colbert V0.14
#    -Still in beta version, shifted to 0.
#    -Changed 4 minute threshold to 150,000 Bps.
#
# *) 02/29/2000 Bart Colbert V0.15
#    -Changed the get_process_info and parse_process_info functions
#     to use a C parse program, replacing the shell parsing for
#     improved performance of the script.
#
# *) 03/01/2000 Bart Colbert V0.16
#    -Changed the get_device_info and parse_drive_info functions
#     to use a C parse program. replacing the shell parsing for
#     improved performance of the script.
#
# *) 07/06/2000 Bart Colbert V0.17
#    -Changed TH vars 4:150 to 4:100, added 7:125.
#    -Changed page to include TH:BPS:SESID:NODE:STATE
#
# *) 09/05/2000 Bart Colbert V0.18
#    -Temporary fix for session time reporting at plus thirty days.
#     added a subtract thirty from the DAY when calc DURATION.
#     This change shall be removed once corrected.
#    -Changed page to include DURATION.
#
# INIT AND EXPORT VARS
#
typeset -i TRUE=0               # TRUE FLAG
typeset -i FALSE=1              # FALSE FLAG
APP_HOME="/home/radsm/bin"
typeset -i BYTESRECVPERSEC=0    # DATA VAR
CHECK_DEVICE_LIST="MEDIAW|IDLEW|IDLE"   # STATE LIST FOR DEVICE CHECKS
CHECK_DEVICES=""                # USED AS STORAGE
CLIENT=$1                       # NODE NAME FROM CMD ARG ONE
CM_HOME="/curamsg/cm35"
typeset -i COMPLETE=FALSE       # LOOP VAR
typeset -i COUNT=1              # START THE COUNT AT ONE
CWD=$(pwd)                      # GET THE CURRENT WORKING DIRECTORY
typeset -i DAY=0                # DAY VAR
typeset -i DEBUG=TRUE           # OPTION FLAG
typeset -i DEBUG_DETAILED=FALSE # OPTION FLAG
typeset -i DEVICE_MATCH=FALSE   # OPTION FLAG
typeset -i DURATION=0           # TIME IN SECONDS
EACHWORD=""                     # LOOP VAR
typeset -i HR=0                 # HOUR VAR
typeset -i INPUT_TP=TRUE        # SET INPUT THROUGHPUT
typeset -i LOOP_COUNT           # LOOP VAR
MACHINE=$(uname -n)             # HOSTNAME
typeset -i MIN=0                # MINUTE VAR
MOUNTEDINFO=""                  # LOOP VAR
typeset -i NEXT=FALSE           # LOOP VAR
typeset -i NUMBER_FIELDS=8      # SELECT SETTINGS
typeset -i NUMBER_SESSIONS      # SELECT SETTINGS
typeset -i NUMBER_WORDS         # SELECT SETTINGS
typeset -i OUTPUT_TP=FALSE      # SET OUTPUT THROUGHPUT
typeset -i SEC=0                # SECONDS
typeset -i SESID=0              # SESSION ID
typeset -i SES_TIME_MIN=TRUE    # SESSION IS LESS THAN MIN TH
# SESTYPE NODE NAME ARRAYS
SESTYPE1="MIDAS1 MIDAS2 MIDAS3 MIDAS4 MIDAS5_SW MIDAS9 MIDAS13 DNS NIS CWS"
SESTYPE2="PRD ORA_APPS TST ADMIN"
typeset -i THFLAG=FALSE         # THRESHOLD FLAG
# TH THRESHOLD TIME:K ARRAYS
TH2="240:200 225:200 210:200 195:200 180:200 165:200 150:200 135:200 120:200 
105:200 90:200 75:200 60:200 45:200
 30:200 15:200 7:125 4:100"
TIMESTAMP=$(date)               # DATE AT RUN TIME
# TYPE OF DEVICE VARS
TYPE1DEV="8MM"

TYPE2DEV="DLT"
SESTYPE1_DEVTYPE2="DLT_DRIVE_A|DLT_DRIVE_B"
SESTYPE2_DEVTYPE1="8MM"
SESTYPE2_DEVTYPE2="DLT_DRIVE_AA|DLT_DRIVE_AB"
#
# FUNCTION LAYOUT
#
# *) calc_bytes_recv_per_sec()
# *) check_for_match()
# *) compare_th2_data()
# *) get_drive_info()
# *) get_process_info()
# *) get_select_info()
# *) parse_process_info()
# *) process_cleanvar()
#
#####################
# BEGIN FUNCTION AREA
#####################


################
# BEGIN FUNCTION calc_bytes_recv_per_sec()
#
calc_bytes_recv_per_sec()
{
#
# IF BOTH VARS ARE GT ZERO
# CALCULATE THE BYTES RECEIVED PER SECOND
#
if [ BYTESRECV -gt 0 -a DURATION -gt 0 ];then BYTESRECVPERSEC=$(echo 
"${BYTESRECV}/${DURATION}" | bc); fi
if [ DEBUG_DETAILED -eq TRUE ]; then echo "[DEBUG_DETAILED ] @ 
calc_bytes_recv_per_sec()]\n"$BYTESRECVPERSEC; fi
#
# END FUNCTION calc_bytes_recv_per_sec()
##############
}


################
# BEGIN FUNCTION check_for_match
#
check_for_match()
{
if [ DEBUG_DETAILED -eq TRUE ]; then echo "[DEBUG_DETAILED @ 
check_for_match()]\n"$MATCHLIST; fi
MATCH_DEVICES=$(echo $MOUNTEDINFO | egrep -e "$MATCHLIST" | wc -l);
if [ MATCH_DEVICES -ne 0 ];then DEVICE_MATCH=TRUE; fi
#
# END FUNTCION check_for_match
##############
}


################
# BEGIN FUNCTION compare_th2_data()
#
compare_th2_data()
{
THFLAG=FALSE;
#
# PARSE EACH TH2 PAIR
#
for EACHPAIR in $TH2
        do
        #
        # SEPERATE PAIR
        #
        CMP_TH2_TIME=$(echo $EACHPAIR | cut -f 1 -d ":");
        CMP_TH2_BPS=$(echo $EACHPAIR | cut -f 2 -d ":");
        #
        # TEST TIME
        #
        if [ DURATION -ge $(echo "$CMP_TH2_TIME*60" | bc) -a THFLAG -eq FALSE 
];
                then
                THFLAG=TRUE;
                if [ DEBUG_DETAILED -eq TRUE ]; then echo "[DEBUG @ 
compare_th2_data()]DURATION GT $CMP_TH2_TIME
 MIN TH2 BPS $CMP_TH2_BPS"; fi
                if [ BYTESRECVPERSEC -le $(echo "$CMP_TH2_BPS*1000" | bc) ];
                        then
                        if [ DEBUG -eq TRUE ]; then echo "[DEBUG @ 
compare_th2_data()]BYTESRECVPERSEC LE $CMP_TH
2_BPS x1000"; fi
                        #
                        # SEND PAGE INFORMATION ON SESSION
                        #
                        $CM_HOME/cm_request -source "IT" \
                         -o "homer:c:page:ADSM" \
                         -m 
"TH:$CMP_TH2_BPS:BPSR=$BYTESRECVPERSEC:SESID=$SESID:$NODE:$STATE:TSEC=$DURATIO
N";
                fi
        fi
        done
#
# END FUNCTION compare_th2_data()
##############
}


################
# BEGIN FUNCTION get_device_info()
#
get_drive_info()
{
DEVICEINFO=$(dsmadmc -id=admin -password=XXXX "q mount" |\
egrep -v -e "^ADSTAR|^\(C\)|^Command|Server|Session|^-----|^ANS" |\
grep dev | tr '\n' ' ' | tr -d '.' | tr -d ":" | tr [a-z] [A-Z]);
echo $DEVICEINFO | $APP_HOME/adsm.q.mount.info
#
# END FUNCTION get_device_info()
##############
}

################
# BEGIN FUNCTION get_process_info()
#
get_process_info()
{
PROCESSINFO=$(dsmadmc -id=admin -password=XXXX\
        "select process_num, start_time, status from processes" |\
egrep -v -e "^ADSTAR|\(C\)|^Command|Server|Session|^----|^ANS" |\
 tr '\n' ' ' | tr -d ',' | tr -d ':' | tr -d '(' | tr -d ')' | tr [a-z] 
[A-Z]);
#
# END FUNCTION get_process_info()
##############
}

################
# BEGIN FUNCTION get_select_info()
#
get_select_info()
{
SELECTINFO=$(dsmadmc -id=admin -password=XXXX\
 "select session_id as \"SESID\", client_name as \"NODE\", state as \"STATE\", 
current_timestamp-start_time as \
"DURATION\", cast(bytes_sent as decimal(18,0)) as \"BYTESSENT\", 
cast(bytes_received as decimal(18,0)) as \"BYTE
SRECV\" from sessions where client_name='$CLIENT'" |\
 egrep -v -e "^ADSTAR|\(C\)|^Command|Server|Session|^----|^ANS" |\
 tr '\n' '@' | tr [a-z] [A-Z])
if [ DEBUG_DETAILED -eq TRUE ]; then echo "[DEBUG @ 
get_select_info()]\n"$SELECTINFO; fi
#
# END FUNCTION get_select_info
##############
}


################
# BEGIN FUNCTION parse_process_info()
#
parse_process_info()
{
echo $PROCESSINFO | $APP_HOME/adsm.select.process.info
echo ""
#
# END FUNCTION parse_process_info()
##############
}


################

################
# BEGIN FUNCTION process_cleanvar()
#
process_cleanvar()
{
#
# STRIP OUT THE @'s
#
CLEANVAR=$(echo $EACHVAR | tr -d '@');
#
# TEST FOR NULL VARS
#
if [ -n "$CLEANVAR" ];
        then
        #
        # CHECK THE COUNT VALUE AND IF THE CLEANVAR IS A HEADER
        #
        if [ COUNT -eq 8 -a ${CLEANVAR} != "SESID" ];then SESID=${CLEANVAR}; 
fi
        if [ COUNT -eq 7 -a ${CLEANVAR} != "NODE" ];then NODE=${CLEANVAR}; fi
        if [ COUNT -eq 6 -a ${CLEANVAR} != "STATE" ];then STATE=${CLEANVAR}; 
fi
        if [ COUNT -eq 5 -a ${CLEANVAR} != "DURATION" ];then DAY=${CLEANVAR};
        #
        # 09/05/2000 TEMPORARY FIX FOR NEW ADSM SERVER ON MIDAS13
        # REPORTING ALL SESSIONS RUNNING AT PLUS THIRTY DAYS
        # SUBTRACTING #) FROM DAY
        #
                if [ DAY -ne 0 ];then DURATION=$(echo "(${DAY}-30)*(24*3600)" 
| bc); fi
        fi
        if [ COUNT -eq 4 -a ${CLEANVAR} != "BYTESSENT" ];
                then
                HR=$(echo ${CLEANVAR} | cut -f 1 -d ":");
                if [ HR -ne 0 ];then DURATION=$(echo 
"(${HR}*3600)+${DURATION}" | bc); fi
                MIN=$(echo ${CLEANVAR} | cut -f 2 -d ":");
                if [ MIN -ne 0 ];then DURATION=$(echo 
"(${MIN}*60)+${DURATION}" | bc); fi
                SEC=$(echo ${CLEANVAR} | cut -f 3 -d ":");
                if [ SEC -ne 0 ];then DURATION=$(echo "${SEC}+${DURATION}" | 
bc); fi
        fi
        if [ COUNT -eq 3 -a ${CLEANVAR} != "BYTESSENT" ];then 
BYTESSENT=${CLEANVAR}; fi
        if [ COUNT -eq 2 -a ${CLEANVAR} != "BYTESRECV" ];then 
BYTESRECV=${CLEANVAR}; fi
        #
        # DEINCREMENT THE COUNT
        #
        COUNT=COUNT-1;
fi
if [ DEBUG_DETAILED -eq TRUE ];then
        echo "[DEBUG_DETAILED @ process_cleanvar() ]";
        echo 
"$SESID:$NODE:$STATE:$DAY:$HR:$MIN:$SEC:[$DURATION]:$BYTESSENT:$BYTESRECV";
fi
#
# END FUNCTION process_cleanvar()
##############
}


###################
# END FUNCTION AREA
###################

################
# BEGIN RUN AREA
################
if [ DEBUG_DETAILED -eq TRUE ]; then echo "Started $0 $1 @ $TIMESTAMP"; fi
#
# CHECK FOR ADSM SERVER RUNNING
#
COUNT=$(ps ax | grep dsmserv | grep -v grep | wc -l)
if [ "$COUNT" -eq 0 ];then
        if [ DEBUG -eq TRUE ];
                then
                echo "[DEBUG @ ps chk for dsmserv] exiting no dsmserv 
"$TIMESTAMP;
        fi
        exit 0
fi

#
# CHANGE TO APPLICATION HOME
#
cd $APP_HOME

#
# CHECK FOR THE SESSION ARGV 1
#
NUMBER_SESSIONS=$(dsmadmc -id=admin -password=XXXX q ses | grep $CLIENT | wc 
-l)
if [ "$NUMBER_SESSIONS" -eq 0 ];then
        if [ DEBUG_DETAILED -eq TRUE ]; then echo "[DEBUG @ NUMBER_SESSIONS = 
0]"; fi
fi
#
# IF SESSION IS RUNNING EMAIL INFO
#
if [ "$NUMBER_SESSIONS" -gt 0 ];
        then
        get_select_info;
        get_process_info;
        parse_process_info;
if [ $(echo $SESTYPE1 | grep $CLIENT | wc -l) = 1 ];
        then
        echo "Session TYPE 1";
        MATCHLIST=$(echo $SESTYPE1_DEVTYPE2);
        get_drive_info;
fi

if [ $(echo $SESTYPE2 | grep $CLIENT | wc -l) = 1 ];
        then
        if [ DEBUG -eq TRUE ]; then echo "Run:$0 $1 $TIMESTAMP SESTYPE2"; fi
        #
        # PARSE THROUGH THE WORDS IN SELECTINFO
        #
        for EACHVAR in $SELECTINFO
                do
                #
                # CALL THE process_cleanvar FUNCTION TO WORK FOR EACHVAR
                #
                process_cleanvar;
                        #
                        # IF WE ARE DOWN TO ONE CHECK
                        #
                        if [ COUNT -eq 1 -a SESID -gt 0 ];
                                then
                                #
                                # CHECK THE SECONDS RUNNING HERE
                                #
                                for TMP in $TH2;do test -z $TMP;done;
                                TMP=$(echo $TMP | cut -f 1 -d ":");
                                if [ DURATION -le $(echo $TMP | awk '{print 
$1"*60"}' | bc) ];
                                        then
                                        if [ DEBUG -eq TRUE ];
                                                then
                                                echo "SES $CLIENT LE $TMP 
MIN";
                                        fi
                                        if [ DEBUG_DETAILED -eq TRUE ];
                                                then
                                                echo "[ DEBUG @ check minimum 
time] DURATION LE $TMP MIN";
                                        fi
                                        SES_TIME_MIN=TRUE;
                                else
                                        SES_TIME_MIN=FALSE;
                                fi
                                #
                                # CHECK CONDITIONS BEFORE
                                # GETTING DRIVE INFO
                                # $STATE CAN BE
                                #
                                if [ $(echo $STATE | egrep -e 
"$CHECK_DEVICE_LIST" | wc -l) -ne 0 -a SES_TIME_MI
N -eq FALSE ];
                                        then
                                        get_drive_info;
                                fi
                                #
                                # CALL FUNCTION calc_bytes_recv_per_sec()
                                #
                                #
                                calc_bytes_recv_per_sec;
                                #
                                #
                                #
                                if [ INPUT_TP -eq TRUE -a SES_TIME_MIN -eq 
FALSE ];
                                        then
                                        echo 
"[SES=$SESID:NODE=$NODE:STATE=$STATE:TSEC=$DURATION:BPS=$BYTESRECVP
ERSEC]"
                                        #
                                        # SET THRESHOLD FLAG TO FALSE AND RUN 
FUNCTION
                                        #
                                        compare_th2_data;
                                fi
                                #
                                # RESET VALUES
                                #
                                SES_TIME_MIN=TRUE;
                                BYTESRECVPERSEC=0;
                                COUNT=NUMBER_FIELDS;
                                DURATION=0;
                        #
                        # END CHECK
                        #
                        fi
                #
                # BEGIN CHECK FOR THE HEADER TEXT BYTESRECV BEFORE STARTING
                #
                if [[ ${CLEANVAR} = "BYTESRECV" ]];then COUNT=NUMBER_FIELDS; 
fi
        done
fi
fi


#
# RETURN TO ORGINAL LOCATION
#
cd $CWD

#
# EXIT CLEAN
#
exit 0

/***********************************************************
** adsm.select.process.info.c: Parse select process info  **
** from passed arg in ksh.                                **
** Written By: Bart G. Colbert ANSI C 02/2000             **
***********************************************************/

/*
 * RCS INFO
 */
static char _rcsid[] = "@adsm.select.process.info.c V1.1 ANSI C 02/2000 Bart 
G. Colbert\n";

/***********************************************************
** *) 03/06/2000 Bart Colbert V1.1
**    Added a check for the trailing zeros on the process
**    time (PTIME). The DSM### was ending the string with a
**    period (.) in the same position as the time and being
**    yanked before the volume check.
***********************************************************/

/*
 * INCLUDE STANDARD PREPROCESSOR HEADER FILES
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*
 * DEFINE GLOBAL CONSTANTS
 */
#define MAXSTR 80

/*
 * INIT GLOBAL VARS
 */

/*
 * DECLARE ANSI FUNCTION DEFINITIONS
 */
int main ( int argc, char **argv[] );

/*
 * BEGIN MAIN FUNCTION
 */
int main ( int argc, char **argv[] )
{
/*
 * INIT AND LOCAL VARS
 */
char inbuffer[65384];
char *token;
char previous2[80] = "";
char previous_token[80] = "";
char process_date[11];
char process_time[14];
int loop;
int process_id;
int stringlength;
unsigned NEXT1, NEXT2;

/*
 * GRAB THE STANDARD INPUT IN ONE 64K CHUNK
 */
fgets ( inbuffer, 65383, stdin );

/*
 * TOKENIZE THE STRING OF INPUT DATA
 */
token = strtok ( inbuffer, " " );

/*
 * MAKE SURE FIRST IS PROCESS_NUM
 */
if ( strcmp ( token, "PROCESS_NUM" ) == 0 ) {
        /*
         * NOW PARSE THE NEXT TWO FIELD HEADERS OUT
         */
        token = strtok ( NULL, " " );
        token = strtok ( NULL, " " );
        }
else
        {
        exit ( 0 );
        }

/*
 * BEGIN DO WHILE TOKEN NE NULL
 */
do
{
token = strtok ( NULL, " " );
stringlength = strlen ( token );
strcpy ( previous2, previous_token );
for ( loop=0; loop<stringlength; loop++ ) {
        previous_token[loop] = token[loop];
        }
        previous_token[loop] = '\0';
/*
printf ( "[[PREV:%s:PREV2:%s]]\n", previous_token, previous2 );
*/

if ( (token[4] == '-') && (token[7] == '-') ) {
        process_id = atoi( previous2 );
        strcpy ( process_date, token );
        printf ( "\nSTART:PID:%d:DATE:%s:", process_id, process_date );
        }


if ( (token[6] == '.') && (token[7] == '0') ) {
        strcpy( process_time, token );
        printf ( "PTIME:" );
        for ( loop=0; loop<4; loop++ ) {
                printf ( "%c", process_time[loop] );
                }
        printf ( ":" );
        }
if ( strcmp ( token, "POOL" ) == 0 ) {
        if ( (previous2[0] != '(') && (strcmp ( previous2, "STORAGE" ) != 0) ) 
{
                printf ( "POOLTYPE:%s:", previous2 );
                }
        }

if ( (strcmp ( token, "SAPBKP_DLT_POOL" ) == 0) || (strcmp ( token, 
"SAPCOPY_DLT" ) == 0) ||\
(strcmp ( token, "BACKUP_DLT_POOL" ) == 0) || (strcmp ( token, "BKP_DLT_COPY1" 
) == 0) ||\
(strcmp ( token, "SAPLOG1" ) == 0) || (strcmp ( token, "SAPLOG2" ) == 0) ) {
        printf ( "STGPOOL:%s:", token );
        }

if ( strcmp ( token, "BACKED" ) == 0 ) {
        printf ( "BACKED:%s:", previous2 );
        }

if ( strcmp ( previous2, "UP" ) == 0 ) {
        printf ( "UP:%s:", token );
        }

if ( NEXT1 == TRUE ) {
        NEXT1 = FALSE;
        if ( token[6] == '.' ) {
                token = strtok ( NULL, " " );
                }
        if ( token[stringlength-1] == '.' ) {
                token[stringlength-1] = '\0';
                }
        if ( token[stringlength-2] == '.' ) {
                token[stringlength-2] = '\0';
                }
        printf ( "VOLUME:%s:", token );
        }

if ( (strcmp ( token, "VOLUME" ) == 0) && (previous2[4] != '-') ) {
        printf ( "VOLTYPE:%s:", previous2 );
        NEXT1 = TRUE;
        }
if ( strcmp ( token, "MOVED" ) == 0 ) {
stringlength = strlen ( token );
strcpy ( previous2, previous_token );
for ( loop=0; loop<stringlength; loop++ ) {
        previous_token[loop] = token[loop];
        }
        previous_token[loop] = '\0';
        token = strtok ( NULL, " " );
stringlength = strlen ( token );
strcpy ( previous2, previous_token );
for ( loop=0; loop<stringlength; loop++ ) {
        previous_token[loop] = token[loop];
        }
        previous_token[loop] = '\0';
        token = strtok ( NULL, " " );
        printf ( "MOVED:%s:%s:", previous_token, token );
}

if ( strcmp ( token, "WAITING" ) == 0 ) {
        printf ( "MEDIAW:" );
        }

if ( strcmp ( token, "SECONDS" ) == 0 ) {
        printf ( "SEC:%s:", previous_token );
        }

if ( strcmp ( token, "EXAMINED" ) == 0 ) {
        printf ( "EXPIRE:" );
        }
/*
 * END DO WHILE TOKEN NE NULL
 */
}while ( token != NULL );


/*
 * END MAIN FUNCTION
 */
}

Some of the cron schedules:

#
# PRD_BR0535 LOG SESSION
# 
40,45,50 5 * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
53 5 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
0,10,20 6 * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
3,13,23 6 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
#
# PRD_BR1035 LOG SESSION
# 
40,45,50 10 * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
53 10 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
0,10,20 11 * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
3,13,23 11 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
#
# PRD_BR1305 LOG SESSION
# 
10,15,20,30,40,50 13 * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
23,33,43,53 13 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
#
# PRD_BR1605 LOG SESSION
# 
10,15,20,30,40,50 16 * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
23,33,43,53 16 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
#
# TST
#
10,20,30,40,50 17 * * * /home/radsm/bin/adsm.chk.ses.sh TST
>>/monitor/log/adsm.chk.ses.log
3,13 18 * * * /home/radsm/bin/adsm.chk.ses.sh TST
>>/monitor/log/adsm.chk.ses.log
#
# ORA_APPS
#
10,15,20,30,40,50 18 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
35,45,55 20 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
5,15,25,35,45,55 21 * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
#
# PRD
#
10,20,30,40,50 22  * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
0,10,20,30,40,50 23  * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
0,10,20,30,40,50 0  * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
0,10,20,30,40,50 1  * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
0,10,20,30,40,50 2  * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
3,13,23,33,43,53 2  * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
0,10,20,30,40,50 3  * * * /home/radsm/bin/adsm.chk.ses.sh PRD
>>/monitor/log/adsm.chk.ses.log
3,13,23,33,43,53 3  * * * /home/radsm/bin/adsm.chk.ses.sh ORA_APPS
>>/monitor/log/adsm.chk.ses.log
<Prev in Thread] Current Thread [Next in Thread>
  • [no subject], Unknown <=