logo       

Maintenance_Mode Rule: msg#00185

sysutils.tivoli.tme10

Subject: 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