logo       

Re: Maintenance_Mode Rule: msg#00186

sysutils.tivoli.tme10

Subject: Re: Maintenance_Mode Rule


I'm not entirely sure what you're trying to do, so I'll give advice as best I can.

First, you have a time window on your first_instance (the -86400 -0) which  limits the search to events in the cache that are 86400 seconds old (24 hours). Any CCE_SysMaint where maint='CLOSED' that comes in 24 hours after the last CCE_SysMaint with status='OPEN' will not match. Either expand the window or remove it entirely to search for any previous event in the event cache.

If you want the CCE_SysMaint where maint='OPEN' to automatically expire after 24hrs (become CLOSED), then you'll have to implement some sort of timer or external function to close the event after 24 hrs. Nothing that I you have provided will perform this function.

Hope this helps....
Bob


gmendes@xxxxxxxxxxxxxx
Sent by: owner-tme10@xxxxxxxxxxxxxxxx

11/15/2004 05:05 PM

Please respond to
tme10@xxxxxxxxxxxxxxxx

To
tme10@xxxxxxxxxxxxxxxx
cc
Subject
[tme10] Maintenance_Mode Rule





Hello All,

This rule is for maintenance of systems and when the administrator of the
box runs this script it sends a wpostemsg to the TEC saying that a
specified system has been put in maintenance mode.

Start Maintenance Mode Script:

##########################################################
########### DEFINE FILES AND VARIABLES HERE ##############
##########################################################
. /etc/Tivoli/lcf/1/lcf_env.sh
LOGFILE=/tmp/esm_start_maintenance.log.$(date +%y.%m.%d_%H:%M)

engineer_id=""
engineer_name=""

##########################################################
############## DEFINE FUNCTIONS HERE #####################
##########################################################


##########################################################
################# BEGINNING OF MAIN ######################
##########################################################
exec > $LOGFILE 2>&1


engineer_id=`lsuser -a gecos $SUDO_USER`
engineer_name=${engineer_id#*=}

echo "Start of Maintenance, sending a message to TEC to inform Production
Control"
$LCF_BINDIR/../bin/wpostemsg -m "Start of Maintenance ($engineer_name)"
maint=OPEN hostname=`hostname`
CCE_SysMaint Unix


This rule then suppresses all events from posting from this origin and
after 24 hours it takes the event that was opened and closes it based on no
action taking by the administrator to take the system out of
maintenance_mode with a stop maintanance script.

Stop Maintenance Mode Script:

#
##########################################################
########### DEFINE FILES AND VARIABLES HERE ##############
##########################################################
. /etc/Tivoli/lcf/1/lcf_env.sh
LOGFILE=/tmp/esm_stop_maintenance.log.$(date +%y.%m.%d_%H:%M)

engineer_id=""
engineer_name=""

##########################################################
############## DEFINE FUNCTIONS HERE #####################
##########################################################


##########################################################
################# BEGINNING OF MAIN ######################
##########################################################
exec > $LOGFILE 2>&1

engineer_id=`lsuser -a gecos $SUDO_USER`
engineer_name=${engineer_id#*=}

echo "End of Maintenance, sending a message to TEC to inform Production
Control"
$LCF_BINDIR/../bin/wpostemsg -m "End of Maintenance ($engineer_name)"
maint=CLOSED hostname=`hostname`
CCE_SysMaint Unix


The problem we have is that the rule doesn't not close the event after 24
hours.  With a quick glimpse, can anyone tell why the event doesn't close
after 24 hours?

Maintenance Mode Rule:


%
%  Suppress events for machines in maintenance
%
rule:  cce_suppress_maint_events:
(

event: _ev of_class outside ['CCE_SysMaint']
where [

hostname: _hostname
],


action: suppress_event: (
first_instance(event: _found_ev of_class 'CCE_SysMaint'

where [ hostname: equals _hostname,
status: equals 'OPEN',
maint: equals 'OPEN'

],
_ev - 86400 -0),

set_event_status(_ev,'CLOSED'),
bo_set_slotval(_ev,administrator,'System is in maintenance mode'),
link_effect_to_cause(_ev,_found_ev),
commit_set

)
).


%
%  End system maintenance
%
rule:  cce_close_maintenance_window:
(

event: _ev of_class 'CCE_SysMaint'
where [ hostname: _hostname,

maint: equals 'CLOSED'
],


action: close_maintenance_windows: (
first_instance(event: _found_ev of_class 'CCE_SysMaint'

where [ hostname: equals _hostname,
status: equals 'OPEN',
maint: equals 'OPEN'

],
_ev - 86400 -0),

link_effect_to_cause(_found_ev,_ev),
change_event_status(_found_ev,'CLOSED'),
bo_set_slotval(_found_ev,administrator,'Maintenance mode ended'),
set_event_status(_ev,'CLOSED'),
bo_set_slotval(_ev,administrator,'Maintenance mode ended'),
commit_set

)
).


All thoughts and suggestion are greatly appreciated.


Regards,

Gregory R. Mendes
ESM Technologies, Inc.





*****************************************************************************************************************************************************************************************
This message is intended for the use of the individual or entity to which
it is addressed and may contain information that is confidential and
privileged and exempt from disclosure under applicable law.  If the reader
of this message is not the intended recipient, you are hereby notified that
any dissemination, distribution, or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please contact the sender immediately and delete it from your system.
Thank You
*****************************************************************************************************************************************************************************************


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise