542
IBM Tivoli Enterprise Console 3.9 SA30-1983-00

IBM Tivoli Enterprise Console: ..publib.boulder.ibm.com/tividd/td/tec/SC32-1234-00/ko_… ·  · 2003-10-23set_log_error_source . . . . . . . . . 233 ... abolish . . . . . .

Embed Size (px)

Citation preview

IBM Tivoli Enterprise Console

� ��� ���

�� 3.9

SA30-1983-00

���

IBM Tivoli Enterprise Console

� ��� ���

�� 3.9

SA30-1983-00

���

�!

� ��� � ��� ���� ��� ���� ��, 497 ���� ������� ��� �����.

��(2003� 8�)

� �� � ���� ��� ���� �� �, IBM Tivoli Enterprise Console� �� 3, ��� 9(�� �� 5698-TEC)� ��

�� ���� ���� �����.

© Copyright International Business Machines Corporation 2003. All rights reserved.

��

� �� �� . . . . . . . . . . . . . . xi

� �� �� . . . . . . . . . . . . . xi

� �� �� . . . . . . . . . . . . . . xi

�� . . . . . . . . . . . . . . . . . xii

IBM Tivoli Enterprise Console ����� . . xii

�� �� . . . . . . . . . . . . . . xiii

�� �� ��� . . . . . . . . . . xiv

�� �� . . . . . . . . . . . . . . xiv

����� �� �� . . . . . . . . . . . xv

�� �� �� . . . . . . . . . . . . . xv

� �� ��� �� . . . . . . . . . . . xvi

�� �� . . . . . . . . . . . . . xvi

��� �� �� � �� . . . . . . xvii

IBM Tivoli Enterprise Console ��� . . . . xvii

� 1 � ��� ���� ��� �� . . . 1

� 1 � � �� �� . . . . . . . . . . . 3

� �� . . . . . . . . . . . . . . . . 3

��� . . . . . . . . . . . . . . . . 5

��� ��� . . . . . . . . . . . . . 5

��� ����� ���� ��� �� . . . 5

�� �� �� ����� ��� ��� . . . 7

��� ��� . . . . . . . . . . . . . 7

���� �� � . . . . . . . . . . . . 8

��� ���� ���� ��� �� �. . . . . 8

��� �� . . . . . . . . . . . . . . 10

� . . . . . . . . . . . . . . . . . 11

� ��. . . . . . . . . . . . . . . 11

�� � �� . . . . . . . . . . . . . 13

� �� � . . . . . . . . . . . . . 13

�� � � � � �� �� . . . . . 13

� ��� . . . . . . . . . . . . . . 14

� ��� �� . . . . . . . . . . . 16

� �� � � � . . . . . . . . . . 17

� � �� . . . . . . . . . . . 19

� �� �� . . . . . . . . . . . 20

��� ��� . . . . . . . . . . . 21

� . . . . . . . . . . . . . . . 22

� ��� �� . . . . . . . . . . . 22

� ��� �� ���� . . . . . . . 22

� ��� �� �� . . . . . . . . 22

� ��� �� �� . . . . . . . . 24

� ��� ��� � ��� �� �� . . . 26

� � ��� �� . . . . . . . . . 27

�� � ��� �� . . . . . . . . 28

��� �� � ��� � . . . . . . 28

��� � ��� � . . . . . . . 29

� ���� � �� � BAROC �� �

. . . . . . . . . . . . . . 29

� ��� �� . . . . . . . . . . 30

� ��� �� . . . . . . . . . . 31

� ���� � �� �� . . . . . . 32

� ���� BAROC �� �� . . . . 33

� ��� ��� . . . . . . . . . 34

� ��� �� � ��� . . . . . . 34

�� � ��� � ��� . . . . . . . 36

� ���� �� UNIX ��� �� . . . 36

� ���, ��� � . . . . . . . . 37

�� ��� � ��. . . . . . . . . . 37

�� � ��� �� . . . . . . . . 37

��� � ���� ��� �� . . . . . 38

exec_program � exec_program_local

��� ��� �� . . . . . . . . . 38

exec_task � exec_task_local �� ��

��� . . . . . . . . . . . . . 38

UTF-8 ��� � �� � ��� ��

� . . . . . . . . . . . . . . 38

� 2 � ��� ��� ��. . . . . . . . . 41

��� ��� �� . . . . . . . . . . . . 41

��� ��� �� . . . . . . . . . . . . 43

��� �� �� . . . . . . . . . . . . 44

�� �� . . . . . . . . . . . . . . 44

�� ��� �� . . . . . . . . . . . 45

�� ��(facet) . . . . . . . . . . . . 46

�� . . . . . . . . . . . . . . . . . 47

�� �� . . . . . . . . . . . . . . 49

�� . . . . . . . . . . . . . . . 50

��� ��� �� �� �� � �� ���

� . . . . . . . . . . . . . . . . . 51

root.baroc � tec.baroc �� �� . . . . . . 51

��� BAROC �� ��� . . . . . . . . 51

�� ��� BAROC �� . . . . . . . . 52

© Copyright IBM Corp. 2003 iii

� 3 � � �� �� . . . . . . . . . . . 53

��� ��� � �� . . . . . . . . . . 53

��� �� . . . . . . . . . . . . . . 53

�� � �� . . . . . . . . . . . 55

�� ���� �� . . . . . . . . . . . 55

� �. . . . . . . . . . . . . . . . 55

� 4 � � �� �� . . . . . . . . . . . 57

�� �� �� . . . . . . . . . . . . . 57

�� . . . . . . . . . . . . . . . . . 58

�� �� . . . . . . . . . . . . . . 59

��� �� . . . . . . . . . . . . . 59

��� �� �� . . . . . . . . . . 60

�� . . . . . . . . . . . . . . . . . 60

� . . . . . . . . . . . . . . . . . 61

� ��. . . . . . . . . . . . . . . . 61

� � � �� . . . . . . . . . . 61

� �� �� �� . . . . . . . . . . 61

��� ���� . . . . . . . . . . . 62

� . . . . . . . . . . . . . . . 62

�� �� �� �� . . . . . . . . . . 63

��� ���� . . . . . . . . . . . 63

� . . . . . . . . . . . . . . . 63

�� �� �� ��. . . . . . . . . . 64

��� ���� . . . . . . . . . . . 64

� . . . . . . . . . . . . . . . 65

� �� �� �� . . . . . . . . . . 66

��� ���� . . . . . . . . . . . 66

� . . . . . . . . . . . . . . . 68

�� �� �� �� . . . . . . . . . . 68

��� ���� . . . . . . . . . . . 68

� . . . . . . . . . . . . . . . 69

�� . . . . . . . . . . . . . . . . 69

��� �� . . . . . . . . . . . . 70

�� �� . . . . . . . . . . . . 73

�� � �� . . . . . . . . . . . . 74

�� �� . . . . . . . . . . . 74

�� �� �� . . . . . . . . . . 75

�� � �� . . . . . . . . . . . 76

timer_info �� . . . . . . . . . . 76

timer_duration �� . . . . . . . . 77

�� . . . . . . . . . . . . . . . . 78

�� �� . . . . . . . . . . . . . 78

��� . . . . . . . . . . . . . . 80

� �� � . . . . . . . . . . . . . . 81

� �� �� �� �� . . . . . . . . 81

��� �� . . . . . . . . . . . . 81

��� �� � . . . . . . . . . . 82

��� ���� . . . . . . . . . . 83

� ��� . . . . . . . . . . . 83

��� �� . . . . . . . . . . . . 84

BAROC �� . . . . . . . . . . . 84

��� � . . . . . . . . . . . . 84

��� � . . . . . . . . . . . . 85

��� . . . . . . . . . . . . . . 85

�� � � . . . . . . . . . . . . 85

��� �� . . . . . . . . . . . . 86

�� �� . . . . . . . . . . . . . 86

��� � ��� �� . . . . . . . . 87

�� � �� �� . . . . . . . . . . 87

�� �� . . . . . . . . . . . . . 88

��� . . . . . . . . . . . . . . 88

� �� �� �� � . . . . . . . 88

add_to_repeat_count . . . . . . . . . 89

all_clear_targets . . . . . . . . . . . 90

all_duplicates . . . . . . . . . . . 91

all_instances . . . . . . . . . . . . 93

any_clear_target . . . . . . . . . . 94

any_clearing_event . . . . . . . . . . 95

attr_condition . . . . . . . . . . . 96

attr_exception . . . . . . . . . . . 98

attr_sequence . . . . . . . . . . . 99

bo_add_at_slotval_begin . . . . . . . 100

bo_add_at_slotval_end . . . . . . . . 101

bo_get_class_of . . . . . . . . . . 102

bo_get_class_slots . . . . . . . . . 103

bo_get_enum_options . . . . . . . . 105

bo_get_slotval . . . . . . . . . . . 106

bo_is_defined_for_class . . . . . . . 107

bo_is_direct_super_of . . . . . . . . 108

bo_is_super_of . . . . . . . . . . 109

bo_remove_from_slotval . . . . . . . 110

bo_reset_default_slotval . . . . . . . 111

bo_set_slotval . . . . . . . . . . . 112

cancel_all_timers . . . . . . . . . . 113

cancel_timer . . . . . . . . . . . 114

change_event_administrator . . . . . . 116

change_event_severity . . . . . . . . 117

change_event_status . . . . . . . . . 118

check_all_thresholds . . . . . . . . . 119

check_and_increment_count . . . . . . 120

check_event_criteria . . . . . . . . . 122

check_threshold . . . . . . . . . . 124

iv IBM Tivoli Enterprise Console: � �� ���

clear_closed_events . . . . . . . . . 126

clears . . . . . . . . . . . . . . 127

commit_action . . . . . . . . . . . 129

commit_rule . . . . . . . . . . . 130

commit_set . . . . . . . . . . . . 131

convert_ascii_time . . . . . . . . . 132

convert_gm_time . . . . . . . . . . 133

convert_local_time . . . . . . . . . 134

create_cache_search_criteria . . . . . . 135

create_clearing_event . . . . . . . . 137

create_event_criteria . . . . . . . . . 140

create_event_sequence . . . . . . . . 143

create_threshold . . . . . . . . . . 148

decrement_slot . . . . . . . . . . . 150

drop_change_request . . . . . . . . 151

drop_received_event . . . . . . . . . 152

erase_globals . . . . . . . . . . . 153

exec_program . . . . . . . . . . . 154

exec_program_local . . . . . . . . . 156

exec_task . . . . . . . . . . . . 160

exec_task_local . . . . . . . . . . 163

first_causal_event . . . . . . . . . . 167

first_duplicate . . . . . . . . . . . 169

first_effect_event . . . . . . . . . . 171

first_instance . . . . . . . . . . . 173

first_related_event . . . . . . . . . 175

forward_event . . . . . . . . . . . 177

generate_event . . . . . . . . . . . 178

get_attributes . . . . . . . . . . . 179

get_config_param . . . . . . . . . . 180

get_global_grp . . . . . . . . . . . 181

get_global_var . . . . . . . . . . . 182

get_globals . . . . . . . . . . . . 183

get_gm_time . . . . . . . . . . . 184

get_local_time . . . . . . . . . . . 185

get_time . . . . . . . . . . . . . 186

global_exists . . . . . . . . . . . 187

increment_slot . . . . . . . . . . . 188

init_count . . . . . . . . . . . . 189

init_event_activity . . . . . . . . . 191

ip_node_unreachable . . . . . . . . 194

is_clearing_event . . . . . . . . . . 195

link_effect_to_cause . . . . . . . . . 196

load_globals . . . . . . . . . . . 197

log_error . . . . . . . . . . . . . 198

place_change_request . . . . . . . . 200

print_cache . . . . . . . . . . . . 201

print_class_tree . . . . . . . . . . 202

print_event_activity . . . . . . . . . 203

re_after_match . . . . . . . . . . . 204

re_before_match . . . . . . . . . . 205

re_create . . . . . . . . . . . . . 206

re_mark_as_modified . . . . . . . . 207

re_match . . . . . . . . . . . . . 208

re_search_string . . . . . . . . . . 209

re_send_event_conf . . . . . . . . . 210

re_split_event_id . . . . . . . . . . 211

re_substitute . . . . . . . . . . . 213

re_substitute_global . . . . . . . . . 214

redo_analysis . . . . . . . . . . . 215

remove_bslashes . . . . . . . . . . 216

reset_event_activity . . . . . . . . . 217

reset_global_grp . . . . . . . . . . 218

resolve_time . . . . . . . . . . . 219

save_globals . . . . . . . . . . . 221

search_cache . . . . . . . . . . . 222

set_detailed_debugging . . . . . . . . 224

set_event_administrator . . . . . . . . 226

set_event_message . . . . . . . . . 227

set_event_severity . . . . . . . . . 230

set_event_status . . . . . . . . . . 231

set_global_var . . . . . . . . . . . 232

set_log_error_source . . . . . . . . . 233

set_timer . . . . . . . . . . . . . 234

trace_it . . . . . . . . . . . . . 236

unlink_from_cause . . . . . . . . . 237

update_event_activity . . . . . . . . 238

� 5 � �� �� . . . . . . . . . . . 239

��� �� � �� �� . . . . . . . . 239

� �� �� �� ��� �� . . . . . 241

�� ���� �� �� �� ��� 241

��� ��� �� ��� . . . . . . . 241

� �� �� �� . . . . . . . . . . . 242

� ��� . . . . . . . . . . . . . 242

� ��� . . . . . . . . . . . . . 242

��� ��� . . . . . . . . . . . . 243

� ��� ��� ��� �� . . . . . . 243

� ��� �� . . . . . . . . . . 244

� ��� �� . . . . . . . . . . 244

��� ��� �� . . . . . . . . . 245

��� �� � �� � . . . . . . . . . 245

��� �� �� �� . . . . . . . . . 246

�� v

��� � � � . . . . . . . . 246

��� �� ��� ���� �� ��� �� 247

�� �� . . . . . . . . . . . . . 248

��� �� �� �� . . . . . . . . 248

��� �� � . . . . . . . . . . . 249

process_problem_events � . . . . . 249

process_clearing_event � . . . . . . 251

�� � . . . . . . . . . . . 252

� 6 � � ���, �� � ���� . . . . . 255

� ��� . . . . . . . . . . . . . . 255

���� ��� ��� . . . . . . . . . 255

tec_agent_demo ����� ��� ��� 255

tec_agent_demo ��� ��� �� ��

���� . . . . . . . . . . . . . 255

tec_agent_demo ��� �� . . . . . 256

SendEvents ����� ��� ��� . . . 257

�� ��� ����� ��� �� �� . . . 257

� �� . . . . . . . . . . . . . . . 259

�� �� . . . . . . . . . . . . . 259

� �� �� . . . . . . . . . . . 259

� �� . . . . . . . . . . . . . 260

�� �� . . . . . . . . . . . . . 260

� �� �� . . . . . . . . . . . . 260

� ��� �� �� . . . . . . . . . 261

� �� �� . . . . . . . . . . . 262

�� � � ��� �� �� . . . 263

� ����� . . . . . . . . . . . . . 264

���� �� . . . . . . . . . . . . 265

� �� ����� . . . . . . . . . 265

� ����� . . . . . . . . . . . 265

��� �� � �� . . . . . . . . . . 266

� 7 � ��� � ��� � �� . . . . . . 269

� �� �� . . . . . . . . . . . . . 269

�� ��� ��� � �� ���� . . . . 270

� �� �� . . . . . . . . . . . . . 270

� �� �� . . . . . . . . . . . . 272

�� � ��� �� . . . . . . . . . . 273

� � �� �� . . . . . . . . . . . 273

� �� �� . . . . . . . . . . . . 275

� � �� . . . . . . . . . . . . 275

�� � �� . . . . . . . . . . . . 285

� �� �� . . . . . . . . . . . . 291

� ��� ��� . . . . . . . . . . . 292

��� �� � � ��� . . . . . . . 294

� �� �� . . . . . . . . . . . . . 295

������ policy �� . . . . . . . . 295

���. . . . . . . . . . . . . . 295

�. . . . . . . . . . . . . . 295

��� �� �� . . . . . . . . . 295

� �� . . . . . . . . . . . . 296

UNIX ����� ��� �� �� ���

� . . . . . . . . . . . . . . . . 299

���. . . . . . . . . . . . . . 299

�. . . . . . . . . . . . . . 300

� ��� �� . . . . . . . . . 300

� �� . . . . . . . . . . . . 300

� ���� � ���� �� . . . . . 303

���. . . . . . . . . . . . . . 303

�. . . . . . . . . . . . . . 303

� ���� ��� �� . . . . . . 303

� �� . . . . . . . . . . . . 304

�� ��� �� . . . . . . . . . . . 307

���. . . . . . . . . . . . . . 307

�. . . . . . . . . . . . . . 308

� 2 � ����� �� ����� ��

� �� . . . . . . . . . . . . . . 309

� 8 � �� �� ��� �� � �� . . . . 311

�� �� � . . . . . . . . . . . . . 311

� . . . . . . . . . . . . . . . 312

�� . . . . . . . . . . . . . . . 313

���. . . . . . . . . . . . . . 313

TECSummary . . . . . . . . . . . 313

�� . . . . . . . . . . . . . . 314

SendTECEvent . . . . . . . . . . 316

�� �� � �� . . . . . . . . . 316

�� � . . . . . . . . . . . . . . 317

� � . . . . . . . . . . . . . . 317

��� � . . . . . . . . . . . . . 318

�� � . . . . . . . . . . . . . 321

� � . . . . . . . . . . . . . . 322

�� � ��� �. . . . . . . . . . . 324

�� �� �� . . . . . . . . . . . . 326

�� �� �� �� . . . . . . . . . . 327

��� ���� . . . . . . . . . . . 327

�� �� . . . . . . . . . . . . . 328

���� �� � . . . . . . . . . . 330

��� �� . . . . . . . . . . . . . 331

��� ��� . . . . . . . . . . . . 332

�� ��� �� . . . . . . . . . . . 332

vi IBM Tivoli Enterprise Console: � �� ���

��� �� �� . . . . . . . . . . 332

��� ��� � �� �� . . . . . . 334

� 9 � �� �� �� . . . . . . . . . 337

� �� . . . . . . . . . . . . . . . 337

�� � . . . . . . . . . . . . . 337

�� � �� . . . . . . . . . . . 339

�� � �� . . . . . . . . . . . 340

� � �� . . . . . . . . . . . 341

��� � �� . . . . . . . . . . . 342

� � �� . . . . . . . . . . . 342

�� � ��� � �� . . . . . . . . 343

�� �� . . . . . . . . . . . . . 344

� ����� . . . . . . . . . . . . 346

� �� . . . . . . . . . . . . . . 346

�� . . . . . . . . . . . . . . . 346

�� ��� � � � . . . . . . . . . 347

�� � . . . . . . . . . . . . . 347

== . . . . . . . . . . . . . . . 347

!= . . . . . . . . . . . . . . . 348

> . . . . . . . . . . . . . . . 348

< . . . . . . . . . . . . . . . 349

>= . . . . . . . . . . . . . . . 349

<= . . . . . . . . . . . . . . . 349

�� � . . . . . . . . . . . . . 350

+ . . . . . . . . . . . . . . . 350

- . . . . . . . . . . . . . . . 351

* . . . . . . . . . . . . . . . 351

/ . . . . . . . . . . . . . . . 351

absolute . . . . . . . . . . . . . 352

max . . . . . . . . . . . . . . 352

min . . . . . . . . . . . . . . 353

mod . . . . . . . . . . . . . . 353

negate . . . . . . . . . . . . . 353

numOfEvents . . . . . . . . . . . 354

range . . . . . . . . . . . . . . 354

timeNow . . . . . . . . . . . . . 354

timeSpan . . . . . . . . . . . . 355

� � . . . . . . . . . . . . . 355

== . . . . . . . . . . . . . . . 355

!= . . . . . . . . . . . . . . . 356

> . . . . . . . . . . . . . . . 356

>= . . . . . . . . . . . . . . . 357

< . . . . . . . . . . . . . . . 357

<= . . . . . . . . . . . . . . . 357

� � . . . . . . . . . . . . . 358

+ . . . . . . . . . . . . . . . 358

- . . . . . . . . . . . . . . . 359

* . . . . . . . . . . . . . . . 359

/ . . . . . . . . . . . . . . . 359

absolute . . . . . . . . . . . . . 360

max . . . . . . . . . . . . . . 360

min . . . . . . . . . . . . . . 360

negate . . . . . . . . . . . . . 361

range . . . . . . . . . . . . . . 361

� � . . . . . . . . . . . . . 362

== . . . . . . . . . . . . . . . 362

!= . . . . . . . . . . . . . . . 362

> . . . . . . . . . . . . . . . 363

>= . . . . . . . . . . . . . . . 363

< . . . . . . . . . . . . . . . 363

<= . . . . . . . . . . . . . . . 364

contains . . . . . . . . . . . . . 364

endsWith . . . . . . . . . . . . 365

ignorecase equal . . . . . . . . . . 365

ignorecase not equal . . . . . . . . 365

startsWith . . . . . . . . . . . . 366

� � . . . . . . . . . . . . . 366

concat . . . . . . . . . . . . . 367

dayOfWeek . . . . . . . . . . . . 367

dayOfWeekString . . . . . . . . . . 368

existRuleId . . . . . . . . . . . . 368

getEventType . . . . . . . . . . . 369

hourOfDay . . . . . . . . . . . . 369

length . . . . . . . . . . . . . . 370

month . . . . . . . . . . . . . 370

monthString . . . . . . . . . . . 371

substring . . . . . . . . . . . . . 371

toUpperCase . . . . . . . . . . . 372

toLowerCase . . . . . . . . . . . 372

trim . . . . . . . . . . . . . . 372

IP �� � . . . . . . . . . . . . 373

== . . . . . . . . . . . . . . . 373

!= . . . . . . . . . . . . . . . 373

� �� � . . . . . . . . . . . 374

== . . . . . . . . . . . . . . . 374

!= . . . . . . . . . . . . . . . 374

areDisjoint . . . . . . . . . . . . 375

isMemberOf . . . . . . . . . . . 375

isSubsetOf . . . . . . . . . . . . 375

� �� � . . . . . . . . . . . 376

intersect . . . . . . . . . . . . . 376

join . . . . . . . . . . . . . . 376

�� vii

previousValues . . . . . . . . . . 377

�� � . . . . . . . . . . . . . 377

and . . . . . . . . . . . . . . 377

not . . . . . . . . . . . . . . . 378

or . . . . . . . . . . . . . . . 378

�� �� � . . . . . . . . . . . . 378

isMemberOf . . . . . . . . . . . 378

IP �� �� � . . . . . . . . . . 379

isMemberOf . . . . . . . . . . . 379

�� �� ��� . . . . . . . . . . . . 379

� 3 � �� . . . . . . . . . . . . 383

�� A. ���� Prolog �� . . . . . . . 385

Prolog � �� �� . . . . . . . . . 385

�� � . . . . . . . . . . . . . . 385

� . . . . . . . . . . . . . . . . 385

�� . . . . . . . . . . . . . . . 386

� . . . . . . . . . . . . . . . . 386

�� �� . . . . . . . . . . . . . 387

� . . . . . . . . . . . . . . . 388

��� �� � �� . . . . . . . . . . 388

BAROC� Prolog �� ��� �� � 389

Tivoli Enterprise Console ���� Prolog �

� �� . . . . . . . . . . . . . . 389

Prolog � � ��� �� �� . . . . . . 391

���� � ��. . . . . . . . . . 391

��� �� � �� ���� ��� . . . 391

��� �� �� . . . . . . . . . . . 392

� �� . . . . . . . . . . . . . 392

� �� . . . . . . . . . . . 392

� . . . . . . . . . . . . . . 393

�� . . . . . . . . . . . . . . 393

�� �� . . . . . . . . . . . . . 393

��� � � . . . . . . . . . . . . 394

� � � . . . . . . . . . . . . 394

� . . . . . . . . . . . . 394

��� �� . . . . . . . . . . . 394

� � . . . . . . . . . . . . 395

�� . . . . . . . . . . . . . . 395

�� �� . . . . . . . . . . . . . 395

I/O . . . . . . . . . . . . . . . . 396

�� � � ��� �� �� . . . . . 396

+ . . . . . . . . . . . . . . . . 397

-(� �� ��) . . . . . . . . . . 398

-(� ��) . . . . . . . . . . . . 400

-(�� ��) . . . . . . . . . . . . . 402

-(��) . . . . . . . . . . . . . . 403

* . . . . . . . . . . . . . . . . 404

/ . . . . . . . . . . . . . . . . 405

// . . . . . . . . . . . . . . . . 406

@< . . . . . . . . . . . . . . . 407

@=< . . . . . . . . . . . . . . . 408

@> . . . . . . . . . . . . . . . 409

@>= . . . . . . . . . . . . . . . 410

\== . . . . . . . . . . . . . . . 411

+(� �� ���) . . . . . . . . . 412

< . . . . . . . . . . . . . . . . 414

= . . . . . . . . . . . . . . . . 415

=:= . . . . . . . . . . . . . . . 416

=? . . . . . . . . . . . . . . . . 417

=\= . . . . . . . . . . . . . . . 418

=< . . . . . . . . . . . . . . . . 419

== . . . . . . . . . . . . . . . . 420

> . . . . . . . . . . . . . . . . 421

>= . . . . . . . . . . . . . . . . 422

abolish . . . . . . . . . . . . . . 423

append . . . . . . . . . . . . . . 424

ascii . . . . . . . . . . . . . . . 425

assert . . . . . . . . . . . . . . . 426

atom . . . . . . . . . . . . . . . 429

atomic . . . . . . . . . . . . . . 430

atomlength . . . . . . . . . . . . . 431

atompart . . . . . . . . . . . . . . 432

atomconcat . . . . . . . . . . . . . 434

atomtolist . . . . . . . . . . . . . 436

compile . . . . . . . . . . . . . . 437

consult . . . . . . . . . . . . . . 439

delete . . . . . . . . . . . . . . . 440

disjoint . . . . . . . . . . . . . . 441

empty_list . . . . . . . . . . . . . 442

fclose . . . . . . . . . . . . . . . 443

flisting . . . . . . . . . . . . . . 444

fopen . . . . . . . . . . . . . . . 445

ground . . . . . . . . . . . . . . 446

int_to_hex . . . . . . . . . . . . . 447

integer . . . . . . . . . . . . . . 448

intersect . . . . . . . . . . . . . . 449

inttoatom . . . . . . . . . . . . . 450

is . . . . . . . . . . . . . . . . 451

is_list . . . . . . . . . . . . . . . 452

length . . . . . . . . . . . . . . . 453

lowertoupper . . . . . . . . . . . . 454

viii IBM Tivoli Enterprise Console: � �� ���

member . . . . . . . . . . . . . . 455

name . . . . . . . . . . . . . . . 456

nmember . . . . . . . . . . . . . 458

nmembers . . . . . . . . . . . . . 459

not . . . . . . . . . . . . . . . . 460

number . . . . . . . . . . . . . . 461

pointer . . . . . . . . . . . . . . 462

pointeroffset . . . . . . . . . . . . 463

pointertoatom . . . . . . . . . . . . 464

pointertoint . . . . . . . . . . . . . 465

printf . . . . . . . . . . . . . . . 466

read . . . . . . . . . . . . . . . 468

readln . . . . . . . . . . . . . . . 469

real(�� ��) . . . . . . . . . . . . 470

real(�� �� ���) . . . . . . . . . 471

realtoatom . . . . . . . . . . . . . 472

reconsult . . . . . . . . . . . . . . 473

remove_dups . . . . . . . . . . . . 474

retract . . . . . . . . . . . . . . 475

round . . . . . . . . . . . . . . . 476

rremove . . . . . . . . . . . . . . 477

sort . . . . . . . . . . . . . . . 478

sprintf . . . . . . . . . . . . . . 479

strip . . . . . . . . . . . . . . . 482

subset . . . . . . . . . . . . . . . 484

substring . . . . . . . . . . . . . . 485

subtract . . . . . . . . . . . . . . 486

term_type . . . . . . . . . . . . . 487

union . . . . . . . . . . . . . . . 488

write . . . . . . . . . . . . . . . 489

Tivoli Enterprise Console � ���� ���

� � �� �� . . . . . . . . . . . 490

����� � � �� ��. . . . . . . 490

TEC_Start ���� � assert � �� . . 490

Prolog ���� �� . . . . . . . . . . 491

Prolog ���� �� �� . . . . . . . 492

�� B. BAROC ��� BNF �� . . . . . 493

�� . . . . . . . . . . . . . . . 493

��. . . . . . . . . . . . . . . . 493

���� . . . . . . . . . . . . . . . 497

�� . . . . . . . . . . . . . . . . 499

�� . . . . . . . . . . . . . . . . 501

�� ix

x IBM Tivoli Enterprise Console: � �� ���

� �� ��

IBM® Tivoli Enterprise Console® ��� ��, ����, ������ � ���

�� ��� ��� � � IT ��� �� ��� ���� ���� � ��

� ��� �� ��������. IBM Tivoli Enterprise Console � �� ��

�� ��� ���� Prolog ��� ���� ����� �� ����� XML �

�� �� �� ��� ����, Tivoli Enterprise Console ���� ���� ��

�� ���� ��� �����.

Tivoli Enterprise Console ��� ��� � ��� �� ���� � �� ���

�, � ���� ��� ���� �� ���� � �� ��� ���. ���

� ��� � �� ���� ��� ����, �� �� �� �����

Tivoli Enterprise Console � ��� �� ��� ���.

Tivoli Enterprise Console ��� ��� ���� � � �� �� �� �

� � �� ��� �����. �� ��� IBM Tivoli Enterprise Console �

�� ���� ������.

� �� ���

� �� Tivoli Enterprise Console ���, ����� �� ��� ���� Tivoli

Enterprise Console ���� �� ���� �� �� ���� ������

��. � �� ��� ��� �� ��� � ���.

v UNIX® � Windows® ��

v Shell �����

v Tivoli Enterprise Console �

v XML(Extensible Markup Language)

� �� ��

� �� � �� ��� ����.

� 1 � -- ��� ���� ��� ��

� 1 ���� Tivoli Enterprise Console ��� ���� ���� Prolog �� �

��� ���� �� ���� �� �� �����. Prolog ��� �� ��

� ���� �� ��������� ��� � ��� ��� ��� �� ��� �

� � ��� �� � ���. Prolog ��� �� �� Prolog� ��� � �

�� �����.

© Copyright IBM Corp. 2003 xi

� 2 � -- ����� �� ����� ��� ��

� 2 ���� Tivoli Enterprise Console ����� �� ����� ���� XML

�� �� �� ��� ���� �� ���� �� �� �����. �� �� �

�� ���� ��� �� �� � �� ���� ���� ��� ��� ���

���� ��� �� � ���. �� �� ��� �� �� Java ���� �

� � ��� � XML� �����.

� 3 � -- ��

� 3 ��� �� � ����� �� ��� ���. � ���� ��� Prolog

��� ���� �� �� ��� ��� ���� ���� � ���� BAROC �

�� �� ��� �� ��� ���.

��

� ��� IBM Tivoli Enterprise Console ����� � ��� ��� ��� �

���. Tivoli® ��� ���� ����� � � Tivoli ��� ���� �

� ���� �����.

IBM Tivoli Enterprise Console �����

�� ��� IBM Tivoli Enterprise Console ������� � � ���.

v IBM Tivoli Enterprise Console ��� ���, SA30-1980

���� ���� ��� �� � �� �� �� ��� �����.

v IBM Tivoli Enterprise Console �� � ��� ���, SA30-1982

IBM Tivoli Enterprise Console ��, ��� ������ ��� ����� �

�� � ���� �� ���� ���� �� � � �� ��� �� ��

��� �����.

v IBM Tivoli Enterprise Console �� ���, SA30-1981

IBM Tivoli Enterprise Console ��� ��, ���� � �� ��� ��

�� �����.

v IBM Tivoli Enterprise Console ���� ��, SA30-1985

��� ��� �� ���� ��� �� ��� �����.

v IBM Tivoli Enterprise Console � �� ���, SA30-1983-00

��� �� � �� ��� ��� �� � �� � � �� �� ���

��.

v IBM Tivoli Enterprise Console � �� ���, SA30-2102

IBM Tivoli Enterprise Console � ��� �� �� ��� �����.

v IBM Tivoli Enterprise Console �� ���, SA30-1984

xii IBM Tivoli Enterprise Console: � �� ���

IBM Tivoli Enterprise Console ��� ��� ����, IBM Tivoli Enterprise

Console ��� ���� ���� ���� ���� �� �� �����.

v IBM Tivoli Enterprise Console Warehouse Enablement Pack: Implementation

Guide, SC32-1236

IBM Tivoli Enterprise Console ��� ����� ���� �� �� � ��

�� �� ����� �� ���� ��� ��� � ��� �� �����.

v Tivoli ��� � � ���, SA30-1979

��� ���� ��� ������� �� ��� �� ��� �� ���

��� ���� ���� �� �� �����. �� ���� ���� ���

�� �� �� �����.

�� ��

Tivoli Software Glossary�� Tivoli ������ ��� �� � ��� �� �

�� �� ���. Tivoli Software Glossary� �� Tivoli � ����� ��

�����.

http://www.ibm.com/software/tivoli/library/

Tivoli ����� ����� �� �� ��� Glossary ��� � ��� �

������.

�� ��� � �� �� ���� � ��� �� �� �����. � ��

IBM Tivoli Enterprise Console � �� ���� �� �� �� � ��

�. � ��� �� �� �� ��� ���, IBM� � ��� �� ��� �

��� ���� ����� ���� ����.

v Programming Rules for the Tivoli Enterprise Console

IBM ��� ���� ���� � � ��� Tivoli Enterprise Console � �

�� ��� � ��� �� ��� ����. ���� ���� �� �� �

�����, � ��� �� ��, �� �� ��� � � � � ���

� ���� �� ��� �� �� �� ���. �� ��� Tivoli Worldwide

Education � ���(http://www.ibm.com/tivoli/education/)� �����.

v EMMD(Event Management and Monitoring Design Methodology)

EMMD(Event Management and Monitoring Design Methodology)� IBM ��

� ��� �� ������. Tivoli ����� ���� Tivoli ��� ��

� � � �� ��� �� ��� �����. EMMD� ��� ���

Distributed Monitoring ����� �� ��� �� ��� ��� ��

� � ���. � � ���� ��� IBM ���� ��� �

� �� �� xiii

�-�-�� ��� �� �� ��� ����, ��� ���, ��� �� � �

�� ��� �� �� ��� ��� �����. �� ��� wwibmtiv@us.

ibm.com�� IBM� ������.

v �, BAROC ��� �� �� � ��� �� ��� $BINDIR/TME/TEC/

samples/correlation ���� ��� �� ����� �� ����.

v TEC Rule Writing by Example

� �� �� � �� �� ���� �� ���� � � ����, � ��

� �� ���� �� �� �� ��� �����. � �� �� Orb Data

Limited� Giles McGarry�� http://www.orb-data.com�� PDF ���� ��

����.

v Clause and Effect: Prolog Programming for the Working Programmer, W. F.

Clocksin, ISBN 3-540-62971-8.

v Programming in Prolog, 4th Ed., W. F. Clocksin and C. S. Mellish, ISBN

0-387-58350-5.

v Prolog Programming in Depth, M. A. Covington, D. Nute, and A. Vellino,

ISBN 0-13-138645-X.

��� �� ���

�� CD�� �� ������ � �� ��� �� ���. ��� ��� PDF,

HTML �� �� ���� �� ���. ��� ����� �� ��� CD�

readme ��� ������.

IBM� � CD� �� �� Tivoli ��� ��� �� ��� �� ��� ��

� Tivoli Software Information Center � ���� �����. �� � ��� Tivoli

����� ������ �� ��� Tivoli Software Information Center� ��

�����.

http://www.ibm.com/software/tivoli/library/

��� ��� ��� Product manuals ��� �����. Tivoli Technical

Product Documents Alphabetical Listing ��� IBM Tivoli Enterprise Console

��� � Tivoli Information Center� �� ������ �������.

�: �� �� ��� ��� PDF ��� ��� ��, Adobe Acrobat � ��

� ���� ��� � �� � ����. �� → ��� ��� � ��� ��

� ���. ���� ���� �� �� ���� �� �� ���� �

��� ���� ���.

�� ��

�� � ����� ���� Tivoli ��� �� � ���.

xiv IBM Tivoli Enterprise Console: � �� ���

http://www.elink.ibmlink.ibm.com/public/applications/publications/

cgibin/pbi.cgi

�� ��� �� ��� ��� �� � ���.

v ���: [email protected]

v �� ��..� �����: 080-023-8080

����� �� ��

Tivoli ��� ��� � ��, �� IBM Software Support � ���� ����

��.

http://www.ibm.com/software/sysmgmt/products/support/

Software Support� �����, �� � ����� IBM Software Support Guide

� ������.

http://techsupport.services.ibm.com/guides/handbook.html

� ��� ���� ���� �� IBM Software Support�� �� � � ���

�� ��� �����.

v �� � ���

v ��� �� ��� ���� � � �� ��

v IBM Software Support� ��� ���� �� �� ��

�� �� ��

�� ��� ��� ��, �� � �� � ��� ��� ��� ���� ��

�� � ����� ���� �����. �� ��� ��� �� � ��

�� ���� � �� � ���. � ��� �� �� �� �� ��

���� �� �� ��� ���� ����.

����� ������ �� ��� �����.

Microsoft Internet Explorer ����� ��, �� ��� �����.

1. Internet Explorer ����� ����.

2. �� ���� ��� ��� �����.

3. �� �� ��� ���� �� �����.

4. �� �� ���� ��� ���� �� �� Outlook Express� �����.

5. ��� �����.

6. Internet Explorer ����� �� �� �� ����.

� �� �� xv

7. ��� �� �� ��� ���� ����� �� ��� ���� Enter� �

�� ��� ����.

Netscape Navigator ����� ��, �� ��� �����.

1. Netscape Navigator ����� ����.

2. �� ���� �� ��� �����. �� �� �� �����.

3. ���� ����, ��� ����� � ��� ���� ��� ������.

4. Netscape� �� �� ����� �� � �� � ����.

5. ��� �����.

6. Netscape Navigator ����� �� �� �� ����.

7. ��� �� �� ��� ���� ����� �� ��� ���� Enter� �

�� ��� ����.

IBM Tivoli Enterprise Console:

news://news.software.ibm.com/ibm.software.tivoli.enterprise-console

UNIX� IBM Tivoli NetView® � Windows IBM Tivoli NetView:

news://news.software.ibm.com/ibm.software.tivoli.netview-unix-windows

� �� ��� ��

� ���� �� ��� ��, ��� �� ��� �� � �� ���� ��

�� ��� �����.

��� ��

� ���� �� �� ��� �����.

��

v �� ���� ��� �� �� �� � ��� �� ��

v ���� ��(� �, �� �, � � �, �� �, ��, �,

���, �� �, �� �� ��, � �� ��, ���, �� �

��, �� ��, �, �� ��), ���(�� ��, �: � �� ��

��:)

v ���� �� ��

v ���� ��� � ����

xvi IBM Tivoli Enterprise Console: � �� ���

����

v ��(��, ��� � CD� ��)

v ���� ��� �

v �� �(��)

v � ���� �

v ���� � ��(�� ����� ��)

v ��� ��� �� �� � �

������

v �� � �� ��

v �� ��, ����� ��� � �� ���� ��� �� �� ��

v ���� ��� ��� ��� � ����

v ��� ��� �� ���

v �� �� �� � �

�� ��� �� �� � ��

� ���� �� �� � ��� ���� ���� �� UNIX ��� ����

�.

Windows ���� �� ���, �� ��� $variable� % variable%� ���

� ��� ��� ��(/)� ���(\)� ������.

�: Windows ���� bash � ���� � ��, UNIX ��� �� �

���.

IBM Tivoli Enterprise Console ���

��� IBM Tivoli Enterprise Console ��� ���� ������.

��� ��

��� ��

�� ���� ��� ��� �� �� �����.

�� � ���� ��� ��� ���� �� �����.

� ���

�� ���� � ���� �� �� �����.

� �� �� xvii

��� ��

����

����� ������ ���� �����.

xviii IBM Tivoli Enterprise Console: � �� ���

� 1 � ��� ���� ��� ��

© Copyright IBM Corp. 2003 1

2 IBM Tivoli Enterprise Console: � �� ���

� 1 � � �� ��

� �� ��� ���� ��� ���� ���� �� ��� �� �����.

��� � ���� � ��� ��� �� � ����. Tivoli Enterprise

Console� ��� ��� ��� ���� ����� ��� �� �� ��� ��

�� � ����� ��� �� �� ��� �����.

���� ���� �� �� ���� ��� �� ����. Tivoli Enterprise

Console� ��� ���� �� �� �� ���� �� ��� �� �

���. �� ��(�: � �� �(���� ��� � � �� ���)� �

���, ��� ��� �� �� ����, ���� ���� �� �� ��

� ���.

��� ���� � ��, IBM Tivoli Enterprise Console �� � � ���

� ���� ���� ���� ��� ��� ���� ����. ���� �

� ��� ��� ���� ��, ��� � � ������� �� ���� �

���� ���� ���. ������� �� ��� �� �� ��� �

�� ��� ��� ���� ��� ���. ��� ��� �� ��� ��

� �� �� � �� � ���.

v � ��: �� �� �� �� �� � ���� ����.

v ���: �� �� �� �� �� �� ���� ��� ��� ���� ��� �

�, ��� �� ���� �����.

v ������: �� �� �� �� �� ���� ����, ���� ����

�� ��� �����.

v ��: ���� �� ��� ��� ��� ����, ���� ��� �� �

� ���(����� ���� � �)� ����� � �� ���� �

� �� ���� ��� ������. �� ��, UPS(��� �� �� ��)

� �� � ��� ���� ���� �� Tivoli Enterprise Console �

�� �� �� �� ��� ���� �� ��� �� �� � ��

�� � ���.

� ��

�� �� ���� ���� � ��� ���. � � ��� ����

� ����� ����� � � � �� ���� �� � ��� ����

�� ��� ��� ��� ���. � ���� ����� ��� �� ����

���.

© Copyright IBM Corp. 2003 3

1. �� �� ���� � ������ ��� �������. Tivoli Inventory �

�� � ���� ��� � � ���.

2. � ����� � � � �� Tivoli Enterprise Console ���� ���

�������. � ��� �� ��, MIB ��, ��� ��� �� �� ��

������ � �� � ���.

3. ��� ��� ��� �� �� ���� ������.

v ������� ��� ������ ��� Tivoli Enterprise Console ��

� ��� ��� ���

v ��� ��� Tivoli Availability Intermediate Manager �� �� ��

� Tivoli Enterprise Console ��� ���� ��� ���

�: Tivoli Availability Intermediate Manager� Tivoli Enterprise Console �

���� � Tivoli Availability Intermediate Manager ���� ���

� � ��� ���� Tivoli Enterprise Console ���� ���� ��

� Tivoli ����� ��� ����. �� ��� Tivoli Availability

Intermediate Manager User’s Guide� ������.

v ������� ��� �� ���� ��� ���

4. Tivoli Enterprise Console ��� �� �� Tivoli Availability Intermediate

Manager�� ���� � ���� �� �� ��� ������(�: � ��,

���, ��� �� ��, ������, ���� �� �).

5. ��� �� � ��� ���� ������. �, �� ���� �� ����

����� ��� ������ ������. � ��� ��� �� ��� �

��� �� ���� � �����. �� ����� ��� ��� ���� �

� � �������� ��� �� ��� ���� ��� ������.

6. � �� ��� ����, �� ���� ���� �� �� ������. �

� �� ��� ��� � ��� � ��� ���� �� �� � ��

�. ��� � ��� �� �� ��� IBM Tivoli Enterprise Console � �

� ���� ������.

239 ���� � 5 � ��� ����� ���� ����� �� �� ��� ��

���. ��� ��� ��� �� �� ��� 41 ���� ���� ��� �

��� ������.

��� �� � ��� �� ��� ��� ��� ��� IBM Global

Service� ��� �� � ���� � �� ���� �����. � �� ��

� �� � Distributed Monitoring ����� �� ��� �� ��� ��

� ��� � ���. �� ��� xiii ���� ��� ����� ���

������.

4 IBM Tivoli Enterprise Console: � �� ���

���

IBM Tivoli Enterprise Console� �� ��� �� �� ������. ����

�� � �� ����� ��� �� ��� �����. ��� ��� ��

� ��� ��� ��� ���. ��� ��� ���� �� ����� � �

� � �� ��������. � ��� ��� ���� �� ��� ��� �

� � � ��� ����� ������. ��� ��� ���� ������

���� ���� �� �� � �� ��� �����. ��� ��� ��� �

� �, name=value ��� �����.

��� ���� ���� ���� �� ����. �� �� � � ��� �

��� �� ��� ���� ��� �� �� �������. ��� ��� ���

��� ���� �� � ��, ��� ���� �����.

��� ���

��� ���� ��� ����� �������. ��� ���� ����� ��

� ��� ��� ����� ��� ��� ����.

��� ��� ��� ��� IBM Tivoli Enterprise Console� � �����. �

� ��� ��� ���� ���� ��� EIF(��� � �)� ���� �

� ��� ��� ���� �� � ���. IBM Tivoli Enterprise Console�

� ��� ���� �� �� ��� IBM Tivoli Enterprise Console ��� ��

�� ������. �� ��� ��� ��� ��� �� �� ��� IBM Tivoli

Enterprise Console ��� � � ���� ������.

��� ����� ���� ��� ��

��� ���� �� ��� �� �� �� ��� ����. ��� �� � ��

� ��� �� ��� �� ��� ��� � ��� �� �� �����. ��

�� ��� ���� �����. ��� ���� �� ��� �� �� ���� �

��, ���� ��� ��� �� ��� ���� �� BAROC(Basic Recorder of

Objects in C) ��� ��� � �� �����. BAROC ��� 41 ���� �

2 � ���� ��� ���� �����. ��� ���� �� ���� ��� �

� �� ��� IBM Tivoli Enterprise Console ��� ���� ������. ��

� ��� �� ���� ��� �� �� ��� 8 ���� ���� ���� ��

�� ��� �� ��� ������.

� 1 � � �� �� 5

�� ��� ��� Windows NT® ��� �� ����� ��� � Windows

NT ����� ��� ��� ��� ��� ������. �� �����

Windows NT ��� ���� Windows NT ��� �� ��� �����. �

� ����� ����� ��� �, ���� ��� ��� �� ��� ��� Tivoli

��� ���� �����(wtdumprl ��� ���� �� �� ��). � �� �

���� ��� � � �� �� �� �� ���� �����.

1. �� ����� Windows NT ��� ���� Windows NT ��� �� ��

� �����.

2. �� ����� ����� ��� �, ���� ��� ��� �� ��� ��

� Tivoli ��� ���� �����(wtdumprl ��� ���� �� �� �

�).

6 IBM Tivoli Enterprise Console: � �� ���

3. �� ����� ��� � � �� �� �� �� � ���� �����.

�� �� �� ����� ��� ���

���� �� �� � ����(�: IBM Tivoli Monitoring, NetView ����,

Security Management � Workload Scheduler)��� IBM Tivoli Enterprise Console

� ��� �� ���.

wpostemsg, postemsg, wpostzmsg � postzmsg ��� ���� ����� �

��� �� � ���. �� ��� �� ��� ���� ���� ���

������ �� �� ���. � ��� �� �� ��� IBM Tivoli

Enterprise Console �� � ��� ���� ������.

�: TEC_Start � TEC_Stop ���� ��� ��� ���� ����. �� ��

�� �� �� �����.

��� ���

��� ����� ��� ������� �� ���� ��� ���� ���

���. ��� ���� �� �� ���� �� ����� � ����

�� ���� ����� ��� �� ���. ��� �� �� ���� ��

��� ���� � �� �� �� � � ��� ��� � � ��� ��

�� �� ���.

�� ��� ��� ���� � �� �� �����.

v �� �� �� ���� ���� ��� � ���. ��� ��� ��

��.

– Cabletron ��� �� ��� ��� ��� ����� �����, ��, �

�� � ��� ����� ������.

– Shiva ��� �� ��� ���� ������.

� 1 � � �� �� 7

– NetWare ��� �� ��, �� ��, � ��, �� �� � �� ���

���� ��� � ���.

– Cisco ��� �� ��� �� ���� ��� ���� ������.

v ASCII �� ��� ���� �� �� ��� ���� ��, ��� ����

�� ���� ��� �� ��� �� � ���.

v Windows NT ��� �� ��� � Windows ��� �� ���� ��, ��

� �� �� �� ���� ����� �� �� �� ���� �� � �

�� ��� �� ���(PreFilter ��). Windows ��� �� ���� �

�, ��� �� ��� ��� �� � ���(WINEVENTLOGS ��).

v ��� ���� ��� �� � �� �� ��(�� ��)��� ��� �

� �� � ���.

v Tivoli ��� � � ���� � Tivoli Enterprise Console ������ �

� ��� �� � ���. �� ��� ��� ��� ��� �� ����

���� �� �� ���� ���, ��� ���� ����, ��� �

��� ���� ������.

v Tivoli Availability Intermediate Manager� ��� ��� ���� Tivoli Enterprise

Console � ��� ����� ���. � ���� Tivoli Enterprise Console �

��� � ��� �� ���.

v �� ��� Tivoli Enterprise Console� ���� � ��� � ���� ��

��� �� ���� �� �� ��� �� � ���.

���� �� ��

Ctrl+A � Ctrl+B �� ����� ����� �� � ����. ���� ��

� �� �� ���� �� �� � \001 � \002� ������.

��� ���� ���� ��� �� �

��� ��� �� ��� �� ���� ��� �����.

acl ��� ���� ���� ��� �� �� �� ��

administrator

���� ����� �� ��� ��

cause_date_reception

��� � ���� date_reception �� �. � �� � ���� � �

��� ����� � �����. cause_event_handle ��� � ����

� ���� ����� � �����.

cause_event_handle

��� � ���� event_handle �� �. � �� � ���� � �

8 IBM Tivoli Enterprise Console: � �� ���

��� ����� � �����. cause_date_reception ��� � ���

� � ���� ����� � �����.

credibility

���� ������ ��� �� �����. TME® ���� ��� �

�, Tivoli Management Framework ���� ��� � ��� ���

� ���� ��� ���� �� 1���. ���� TME ������ �

�� ��, � �� 0���.

date_reception

��� ��� ���� �� ��� ���� �� �. 1970 1� 1� �

� �� ��� ��()� ���� �����. � �� ���� ����

���� ������ �����. ���� date_reception event_handle �

server_handle ��� �� �� ���� ���� �����.

duration

�� ��� ���� ��, ��� ��� �� ���� ��� ���� �

� ���� �� ��� ���� ���� ��( �). � �� ���

� �� �� ���� ���� �� 0���.

�: ���� � ��� set_event_status �� ��� �� ������,

� ��� ��� ����� ���� ����. �� 0�� ����.

event_handle

��� ��� ���� �. ���� date_reception event_handle �

server_handle ��� �� �� ���� ���� �����.

num_actions

� ���� �� ��� ��� �� � �� ��(��� �� ��

�)� �

server_handle

� ���� �� ��� ��� ���� ��. ���� date_reception

event_handle � server_handle ��� �� �� ���� ���� ���

��.

server_path

���� ���� � ��� ��� �� ��� ���� ��� ��. ��

� �� �� ��� ID� �� ���� �� ���. ��� ID ���

10 ���� ���� ���� ���� ���. re_split_event_id �� �

�� � �� �� ��� �����. �� ��� 211 ����

�re_split_event_id�� ������.

status ���� ��. �� OPEN �� ��� ���� �� ��� � ���

���� ���. ���� �� �� � �� �� ��� ����.

� 1 � � �� �� 9

ACK ���� ���� �� �� �

CLOSED

�� �� �� ���� �� ��� ���� ������. ��

� ���� ��� ���� ��� ��� ���� ��� CLOSED

� ��� � ��� �� ���� CLOSED ��� �� �

���. �� ��� �� ��� ��� ���� �� ����

� � ������. CLOSED ��� ���� ���� ���

� ��� ���� ���� ����.

custom_status

��� �� ���� STATUS � ��� ��. � ����

STATUS ��� root.baroc ��� ���� ���. � ��� �

����, � ��� ����, � ���� �� �����, ��� �

�� � ������.

OPEN

��� ��� ���� ����, �� �� �� �� ����

� �����.

RESPONSE

�� �� ���� ������. � ��� � �� �� �

� �����. ��� ��� � �� �� � ����.

��� ��

��� ��� � ��� � ����� � RAM� ��� ���� �����.

� ��� 1000�� ������. ��� wsetesvrcfg ���� ��� �� ��

�� �� ��� �����.

���� ��� ID��� �� �� ��� ��� �� �� ���� ����

�.

event_handle

1� ��� �� ���� ��, �� 1���. 1 �� � ��� ��

�� �����, � �� �� ���� ��� ��� �����.

server_handle

�� TMR(Tivoli Management Region)� ��� ��� �� � �� 1�

��.

date_reception

�� ��� �

10 IBM Tivoli Enterprise Console: � �� ���

�� ��� ��� ID� ���� ����.

Tivoli Enterprise Console �� �� ���� ����� � �� ��� ��

� ����� �� ��� �����. �� � ���� �� �� �� ��� �

����. � ��� ����� � ��� �� ��� ���� �� Prolog ��

��� ��� �� ��� ����� �����. � ��� � ��� ��

Prolog �� ��� �� ����� �� �� Prolog �� ��� ������.

� ��� ���, ����� � ��� �����. �� �� ��� � ��

�� �����. �� �� �� �� ��� 81 ���� �� �� ��� �

��.

�� ���� �� Prolog� �� ��� ����� ��, �� � ��� ���

��� ��� ���� ��� � ��� � �� � ���. Prolog� ��

�� ��� � ��� �� ���, 385 ���� �� A ����� Prolog �

���� � ��� �� � � �� ��� Prolog �� ��� �� � ��

�� ���. �� ���� ��� � � Prolog� �� �� �� ��� xiii

���� ��� ���� ���.

� ��

��� 5��� ��� ����.

�� �

�� ���� ��� �� � ��� ��� ���� � �����.

��� ��� ���� �� ��� ����� ���.

� �� ���� �� � �� Prolog �� ���� �� � �

��.

� 1 � � �� �� 11

�� �

��� ���� ��� � ��� ��� ���� � �����. ��

�� ��� ���� ��� �� ����� ���. �� ��� ��, ��

� ��� ���� �� �� �� � ���. ��� ����� ��� �

� �, ��� � �, ��� �� ��� ���� �� ��� ��� ��

���� ���. �� ��� ��� �� �� � ���.

v ��� � (�: ��� ���� ��� OPEN�� CLOSED� ��)

v � ��� �� � �(�: place_change_request �)

v ������ ���� �� ��� �� CLOSED �� � ��

�� �� ��� �� � �� Prolog �� ���� �� � �

��.

� ��� � �� �� � ���. ��� �� � �� ��� ��

�� ���� ��� �����. �� ��� 78 ���� ��� ���� �

�����.

��� �

���� ��� ��� ��� �� � �����. ��� � ��

set_timer �� � ���� ��� � ���. ���, ���� �� �

��� ��� �� ���� �� ��� �� � ��� �

� �, ��� ��� ��� ��� ���� � ��� �� ����� �

�� �� ��� �� ���. �� ��, �� �� ���

Prolog �� ��� �� � ���.

�� �� � �� �� � ���. ��� �� � �� ��� �

� �� ���� ��� �����. �� ��� 78 ���� ��� ���

� ������.

�� �

�� ���� ��� �� ��� ��� � �����. � �� � �

� ���� ����. �� ��, ����� �� � ��� �� �

�, � �� Prolog �� ��� �� � ����. � �� ��

���� ���� ��� ����, ��� ���� �� ���� ��� �

�� �� ����.

�� �

�� ���� ��� �� ��� ��� � �����. �� �� �

�� ��� �� � ��� �� � ���. � ���� � �� �

��� ��� �� ���� ���. �� �� ���� status ��� �

� � ������ � ���� �� � ���. �� ��, � �

��� �� �� �, ��� � ���� �� �� �� ��� �

���. �� �� � �� �� ��� �� ���� ���.

12 IBM Tivoli Enterprise Console: � �� ���

�� � ��

�� ����� �� �� ������ ������. ��, � � ��� �� ��

�� � ��� �� � ���. �� ��� ��� �� � ��� 61 ����

�� ���� ���� ���.

rule_type: rule_name: ( description event_filter action1 action2 ... ).

�� ����� � �� ��� ��� �����.

� �� ��

�� ���� �� ��� ��� ��� �� ��� � � ����

�. ��� ��� ��� ��� �� � ��� �� ��� �� ����

� ���. ��� ��� 70 ���� ���� ���� �� ���� ���.

�� �� �� � �� �� ��

�� ��� ��� �� � � � � ��� � �� ��� �����.

v ��� �� ��� ��� ����.

– �� ���� �� ���

– �� ���� �� ���

– �� ���� �

� 1 � � �� �� 13

v � ���� � ���� �� ��� ��� � ���� � ���� �

����.

v ���� �����. �� ��, ���� �� �� ���� �����.

v Tivoli ��� �� �� ���� �����.

v � ���� ����.

v ���� ��� ����, ��� �� � ���� �� �� �� ��

� ���.

� ���

����� � ���� ��� ���� ��, ��� ���� ���� �, ���

�� �� ���� �� �����. IBM Tivoli Enterprise Console ��� �

��� � ���� � ��� ��� ��� ��� ������. � ��� ��

� � ��� ��� ��� ���� �� � ������. ���� �� � ��

� � � ��� ����� ��� �� ��� �� � ���. � ��� �

�� 16 ���� �� ��� ���� �� ���� ���.

�� ��� � ��� � �� �� ���� � � � ��� � �

���. �� � ��� ��� �� � �� ���, ��� ��� Tivoli Availability

Intermediate Manager ��� ��� � ���� �� � ��� ���� �

� Tivoli Availability Intermediate Manager ��� �� � IBM Tivoli Enterprise

Console ��� ��� ��� �� �� � Tivoli Availability Intermediate

Manager ��� ��� ��� �����. ��� ���� ���� � ��� �

�� � �, �� ���� � ��� �� ���� � ���� � ����

� ���.

� ��� ����, ��� ��� � �� �� � �� �� ����

���. ��� ���� �����, �� � ���� � ��� �� ���

� ���� �� IBM Tivoli Enterprise Console ��� ��� ���� ��

�. ��(�: Tivoli Availability Intermediate Manager ��� ��)�� ��

��� ��� ��� � ���� IBM Tivoli Enterprise Console ��� ��� �

� ���� � ��� ����� ����.

�: Tivoli Availability Intermediate Manager ��� ��� � ���� ����

�� � �� ��� Tivoli Availability Intermediate Manager User’s Guide

� ������.

� ���� �� ���� � � ��� �� �� IBM Tivoli Enterprise

Console 3.6.2 � �� ����� �� �������. �� ��� IBM Tivoli

Enterprise Console ��� ��� � �� ��� ��� �� ��� � �

��� ���, � ��� �� ��� wrb ��� ����� �����. � �

�� Tivoli ������ �� � � �� � ���� ������ �� �

14 IBM Tivoli Enterprise Console: � �� ���

� �����. � ���� ���� ��� ��� �� ����� ���� ���

��� ���� ���� ����. wrb �� �� � ��� ���� � ����

������.

�:

1. ��� � ���� ������ ��� 3.7 ���� ���� � ����

� �� �� ���� IBM Tivoli Enterprise Console ��� ���� �

��� ���� � � ����� IBM Tivoli Enterprise Console ��� 3.6.2

� �� ���� � ����� ���� � ���� ��� ����. � ��

� ���� ����� IBM�� �����. �� ��� IBM Tivoli Enterprise

Console �� � ��� ����� wrbupgrade ��� ������.

� � ��� �� � ��� ����� � ���� ����� �

3.7 � �� ����� ���� � ����� ���� ���. �� � ��

�(3.7 �� ���)� � ����� ����� ����� ��� �� � �

, � ��� ��� �� ��� ����� ���� ����. �� � �

��� � ��� ���� ���� �� ������ ���.

2. ����� � ���� �� �(�� ��, � ��, ��� ���, � �� �

��� �� ��� ��), � ���� � � ����� ��� �� ��

��� � ���� �� � ��� �� ���� ���.

� 1 � � �� �� 15

�� ��� � ���� ���� �� �� ����.

� ��� ��

� ��� ��� � ��� ���� �� � ������. ��� � ��� ��

� ��� ���� � � ��� ��� ����.

IBM Tivoli Enterprise Console ��� ���� � ��� ��� ��, � ���

��� rule_base_directory/.rbtargets/target_name ���� �����. (rbtarget �

���� ��� �� �� �� ������.) IBM Tivoli Enterprise Console

��� ���� � ��� �� ���� � ��� ��� ��� EventServer��

�. EventServer � ��� ��� �� � ����� �� �����. ��

��� ��(�: Tivoli Availability Intermediate Manager ��� ��)� ���

���� � ��� ��� � � ����. ��� ����

target_name ������ ���� � ��� �� ��� �� �����.

16 IBM Tivoli Enterprise Console: � �� ���

� ��� ��� ��� ��� � �� ���� ���, ����� �

IBM Tivoli Enterprise Console ��� ��� � ������ ��� � ��� �

��� �����.

� ��� ��� � ��� �� ��� � ���� �� � � �� �

� �� � ���. ��� ��� � ��� ��� �� � ��� ��

� ��� ���. �� ���� �� wrb ��� ��� ��� ��� �� ��

�� ���. �� ��, ��� �� � ���.

v -crttarget ��� -import ����� � �����. � ��� � ��� ��

� ���� � ��� � ��� ���� �����.

v -imptgtrule ��� �����. � ��� � ��� ��� � ��� ���� �

����.

� ���� � ��� ��� � ���, -detailed ����� � -lsrbtarget ��

� �� � ���.

���� ��� ��� � ���� ���� � � ��� ��� � � �

���. �� ��, �� ��(re_send_event_conf �� ��), Prolog �� �� �

�� ��� ���� ���� � ���. wrb ��� -imptgtdata ���

���� �� �� � ���.

wrb ��� �� �� ��� IBM Tivoli Enterprise Console �� � ��� �

��� ������.

� �� � � �

� ��� �� �� � �����. �� ��� �� � ��� ���. �

��� 16 ���� �� ��� ����� ��� �� wrb ��� ���� � ��

� ���� �� � ���. � ���� ���� �, � ��� �� � ���

���� ��� � ��� ���� �����.

� ���� � ��� �� ���� � �, ����� �� � �� �� ���

���� ��� � ��� � ��� ���� ��� ���� �����. ��� �

���� ��� � ��� ��� �� �� ���� ��� � ���.

�: � ��� ��� �� ��� � ��� ��� � �� �� �� �� �

�� ����. � ��� ��� � ��� �� � ��� �����.

� � ��� � � ���� � IBM�� �����. Tivoli Availability

Intermediate Manager� �� � � ��� � � ���� � ��

���. �� ��� IBM Tivoli Enterprise Console � �� ���� �����

�.

� 1 � � �� �� 17

� ��� � ��� ���� ���� ��� �� � �� ���� ����. �

�� � ��� ��� ���� �� � ��� ���� � ���� ��� �

� �� ��� ����. � �� �� � ��� ��� ���� � ��� �

�� ���� � �����. � ���� ���� �, � �� ����� ��� �

��� ��� � �� � � ��� ����.

� �� � � �� � ��� ���� ���� ��, IBM Tivoli Enterprise Console

��� ��� � ���� �� ���� ���. IBM Tivoli Enterprise Console

��� ��� � ���� � ��� ��� ���� �� ����� �� ���

����� � ��� ��� � ���� ��� �� � ������. wrb ��

� ��� ��� ���� � �� � � �� � ���� ���� �� �� �

� ���. �� ��, ��� �� � ���.

v -cprb ��� -rulesets � -rulepacks ����� � ��. �� � ���� �

�� � ���� ���� �� �� � ������ � �� � � �� ���

��.

v -crtrp ��� -import ����� � ��. � �� ���� � ��� �� �

��� �����.

v -imprprule ��. � ��� ��� � ��� �����.

v -imprbrule ��. � ��� � ���� �����.

� ���� � �� � �� ��, -lsrbpack ��� -detailed ����� � ��

� ���.

� ���� � ��� � �� ��, -lsrbrule ��� �� � ���.

18 IBM Tivoli Enterprise Console: � �� ���

�� ��� ��� ���� � ����� � �� � � � ��� ��� � �

��� �����.

wrb ��� �� �� ��� IBM Tivoli Enterprise Console �� � ��� �

��� ������.

��� � ��� � ���� ���� � ��� ���� � ���� ���

�� ���. �� ��� 26 ���� �� ��� ��� � ��� �� ����

������.

� � ��: ��� Production � ���� IBM Tivoli Enterprise Console ��

� ��� �� ������. wrb ��� ���� �� ���� �� � ���

� � ��� � ���. �� ��� ��� $ �� ��� �������.

$ wrb -lsrbrule Production Rule Set files -------------- ov_default.rls log_default.rls tecad_snaevent.rls tecad_nv390fwd.rls tecad_nv390msg.rls

� 1 � � �� �� 19

�� ��� � � �� �� �� � ���� EventServer ��� ��

� �� � ��� ���� �� ��� � �� �� ���. Production

� ���� � �� � ��� ��(Support, Mail � Development )� ���,

wrb -imprbrule ���� � � ��� ����� ���� 8�� ��� ��� �

� �� �� ���� wrb -imprprule ���� � � ��� � � �� �

��� ��� � �� ��� ��� �� � ���.

� ��� �����, �� ��� �����. ��� ���� �� ��� �

�� �����.

1. Production � ���� defaultRules � �� ������.

$ wrb -crtrp defaultRules Production

2. Production � ���� �� � �� � �� �� �� �����.

$ wrb -lsrbpack Production Rule Pack Files -------------- defaultRules

3. �� � ��� ���� � �� ������.

$ wrb -imprprule ov_default defaultRules Production

$ wrb -imprprule log_default defaultRules Production

� �� ���� � ��� �� ��� � ���.

$ wrb -crtrp defaultRules -import ov_default log_default Production

4. � �� � � ��� ��� ��� �� ������.

$ wrb -imptgtrule defaultRules Support Production

$ wrb -imptgtrule defaultRules Mail Production

$ wrb -imptgtrule defaultRules Development Production

� � ��� ��� Production � ���� ����, ��� defaultRules � ��

� � ��� �� �, � �� �� ��� �� ��� ���� �� �

���. �� ��, �� ��� � Marketing � ��� ��� ���� defaultRules

� �� �� ���� �����.

$ wrb -crttarget Marketing -import defaultRules Production

Production � ���� ���� �, defaultRules � �� ���� � ���

�� � ��� ��� �����.

�: � ��� � ��� ���� � �� ��� � ��� ����� ���� �

���.

� �� ��: �� ��� � �� �� �� �� �����. � ��� ��

�� �� wrb �� �� � ��� �� � ���.

20 IBM Tivoli Enterprise Console: � �� ���

�: � ��� ����� �� � ��� ��� ���.

wrb �� ��� �� �� �����. � �� � ��� ���� � �� �

�� 26 ���� �� ��� ��� � ��� �� ���� ������.

1. � ��� ����� �� ��� �� ��� ��� ���� ����� �

�����.

2. � ����� �� ��� ������.

wrb -delrbrule rule_set rule_base

3. � ���� � ��� ������.

wrb -imprbrule rule_set.rls rule_base

4. � ���� �������. � ��� � ���� ��� �� � ��� ��

� �����.

wrb -comprules rule_base

��� ���

� ���� �� ��� �� � ��� ��� �� ��� ��� ��� ���

���. �� � ��� ���� � ��� ���� �� �� �� � �

��� ���� �� � �����. ��� ���� ���� �� ��, �

�� ���� ���� �� ��� ��� ���� ��� ���� �����. �

��� ��� ��� �� ������ ���� ��� ��� � ���� ���,

���� ��� ��� �� ��� PARSING_FAILED ��� ���� ����

�.

� ���� �� �� � ��� ��� �� ��� ��� �����, �� �

�� � wrb ��� IBM Tivoli Enterprise Console ��� ��� � ��� ��

�� BAROC ��� �����. � ���� ���� �, ��� ���� � ��

�� ��� � ��� ��� �����.

�:

1. BAROC ��� ��� ����. ��� ��� �� �� � ��� ���

��.

2. root.baroc � tec.baroc ��� � ���� �� � �� �����.

BAROC ��� ����� � �� ��� ���� 26 ���� �� ��� ���

� ��� �� ����, wrb �� ��� ���� IBM Tivoli Enterprise Console

�� � ��� ���� ������.

BAROC ��� �� �� ��� 41 ���� � 2 � ���� ��� ��� �

�����.

� 1 � � �� �� 21

��

��� ���� �� IBM�� ���� � �� �� ��� ���� ��

IBM Tivoli Enterprise Console ��� ��� � ��� ��� ��� ���. �

���� ���� �, �� � ���� ��� � ��� ��� �����. �

� ���� ��� ����. �� � ���� �� � �� �����.

� �� �� 81 ���� �� �� ��� ���� ���.

�� Prolog �� �� �� ���� ���� �� �� �� �� � �

��. Prolog �� 385 ���� �� A ����� Prolog ���� ���� �

��.

� ��� ��

� ��� wrb ��� � ��� �� ��� ���� � ���� ���� ���

�� �� �����. wrb ���� � ���� ���� �� �� � ��

�� �� � �� �� �����. wrb ��� �� �� ��� ����

�, IBM Tivoli Enterprise Console �� � ��� ���� ������. � ��

� ���� � ��� ���� ��� �� ��� 26 ���� �� ��� ���

� ��� �� ���� ������.

� ��� ��� �� ��� IBM Tivoli Enterprise Console ��� ��� �

� Tivoli Availability Intermediate Manager ��� ��� �����. Tivoli

Availability Intermediate Manager ��� ��� ��� ���� ��� ���

� �� ���� ��� �� IBM Tivoli Enterprise Console ��� ��� ��

� ��� ���� ���. �� ���� ��� �� ��� ��� �

��� �� ���� ��� �� �����.

� ��� �� ����: �� ��� � ��� ����� �� �����.

v � ��� ��� Operations���. �� �� � � �� ���� ���� �

�����. �� � �� �� �� � � �����.

v � ���� /tec_rule/Operations ���� �����.

v �� � ��� ��� Operations � ���� �� � ��� ����

Operations � ���� �����.

– EventServer: IBM Tivoli Enterprise Console ��� ��� � ��� �� �

���. � � ��� ��� �� �����.

– aimPersonnel: �� �� �� ���� �� Tivoli Availability

Intermediate Manager ��� ��� � ��� �� � ���

– aimAccounting: �� �� �� ���� �� Tivoli Availability

Intermediate Manager ��� ��� � ��� �� � ���

� ��� �� ��: �� ��� � ��� ����� �� �����.

22 IBM Tivoli Enterprise Console: � �� ���

v IBM�� ��� � � ���� ��� ��� ��� � ���� �����.

��� BAROC ��� tecad_nt.baroc��, �� Windows NT ��� �� ��

�� �� ��� ���� �����. � � ���� $BINDIR/TME/TEC/

default_rb ���� ���. BAROC ��� TEC_CLASSES ������

���.

v �� � ��� � ������ � ���� ��� ���. � � ���

/tec_rule_dev/rls ���� ���� ���.

– tec_server.rls: IBM Tivoli Enterprise Console ��� ���� ���� ��

� ��. � �� IBM Tivoli Enterprise Console ��� ��� �� �

� ���� �� Tivoli Availability Intermediate Manager ��� ���

�� ��� ���� �����.

– aim_ops_perf.rls: �� Tivoli Availability Intermediate Manager ��� �

��� � �� ���� �� � ��. � � ��� ��� ��� �

���.

– aim_ops_sec.rls: �� Tivoli Availability Intermediate Manager ��� �

��� �� �� ���� �� � ��. � � ��� ��� ��� �

���.

– aim_pers.rls: Tivoli Availability Intermediate Manager ��� ���� ��

�� �� �� ����� �� ���� �� � ��

– aim_acct.rls: Tivoli Availability Intermediate Manager ��� ���� ��

�� �� �� ����� �� ���� �� � ��

v aimOps � �� ��� ���. ��� aim_ops_perf.rls � aim_ops_sec.rls �

��� ���. � � ��� �� Tivoli Availability Intermediate Manager

��� ��� ����.

�� ��� � ��� ��� � �����.

� 1 � � �� �� 23

�� ��� IBM Tivoli Enterprise Console ��� ���� Operations � ���

� ���� �� ����.

� ��� �� ��: Operations � ���� ����� ��� ������.

1. � ���� ������.

wrb -crtrb -path /tec_rule/Operations Operations

2. ���� � ���� ������.

wrb -imprbclass /data/TME/TEC/default_rb/ \ TEC_CLASSES/tecad_nt.baroc Operations

3. � ��� � ���� ������.

wrb -imprbrule c:/tec_rule_dev/rls/tec_server.rls \ Operations

wrb -imprbrule c:/tec_rule_dev/rls/ \ aim_ops_perf.rls Operations

wrb -imprbrule c:/tec_rule_dev/rls/aim_ops_sec.rls \ Operations

24 IBM Tivoli Enterprise Console: � �� ���

wrb -imprbrule c:/tec_rule_dev/rls/aim_pers.rls \ Operations

wrb -imprbrule c:/tec_rule_dev/rls/aim_acct.rls \ Operations

4. �� �� ��� �� � ��� � ���� ����� ������ �

����. $ �� ��� ����� �����.

$ wrb -lsrbrule Operations Rule Set files -------------- tec_server.rls aim_ops_perf.rls aim_ops_sec.rls aim_pers.rls aim_acct.rls

5. � ���� � �� ������.

wrb -crtrp aimOps -import aim_ops_perf aim_ops_sec Operations

6. � ��� EventServer � ��� ��� ������. (EventServer � ���

��� �� ���� �� ������.)

wrb -imptgtrule tec_server EventServer Operations

7. aimPersonnel � ��� ��� ���� � � � � ��� ������.

wrb -crttarget aimPersonnel -import aimOps \ aim_pers Operations

8. aimAccounting � ��� ��� ���� � � � � ��� ������.

wrb -crttarget aimAccounting -import aimOps \ aim_acct Operations

9. � ���� �������.

wrb -comprules Operations

10. � ���� ���� �������.

wrb -loadrb -use Operations

11. ��� ��� � � ����� Operations � ���� ������. IBM

Tivoli Enterprise Console ��� ��� � ��� EventServer � ��� �

�� ��� �, ��� ��� �� � �� �����.

12. �� �� �� ���� ���� Tivoli Availability Intermediate Manager

��� ��� � ��� �� aimPersonnel � ���� /tec_rule/

Operations/.rbtargets/aimPersonnel ������ �� � ���. ��� �

��� Tivoli Availability Intermediate Manager User’s Guide� ������.

13. �� �� �� ���� ���� Tivoli Availability Intermediate Manager

��� ��� � ��� �� aimAccounting � ���� /tec_rule/Operations/.

rbtargets/aimAccounting ������ �� � ���. ��� ����

Tivoli Availability Intermediate Manager User’s Guide� ������.

� 1 � � �� �� 25

� ��� �� � ��� � ��

� ���� Tivoli ������ � ��� ���� � ���� ���� ��� �

� �����. �� ���� � � �� �� wrb ��� � �� � �

� IBM Tivoli Enterprise Console �� � ��� ����� �� �����.

�:

1. � ��� � ���� ���� � ��� �� �� � � ��, �� � ���

�� �� �� ���� ����.

2. wrb -crtrb ���� ��� � ���� � � ����� � � ��� �

�� ��� EventServer���. � ��� ���� � ���� ��� � ��

� � ��� � ��� ���� ��� �� wrb -imptgtrule ��� ����

EventServer � ��� �� �� � ��� ���� ���� ���.

3. � ��� ��� ���� ��� � �� ��� ���� � ��� � ���

�.

4. � ��� ��� � �� ��� ��� ���� � ���.

5. upgrade_gui.sh ��� ���� �� 3.6.2 � �� ��� � ��� ��� �

� �� 3.7 � �� ��� � ����� �� ���� � ���� �� �

���. ��� �� � ��� ����� �� � �� �� ��� �� �

� ��� ���. � ���� �� ���� ��, � ��� ��� �� �

�� �� � ��� ��� ���� ��� ���. upgrade_gui.sh ���

�� �� ��� IBM Tivoli Enterprise Console �� � ��� ���� �

�����.

� ��� ���� ��� ��� ����.

v � � ��� ��

v �� � ��� ��

v ��� �� � ��� �

v ��� � ��� �

v � ���� � �� � BAROC �� �

v � ��� ��

v � ��� ��

v � ���� � �� ��

v � ���� BAROC �� ��

v � ��� ���

v � ��� �� � ���

26 IBM Tivoli Enterprise Console: � �� ���

� � ��� �: Default � ���� ��� � ����. �� IBM�� ���

� � ������. ����, � � ���� ��� �� ��� ��� � �

� ����� � � ���� ��� ���.

�: �� ���� ��� � ���� ���� ���� �� � � ���� ���

� ��� �����. �� ��� 30 ���� �� ��� ���� �����

�.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� � ��� �� ��� �� senior

� � ���� ����� ��� ������.

1. ��� �� ��� � ���� � ���� � �� ��� �� � ���

�� ������.

2. �� ���� � ���� � �� � ��� �� �� �� ������.

3. �� ��� ��� � � ���� ��� ������.

� 1 � � �� �� 27

4. ��� �� ��� ��� � � ���� �� �� �� ��� ����

��� �� � �� ���� �� �� ������. ��, � � ��

�� ���� �� �� ���.

5. � � ���� ���� � ��� �� �� �� ���� �� � ��� �

����. � � ���� ���� � ��� �� �� �� ����. � �

���� ���� ���� ��� �� � ��� �� �� �����.

�� � ��� ��: �� � ���� � �� �� ��� ���� ��� �

���. � ���� ��� ���� �����, �� � ��� ��� � ���

�. � ��� �� ���� �� ��� ��� ���� � �� ��� ���

���� �� ���� � ���. ���, � ��� ���� �� ��� ��

��� ��� �� ���� �� ��� �� �� � ���. � ��� �

���� ���� � �� ��� 269 ���� � 7 � ���� � ��� � �

��� ������.

��� �� � ��� �: ��� ��� ��� �� � ���� � �

���. ��� � ���� ����� �����.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

��� �� � ��� � ��� �� user

��� �� � ���� � ���, ��� �� ��� � ���� � ����

� ����. ��� ��� �� � ���� ��� �� � ��� �� ����

�. ��� � ���� �� ��� ��� ����� �����.

28 IBM Tivoli Enterprise Console: � �� ���

��� � ��� �: ��� ��� � ��� � ���� � � ��

�. � ���� ��� � ������� �� ��� � ��� ��� �����

� ��� ��, �� �� � ���� �� �� �� ���.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

��� � ��� � ��� �� user

��� �� � ���� � ���, ��� �� ��� � ���� � ����

� ����. ��� �� � ���� ��� �� � ��� �� �����. ��

� � ���� �� ��� ��� ����� �����.

� ��� � �� � BAROC �� �: � ���� �� �� �� �

��� ��� ��� ��� �� �� BAROC ��� �����

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� ���� � � �� �

BAROC �� �

��� �� user

� 1 � � �� �� 29

� ���� � �� �� � BAROC ��� � ��� ��� ������.

1. ���� � ��� � ���� ��� � ����. � ���� �� �� �

� �����. � �� ��� ��� �� �� ���� BAROC ��� �

�� �� ��� �����.

2. ��� � ������.

� ��� ��: �� ��, � � ���� �� �� � ��� � ���� ��

�� ���� �� � �����.

�:

1. � ���� ��� � ���� �� � ���. �� � ���� ���

� ��� �� � ���� �� ��� ���. �� ��� 27 ���� ��

� ��� ���� ������.

2. �� �� �� �� ��� � �� ��� ���� ��� � �� ���

����. �� �� �� ��� �� ��� � ��� ����. ���, �

� �� �� ��� ���, � ��� ���� � ���� ���� � ���

� ������. �� � � �� ��� � � ���� ��� � � ��

��.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� ��� �� ��� �� senior

� ���� ����� ��� ������.

1. ��� �� ��� � ���� � ���� � �� ��� �� � ���

�� ������.

30 IBM Tivoli Enterprise Console: � �� ���

2. �� � ���� � ���� ��� � ����. � ��� �� �� �

� �����.

3. �� � ��� ��� ���� �� � ���� � ����. �� � ���

��� ������ �� � ���� � �� � �� ��� � ���� �

��� � ���� �� � ���.

4. ��� � ������ �� ����� � ��� � ����.

5. ��� � ������ ���� ����� ��� ��� � ����.

6. � �� � ���� ��� �� ��� ��� ����� �� �� ���

�� � ����.

7. ���� �� �� � ����� ��� �� ��� ���� �� ��

�� ��� � ����.

8. ��� �� � � ���� �� � ���� �� � ���� ����� �

� � ��� �����. ��� � ���� ��� �� � ���� ����,

��� ��� �� � ��� �� �����.

� ��� ��: � ���� Tivoli ���� �������� �����. ��

��� � ��� ��� ��� ���� ����.

�: ����� �� � ���� ���� ����.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� ��� �� ��� �� senior

� ���� ����� ��� ������.

� 1 � � �� �� 31

1. ��� �� ��� � ���� � ���� � �� ��� �� � ���

�� ������.

2. �� � ���� � ����.

3. ��� �� � ��� �� �� �� ���� ��� � ����. � �

� �� �����.

4. �� � � ���� ������.

� ���� � �� ��: � � ��� ���� ��� � ���� �� �

���� �� �����, � ��� � ���� ��� ���.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� ���� � �� �� ��� �� senior

� ���� � ��� ����� ��� ������.

1. ��� �� ��� � ���� � ���� � �� ��� �� � ���

�� ������.

2. � ���� � ���� ��� � �� � ��� ������. � ����

�� �� �� �����.

32 IBM Tivoli Enterprise Console: � �� ���

3. � �� ��� � ����.

4. � ��� �� �� �� ��� ���� ��� �� ��� ��� ���

� ��� � �� ���� �� �� ������. ��, � ��� ��

���� �� �� ���. ��� �� ���� � ����.

�: �� ��� ��� � �� �� �� ���, ����. ��� ���

�� �� � ��� �����.

5. ��� � ��� ��� � ��� ����, �� �� �� �� ��� �

�� �� � ��� ��� ������. �� �� ��� � ����.

6. � ��� � ���� ���� � ���� �� �� �� ��� �� �

�, ��� �����. ��� ���, �� � ��� �����.

� ���� BAROC �� ��: � BAROC ��� �����, ��� � ��

�� � BAROC ��� ��� ��� ����, �� � ���� ����

�� � ��� ���� ��� ���� �� ������. BAROC ��� �

��� ��� � ���� ��� ���.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� ���� BAROC �� �� ��� �� senior

� ���� BAROC ��� ����� ��� ������.

1. ��� �� � ��� �� ����� ��� �� ��� � ���� � �

��� � ����.

2. ��� ��� ���� �� � ���� � ���� ��� � ����. �

���� �� �� �� �����.

3. ��� �� ��� � ����.

4. ��� �� ��� ��� �� BAROC ��� �� �� ��� ���

� ��� � �� ���� �� �� ������. � ���, BAROC �

�� ���� �� � ���. ��� �� ���� � ����.

� 1 � � �� �� 33

5. �� BAROC ��� ��� �����, �� �� �� �� ��� �

�� �� ���� ��� � � � ��� ��� �� ��� ��� ����

��.

�: � ��� ��� � ���� �� � ����. ��� ��� �� �

� � ��� �����.

6. BAROC ��� ���� � ���� �� �� �� ��� �� ��, �

�� �����. ��� ���, �� � ��� �����.

� ��� ���: �� ��� � ��� �� ��� � ���� � ��� ��

���� �� ����� ���. ���� � ���� 2� �����.

�: � ���� ���� �� ����� ��� �� ���� �����.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� ��� ��� ��� �� user

� ���� ������ ��� ������.

1. �� � ��� � ���� ���� � �� � ��� ��� �� ��

������.

2. � � ����� �� � ��� ����� � ��� � ����. � ��

� � � � �� ���� �� � ���� ���� � ��� �� ����

�� ��� ���.

3. ���� �����. � ��� ��� �� �� ���� �� �����.

4. ��� � ������.

� ��� �� � ���: ��� � ���� ��� ��� ��� ��� �

� ���� � ���. � ���� ���� �� �� ����� ��� �� �

34 IBM Tivoli Enterprise Console: � �� ���

�� � ��� ��� ���� � ����� ��� �� � ���. ��

��� 36 ���� ��� � ��� � ����� ������.

�� �� � ��� ��� Tivoli �� �� � � ���� �����.

�� ���� Tivoli ��

� ��� �� � ��� ��� �� senior

�: BAROC ��� ��, �� �� ��� ��, ��� ��� ��� ����

���� ���.

� ���� ���� � ��� ������ ��� ������.

1. ��� �� ��� � ���� � ���� � �� ��� �� � ���

�� ������.

2. � ���� � ���� ��� � ������. � ��� �� �� �

� �����.

3. � ���� ��� ��, �� �� � ���� �����, � ��� ��

� �� ���� � ����.

--��--

� ���� ���� �� ��� ��� ���� � �� � ����

���, � ��� �� � �� ��� � ���� � ����.

4. �� � ��� �����.

� 1 � � �� �� 35

��� ��� �� �� ���� ��� ��� ���� �� � ��� ��

�� ����.

�� � ��� � ���

�� � ���� � ��� �� �� ��� �� � ������. ��� �

���� ��� ��� �� ��� ��� ���� ��� � ������. ���

� ���� �� � ���� �� � ���� � ���. �� ��� � ��

�� �� �����.

v �� � ��� �� � ���� ��� Default�� ������. ��� �

�� �� � ��� New � ���� ��(, ������ ��)��

�. ��� � ���� �� New�� �� � ���� ��� Default���. �

�� ��� ���� �����, New � ���� ���� �� � ����

���. ��� ��� ��� �� ��� � ���� ������.

v � �� � ��� � ���� �� Default�� ������. ��� ��� �

� � New � ���� ���� ������. � �� � ��� � �

��� �� New���. � ���� �� ���� BAROC ��� ���� �

��, � �� ���� �� ��� ��� ��� ��� ��� ����.

BAROC ��� ���� ��� ��� ��� ��� ���� ���.

�� ��, � ���� ���� � ��� ��� � ��� ��� ��� ��

� �� ��� �����. ��� ��� � � ��� �� ��� � ����

���� BAROC ��� ���� ����, ���� ��� ��� � � ���

� � ��� ����� ���� ��� ���. � ���� �� � ��� �

���� �� ��� ����, ��� ��� ��� ���� � ���� ����

�� ��� � �� ��� ��� �� ����� �� � � �����

�.

� ���� �� �, � � ��� ���� ���� ��� ������. ��

� ��� � ���� �� ��� ��� � �� �� ��� ���� ���.

� ���� � UNIX ���� �

UNIX ��� ��� � ���� �� 755 �� ��� ���� �����.

�� � �� �� TEC_UMASK �� ��� ��� � ���.

1. �� ��� ���� Tivoli �� ��� �� ��� ������.

odadmin environ get > temp_file

��� ��� ���� ���� �� �� ������ . �� ���

TEC_UMASK� ��� � ����. �� ��� �� 7� �� ����. �

� � �� ��� �� � ���. �� ��, � ��� ��� ����

��� 750�� ����� �� �� ������.

TEC_UMASK=750

36 IBM Tivoli Enterprise Console: � �� ���

2. �� ��� ���� Tivoli �� ��� �� ������.

odadmin environ set < temp_file

3. tec_config ����� ���� tec_config ����� ��� ��� 5� �

�����.

� ���, ��� � ��

IBM Tivoli Enterprise Console ��� �� ���, ��� � �� �� �

����.

� ����� ���� ���� ������� ��� ��� ����� ���

� �����.

� ����� �� �� �����. �� �� �� ��� ��(�: �� � �

�, �� � ��, � ��� �� �� �� �)� �� �����.

� �� ���� �� �����. ����� � �� ��� �� ��

�� �����. ���� ��� �� ��� ���.

v �� �� �� ��� ���� ���� � �� ��� ��( �)

v �� �� ��� ��� �

v ��� �� ���� ��� ��( �)

v � ��� �� � �� �� �� ���� ���

�� ��� 255 ���� � 6 � �� ���, �� � ������ ������.

��� �� � �

� �� � ���� �� ���� �� �� ��� ���. �� ��

� �� �� ��� 52 ���� ��� ��� BAROC ��� � 270 ����

��� ��� ��� � �� ������ ������.

�� ��� ��� ��

��� ��, �� � ���� �� � � ���� UTF-8 �� ��

�. � �� ��� � ���� ��� �� UTF-8� ���� ���. wiconv �

�� ���� � �� ��� UTF-8 ���� �� � ���. wiconv ���

�� �� ��� Tivoli Management Framework ���� ������.

v STRING ��� ��� �� ��� �� ���� UTF-8 �� ������ �

� ���.

v �� �� �� � ��� UTF-8 �� ������ �� ���.

v �� �� � ���� UTF-8 �� ������ �� ���.

v ��� ������ ������.

� 1 � � �� �� 37

UTF-8 �� �� ���, ��� ��� �� �� �� ��� �� �� � �

���.

��� � ��� ��� �

Tivoli Enterprise Console ��� ���� UTF-8 ��� ���� �����.

���� ���, ��� �� ����� ���� �� UTF-8 ���� �� �

�� ��� �� ��, �� ���� �� tec_exectask_dbcs ��� ����

�.

$BINDIR/TME/TEC/.tec_config ��� � tec_exectask_dbcs ��� �� �

� ��� �� � �� ��� �����. � �� false���. �� � �

�� �����, ��� ��� ��� � �� ��� �� ������.

tec_exectask_dbcs=true

.tec_config ��� tec_exectask_dbcs=true �� �, ��� ��� ���� �

��. Windows �� �����, UNIX �� Windows� Perl ����� ��

�� �����, tec_exectask_dbcs ��� true� ��� ���. UTF-8 ���

� Windows �� �� Perl ����� � �� � ����. UTF-8� 5.6

��� Perl ����� ���� ����. Perl ����� � UTF-8 ����

�����, UTF-8� ���� Perl 5.6 ��� �� � ���.

exec_program � exec_program_local ���� ��� �: UNIX ��

�� exec_program � exec_program_local � �� �� ��� ����

Perl ��� ���� �� �� �� � ���. tec_exectask_dbcs ��

� true� ������.

�� �� ��� � ���: �� � ��� UNIX ���� UTF-8 �� �

� �� �� � ���, tec_exectask_dbcs ��� true �� false� ��

� ���.

Windows ����� tec_exectask_dbcs ��� true� ���� ���� �� �

�� ���.

exec_task � exec_task_local ��� � ���: exec_task � exec_task_local

� �� �� UTF-8� �� ���� �� � ���, tec_exectask_dbcs �

�� true� ��� ���. UTF-8 ���� ��� ��, exec_task ��

exec_task_local � �� exec_program �� exec_program_local �� ��

� ���.

Windows ����� ���� �� ��� ���.

UTF-8 ��� � �� ��� ��� ���: tec_exectask_dbcs ��� Tivoli

Enterprise Console �� 3.7.1 �� � 3.7.0-TEC-0004 ��� ��� Tivoli

Enterprise Console �� 3.7�� �� � ���.

38 IBM Tivoli Enterprise Console: � �� ���

�� ��� ��� ��� ���� � ���� �� UTF-8 ���� ��� �

�� � ���� � �� ���.

� �� � ���� ��

UTF-8 ��� ��� �� ��� ���

UNIX Windows UNIX Windows

exec_program �

exec_program_local

�� �1 �� � �� ��

Perl 5.5.x �� �� � �� � �� ��

Perl 5.6 �� �� �� � �� ��

�� � �� �� � �� ��

exec_task � exec_task_local �� � �� � �� ��

Perl 5.5.x �� �� � �� � �� ��

Perl 5.6 �� �� �� � �� ��

�� � �� � �� � �� ��2

�:

1. UTF-8 ��� ��� Solaris ���� �����.

2. Windows ����� ���� �� ��� ���. �� ��� � ���� �� � ����.

� 1 � � �� �� 39

40 IBM Tivoli Enterprise Console: � �� ���

� 2 � ��� ��� ��

��� ��� �� � � ���� �� ��� ��� BAROC(Basic Recorder

of Objects in C) ��� ���� � ��� ��� ��� �� ������ ��

�. ���� � ���� �����. ��� ��� ���� �� �, ��� ���

� �� � ���� ��� ���� ���. ��� ���� � ���� �

��� ��� ����, ��� ��� �� ���� �� ��� � ���. �

��� � ���� �� ��� ���� ���, ���� �� ���

PARSING_FAILED ��� ���� �����. IBM Tivoli Enterprise Console�

���� ���� �� BAROC ��� �����. �� ���� ���� ���

� ���� �� �� BAROC ��� ��(�� ��� BAROC ��� ��� �

�� ��� ��)� ���. � ���� �� BAROC ��� � ��

�.

�: BAROC �� ��� BNF(Backus Naur Format) ����� ��� 493 ��

�� �� B �BAROC ��� BNF ���� ������.

��� ���� ��� ���� ��� ��� ��� �� �� ��� ���� �

����. ���� ����� ���� �� ���� ���, ���� BAROC �

�� ��� ��� ��� ��� ����, �� ���� ���� ��� ����

��� ���� �����. �� ��, �� �� ���� �� �� ��� �

����� ������.

Mar 10 08:51:42 aspen su:’su root’ failed for jsmith on /dev/ttyp0

��� ���� �� ���� ��� �����, ��� ��� � �� �� ��

��, ��� �� Tivoli ���� ���� ��� ��� ����.

Su_Failure:source=LOGFILE;origin=aspen; date="Mar 10 08:51:42";host=aspen;sub_source=SYSLOG; from_user=jsmith;msg=’su:su root failed for jsmith on /dev/ttyp0‘;to_user=root;END

��� ��� ��

��� ��� ��� �� ���� ���� � ��� ���. � ����

� �� �� ��� 3 ���� �� ���� ������. �, ���� ���

� �� �� �� � ���� ����� ��� �� ��� ���� ���

��.

1. ���� � IBM Tivoli Enterprise Console ��� ������. ��� ��

�� ����� ��� ��, ��� �� ���� ��� � �� ��� �

© Copyright IBM Corp. 2003 41

��. � ��, �� �� �� ��� �� � ��� �� �� � �

� �� ��� ����. �� ��, � � ��� �� � ��� ��� ���

� ���� �� ���� ���� � ���. �� �� ��� ����� �

��� � ���. �� �� ����� �� ����� ���� ��

�� �� ���� ������ �� � ������.

2. BAROC ���� �� �� ��� ����� �� ������. �� ��

� � ��� ���(�: Temp_Warning, Temp_Critical �� Temp_Normal)�

�� ��� ���� �����. �� ��� � ���(�: Temp_Event)� �

��� ��(�: ���)� ���� ������. ���� ��� ��� ���

� ���� ��� ���� � � �� � ���, ����� ��

���� �� �� ��� �� �� �����. �� ���� ���

�� ��� ���� ���� �� ��� �� � �� ��� ���� ���

�� � ���. �� ��� ���� �� ��� �� ����.

3. ������ �� ���� ������. ������ ����� ��� ��

� ��� �� ��� ���� ���. ��� ��, ������ ����

���� ��� ���� ��� �� ��� ����� ���� �� �

��� � ���. ��� ������ �� ��� ���� ��� �

� ����� � ���. ������ ������ ����� ��� ���

��� ���. �� ��, � � ������� ���� � ����

��, ��� � �� �� � �� ��� � � �� �� ��� ����

� �����(�: Gwyna_Events) �� ����� � ���.

4. ��� ��� �� �� ��� ������. ���� ���� ���� ���

� ����� ��� ��� �� �� ��� ���� � ������ �� �

� �� ���� �� ����.

5. �� �� policy � �� �� �� ��� ������. � ��� ��� ��

��� BAROC ��� ���� �� ����. ��� � ��� ����� �

���� ��� ���� �����. ��� policy� �� ��� � � ��

� ��� ��� � ���� ��� ���� �� �� policy� ����

�. �� �� ��� ��� ��� ��� ���� �� ��� �� �� �

� ����.

�� ��, Cisco Cat 5000 ���� �� �� ���� ������

Cisco_Cat5000_Event�� ���. � ��� ��� cisco_cat5000.baroc ��

cat5000_auto.baroc ��� � Cisco ���� �� ��� ��(�����)�

� ���. Cisco_Cat5000_Event ���� �� ��� Cisco_Event ��

�� �� ������ � ���.

cat5000 ���� � �� �� ���� ������ ��, �� ���

Cisco_Cat5000_Env_Event� ������ Cisco_Cat5000_Event� �� ���

��� ���� cat5000_env.baroc ��� �����. �� �� ���(�:

Cisco_Cat5000_Env_Temp � Cisco_Cat5000_Env_Volatage)� �

42 IBM Tivoli Enterprise Console: � �� ���

Cisco_Cat5000_Env_Envent� �� ������ ���� ��� ��� ��

BAROC �� cat5000_env.baroc� �� � ���.

6. ��� �� ��� ���� �� ��� �� ��� ���� ������.

��� ��� ��

��� ��� ��� ��� ��� ��� � � ��� �� ��� ��� �

����. ��� ��� ��� ��� �� ���.

��� ��� ��� ����� �� ���� �� ������. ��� ��� �

����.

TEC_CLASS: class_name ISA super_class_name DEFINES { attribute_definitions; }; END

�: BAROC �� ��� ���� �����.

��� ��� ��� �� �� ��� ����, �� �� ��� ����,

��� �� �� �� �� � ���.

��� ���� �� ��� � ����. �� ��� � �� EVENT � ��

����. �� ����� tecad_logfile.baroc BAROC ����� ��� Su_Success

� Su_Failure ��� ���� �� ��� ��� ��� ��� �����. � �

��� �� �� ��� Logfile_Su ������ �����, �� ����� ��

��� Logfile_Base ������ ���� ����. Logfile_Base ���� �� �

�� � ��� EVENT ���(��� ��)��� �����. ��� ISA ��

� � ���. ��� ��� �� ��� �� �� ��� 47 ���� ����� �

�����.

TEC_CLASS: Logfile_Base ISA EVENT DEFINES { source: default= "LOGFILE"; sub_source: default= "LOGFILE"; sub_origin: default= "N/A"; adapter_host: default= "N/A"; msg_catalog: default= "none"; msg_index: default= 0; repeat_count: default= 0; pid: STRING, default="N/A"; severity: default = WARNING; }; END TEC_CLASS: Logfile_Su ISA Logfile_Base

� 2 � ��� ��� � 43

DEFINES { from_user: STRING, dup_detect = yes; to_user: STRING, dup_detect = yes; on_tty: STRING, dup_detect = yes; severity: default = WARNING; }; END TEC_CLASS: Su_Success ISA Logfile_Su; END TEC_CLASS: Su_Failure ISA Logfile_Su; END

��� �� ��

��� ��� ��� ���. ��� ��� ���� ���� ��� ����

�� ���� �� �� ����. �� �� ��� ��� ��� ��� � �

����, ��� ������, �� �� ���� ��� ����� � � ��

�. �� ��� 8 ���� ���� ���� ���� ��� �� ��� �����

�. ��� ���� �� ���� �� �� �� ��� IBM Tivoli Enterprise

Console ��� ���� ������.

��� �� ��� ���� � ��� ���� �������� �����. �

�� ��� ��� ��� � �� ��� ����, ������ ��� �� ��

�� � ���.

�� ��, ��� ��� � ��� EVENT� ���� BAROC ��� � ��

� WARNING� ��� ��, � ���� �� ������ �� ���� �

���. �� ��, Su_Failure ��� ���� ��� ��� �� CRITICAL� �

�� � ���.

�� ��� ��� �� ����, �� ��, �� � �� ��� �� ��(facet)

�� �����.

attribute_name: type, facet1, ...;

�� ��

�� ��� � � � � �����.

�� ��� Person ��� ���� �� �� ��� name, address, employer �

hobbies� �����.

TEC_CLASS: Person ISA EVENT DEFINES { name: STRING, dup_detect=YES;

44 IBM Tivoli Enterprise Console: � �� ���

address: STRING, dup_detect=YES; employer: STRING; hobbies: STRING; };

�: ��� object�� ��� ���� ����. ��� ����.

�� ��� ��

��� ��� ��� ��� � � ���.

v � ��(�: INTEGER, REAL, STRING, INT32, ENUM). ENUM( )� �

��� � � �� � � �� �����. �� ��� 50 ���� � �

��� ������.

v LIST_OF ��� ��� � �� ��

��� �� ��� ��� ��� ��� � ���� ���. ��� ��� ��

�� �����. ���� �� ��� � ��� ����.

[complex_type] simple_type

��� ��� ����.

complex_type

���� �����. ���� �� ��, � �� SINGLE���. ���

��� ����.

LIST_OF

� �� �� ��. ��� ��� �� � ��� ��� ��

��. �� ����� ��� ��� � ��� ��� ��� �

����.

acl: LIST_OF STRING, default=[admin];

SINGLE

� �

simple_type

� ��� �����. � ��� �����. ��� ��� ����.

ENUM

INT32

32� �� �

INTEGER

29� �� �

� 2 � ��� ��� � 45

REAL

�� �

STRING

�� 255��� � �

�� ��(facet)

��(facet)� ��� �� �� ��� ���� � �����. ��� �� ��(facet)

�� �� � � ��� � ���.

default

��� �� � �� �����. � �� �� �� ���� �� ���

�� ���� ��� � �����. � ��(facet)� � ����. ��� �

�� ����.

default=value

default �� �� �� ��� ��� ���.

�� ����� � � WARNING� ��� ��� ������ ����

�. ��� ��� 50 ���� � ���� ��� �� �� ����

��.

severity: SEVERITY,

parse

��� ���� ��� �� ��� � �� ��� �����. ��� �

� �� ��� � ���� �� ���� ����. � �� YES�

��. ��� ��� ����.

parse=value

��� ��� ����.

no ���� ��� �� �� � ����.

yes ���� ��� �� �� � ���.

parse=no� ��� ��� �� ���� ��� ��� �� ��� �

� ��� ������, ���� �� ��� PARSING_FAILED ��� �

� �����.

�����, parse=no� ��� ��� ��� ��� �� �� ����� �

����. �� ����� date_reception ��� ��� ��� ���� �

���� �� ���� �� ����� ������ �����.

date_reception: INT32,

46 IBM Tivoli Enterprise Console: � �� ���

� INT32 ��� ��� ���� ��� ��� �� �����,

463 ���� �pointeroffset�� ������.

dup_detect

���� ���, � �� ���� ��� ��� �� ����

�.

�: dup_detect ��(facet) ��� ��� �����. � ���� ��

��� �� ���� � ���� � ��� �� ����� � �

��� ��� ���.

�� ���� dup_detect ��(facet)� yes�� ���� ��� �� �

�� �� �� �� �� �� ��� ��� ���� �� ���

�����. �� ��, �� ��� ��� ��� ������.

TEC_CLASS: Person ISA EVENT DEFINES { name: STRING, dup_detect=yes; city: STRING, dup_detect=yes; employer: STRING; hobbies: STRING; };

�� �� � �� ��� �� �� ���� �� ���� ��� �

����( ���� �� ��� ����� �� �).

<"Joe", "Lafayette", "ABC Widgets", "Computers"> <"Joe", "Lafayette", "XYZ Widgets", "Ham Radio">

� ���, dup_detect� no���.

��

��� ��� ��� ISA �� ��� ���� �� ��� ����� � ���

��� � ��� ���. ��� ������ ����� �� ��� ���� �

� ����. IBM Tivoli Enterprise Console� � �� �����.

������ ��� ��� �� ������ �� ����. ������ ���

��� �� ����� �� ��� ������� ��� ����.

������ �������� ��� �� � � ��(facet)� ��� � �, �

�� ��� ��� �� �� ����.

������ � ��� � �� ��� �� ������ �����. ��

������ ��� ��� ������ �����.

������ ���� �� ������� �� ���� ���.

� 2 � ��� ��� � 47

��� �� ��� ��� ��� � ������ ���� � ��� ����

�. ��� �� ��� ���� �� ��� �� �� �� ����� ���. �

�� ��� ��� ����.

v fire_on_non_leaf ���� �� � � �(�� ��� 80 ���� �����

��)

v �� ��� �� ��� ��� ����� �

�: � ��� �� ���� �� �� ����� � �� �� ��� �

� ���.

event: _event of_class _class

event: _event of_class _

����� ���� ����, ��� � � ��� �� � ��� �� ��

���� �� ���� ����(fire_on_non_leaf ���� �� � ��� ��

�). �� ������ �� ���� ������ �� ������ �� ��

��� �� � ���.

�� ��� � ��� �� �����.

��� ��� ��� BAROC ��� ����� � ��� ��� BAROC �� �

��� ��� �����. BAROC ��� ��� �� BAROC ��� ��, �

�� �� ��� 26 ���� �� ��� ��� � ��� �� ���� ����

IBM Tivoli Enterprise Console �� � ��� ����� wrb ��� �����

�.

�� ��� � �� � ����, ��� ��� ��� EVENT���. � ��

� ��� ��� �� �� ��� ���� ���� �� ��� ���. �

��� ���� ��� ���� �� �� �� �����. �� �����

� ���� �� ��� ��� ��� �����.

48 IBM Tivoli Enterprise Console: � �� ���

TEC_CLASS: EVENT DEFINES { server_handle: INTEGER, parse = no; date_reception: INT32, parse = no; event_handle: INTEGER, parse = no; source: STRING; sub_source: STRING; origin: STRING; sub_origin: STRING; hostname: STRING; fqhostname: STRING; adapter_host: STRING; date: STRING; status: STATUS, default=OPEN; administrator: STRING, parse = no; acl: LIST_OF STRING, default = [admin], parse = no; credibility: INTEGER, default = 1 , parse = no; severity: SEVERITY, default = WARNING; msg: STRING; msg_catalog: STRING; msg_index: INTEGER; duration: INTEGER, parse = no; num_actions: INTEGER, parse = no; repeat_count: INTEGER; cause_date_reception: INT32, parse = no; cause_event_handle: INTEGER, parse = no; server_path: LIST_OF STRING; }; END

�� ��

�� ����� UNIX �� �� ��� ���� �� ��� ��� ���

� tecad_logfile.baroc ��� ��� �����. ��� � ��� �� �� ��

���.

EVENT Logfile_Base Logfile_Su

� 2 � ��� ��� � 49

Logfile_Su_Success Logfile_Su_Failure **********************************************************

TEC_CLASS: Logfile_Base ISA EVENT DEFINES { source: default= "LOGFILE"; sub_source: default= "LOGFILE"; sub_origin: default= "N/A"; adapter_host: default= "N/A"; msg_catalog: default= "none"; msg_index: default= 0; repeat_count: default= 0; pid: STRING, default="N/A"; severity: default = WARNING; }; END TEC_CLASS: Logfile_Su ISA Logfile_Base DEFINES { from_user: STRING, dup_detect = yes; to_user: STRING, dup_detect = yes; on_tty: STRING, dup_detect = yes; severity: default = WARNING; }; END TEC_CLASS: Su_Success ISA Logfile_Su; END TEC_CLASS: Su_Failure ISA Logfile_Su; END

�� ��

� �� ��� �� ��� �� � ��� �����. � ���� � �

��� �� �� � � ���� �� � ���. �� ����� ��� �

��� ��� ��� ��� SEVERITY ��� �����.

ENUMERATION SEVERITY 10 UNKNOWN 20 HARMLESS 30 WARNING 40 MINOR 50 CRITICAL 60 FATAL END

50 IBM Tivoli Enterprise Console: � �� ���

� BAROC ��� ���� ��� ���� �� ���� ���. ��

� � ����� �� ��� ���� �� �� ��� ���. ����

� � root.baroc � tec.baroc ��� �����.

��� ���� �� CLOSED �� �� � ��, CLOSED ����

���� ��� �� ���. � ��� �� CLOSED �� �� �� �

�, CLOSED ���� ���� ���, �� ���� �� ���� �� ����

��� �� ��� �� ���.

��� ��� �� �� �� �� � �� ����

��� ���� �� �� �� �� ���� ���� ��� �����. �� �

�� �� ���� ���� � ���. ����, ENUMERATION �� �

�� ��� � �� �� �� ���� ���� ���. ��� ��� �

� ��, ENUMERATION �� � �� ���. �� � �

�����. �� �� ��� ���� � �� ����� ��� ��� ��

� ���� � ���.

�� ��, �� 6000�� ���� SNMP �� ��� �� ������. � �

� � �� SNMP_Error_xxxx ��� ��� �� ��� �� ��� ����

���� ���, ��� xxxx� �� �����. � �� � ��

ENUMERATION �� ��� ���� ����(�: 6000�� � � ���� �

� ID� �� SNMP_ERROR_ENUM). �� ��, SNMP_ERROR_ENUM ���

error_type ��� �� SNMP_Error ��� ��� ��� ������.

root.baroc � tec.baroc �� ��

root.baroc � tec.baroc BAROC ��� ���� ���� ��� � ����

�� �����. root.baroc ��� �� ���� tec.baroc� �� �����. � �

�� ��� ��� �� ���� �� � ��� ��� ��� ���.

�: � ��� �� ��� ���� ����. ��� � ���� ���� �

� BAROC ��� � ��� �� ���� ���.

��� BAROC �� ���

�� ��� � ��� ��� �� �� ���� � ���� �� ���

BAROC ��� ����� �� �� �����. � ��� �� �� �� wrb

�� �� � ��� �� � ���. wrb �� ��� �� �� �����.

� �� � ��� ���� � �� ��� 26 ���� �� ��� ��� � �

�� �� ���� ������.

� 2 � ��� ��� � 51

1. � ��� ����� �� ��� �� ��� ��� ���� ����� �

�����.

2. � ����� �� ��� ������.

wrb -delrbclass filename rule_base

3. � ���� � ��� ������. ��� ��, ��� ��� �� �� ��

� �� -before �� -after ��� �� � ���. � ��� ��� ���

�� �� ��� � �� �� ���.

wrb -imprbclass filename.baroc rule_base

4. � ���� �������. � ��� � ���� ��� �� � ��� ��

� �����.

wrb -comprules rule_base

��� ��� BAROC ��

�� ��� ��, � ���� BAROC ��� �� � � ���� UTF-8

�� ���. BAROC ��� � ��� ��� �� UTF-8 ���� ����

���. wiconv ��� ���� BAROC ��� UTF-8 ���� �� �

���. wiconv ��� �� �� ��� Tivoli Management Framework ����

������.

v � �� STRING ��� ��� ���� ��, UTF-8 �� ������ �

� ���.

v ��� ������ ���� ����.

UTF-8 �� �� ���, ��� ��� ��, �� ��, �� � ��

�� �� � ����. UTF-8 � � �� ��� �� �� ��� 37 ��

�� ��� ��� � ���� ������.

52 IBM Tivoli Enterprise Console: � �� ���

� 3 � � �� ��

� ��� � �� ��� �������. �� � ��� �� ����� �� �

��� ��, ��� �� ���� �� �� �� �� ��� ��, �� ��� �

� ���� ��� ��� �� �� ���.

��� ��� ����, � ���� � �� ��� ��� ���� ������.

� ���� ���� �� � �� � � ��� ��� ��� ���.

�� � ��� �� �����. � ��� ��� ���� �� �, ��� ��

��� ���� �� ���� �� ����. ���� �� ���� �� �

���, � ��� ��� �� ��� �����.

��� ��� � ��� ��� � ����� � ������ ����� ��

�� � ���. �� ��, ��� � ��� �� �� ���� �� ���

� ��� ��� ��� �� � � � ����� � �� ��� ��

��� ������ ���� � ���.

��� ��� �� ��

�� ��� TEC_Notice ��� “� ��� �� �: � ��”� ��� ���

� 5%� ���� ����. ���� ��� ���� ����.

�: ��� ��� ��� ��� �� ��� � � �� ��� ��� � �

���. ��� IBM Tivoli Enterprise Console ��� ��� � ��� ���

��� ���� ���� ���� �����.

��� TEC_Notice ���� ���� �� ��� ��� ��� ��� ��

�� ��� ��� ��� ��� ��� ����. ��� ����� ��� ��

�� ���, IBM Tivoli Enterprise Console Reference Manual�� wsetesvrcfg �

�� �� ��� ������. Tivoli ������ ��� �� ��� �� �

� ���� ��� ����� �� �� ���.

��� ��

���� ���� �� � ��� ���� �� � ����� �� �� �

� ���. ���� �� �� ��� �� �� �� � �� �����. �

� � ���� � ��� ���� � �� ��� �����, � ��� � ��

� ��� � �� �� �� � � �� �� �� � �����. � �� �� �

�� ��� ���� �� � � �� �� �� ������. �� ��,

commit_action, commit_rule � commit_set �� �� ���� �����.

© Copyright IBM Corp. 2003 53

���� �� ���� ���� ��� � ��� �����, ���� ��

� � �� �� ��� � ��� ������� �����.

� ��� ���� �� ��� �����.

1. ���� � ���: �� ��, ���, �� ��, wpostemsg �� postemsg

������ ��� ���

2. ����� �� ���: �� ��, generate_event �� �� ��� ���

� ��� ����� �� ���� �� �� ��, � ���� ��� �

��� ���� �����. ����� �� ���� ���(FIFO) �

�� �����. ����� �� ��� � �� ����� ��� �� ��

��� ����� ���.

3. �� �� ��: �� ��, change_event_administrator, change_event_severity

�� change_event_status �� �� ��� ���

� ��� �� �� ��� �� �� �� � ���� � �� �����

�� ���� ��� �� ���� FIFO ��� �����.

4. ��� ��: �� ��, redo_analysis �� �� ��� ���

� ��� ��� ��� �� �� ��, � ���� � �� ����� �

� ���� ���� �� �� �� ��� ��� �� ��� ��� FIFO �

�� �����. ��� ��� ��� ��� ���� �� �� � � ��

� ����� � ��� �� �����.

5. �� �� ��: �� ��, ��� ��� �� ��� � ��� �� ���

�� �� ���

� ��� �� �� ��� �� �� ��, � ���� � �� �����

�� ���� ���� �� �� �� ��� �� ��� ��� ��� ��

�� �� ��� FIFO ��� �����. �� ��� ��� �, �� �

����. �� ��� �� �� �� �� �� ���� �����.

54 IBM Tivoli Enterprise Console: � �� ���

��� � ��

� ��� set_timer �� � ���� ��� ��� �� ���� ����

�� �� �� ����. ��� ���, ���� �� �� �� ��

����. �� ��, �� Su_Success ���� ��� � � �� �� �� ���

�� � ��, �� Su_Success ���� ��� � ��� ����� ���� �

� �� �� � ���.

�� �� ��

����� �� ���, �� �� �� � ��� ��� ��� ���� ��

�� �� ���� ��� �����. ��� ��� ����� �� ��� ���

�� ���� �� �����. �, � ���� � ���� �� �� �����

���� ��� � ��� �� ���� ����.

�� �

�� �� � �� �� ����� �� �����.

v commit_action, commit_rule � commit_set �� ���� ���� � ���

�� ���� ��� ��� ���� ������. �� �� ����� ��

� � ��� ����� ���� ���.

� 3 � � �� � 55

v ��� ��� �� �, � ���, ��� �� �� ��� �� �� ��� �

��� ��� ���� ����. �� ��� ��� ���� ������.

v ��� ��� where �� �� ��� ���� �� �� �� �� ���� �

�� � ���� �� �� ��� �� � �� ����.

56 IBM Tivoli Enterprise Console: � �� ���

� 4 � � �� ��

� �� � ��� ���� ��� �� ��� �� � ��� �����. � ��

� ��� ���� � ��� �� �� ��� ��� ��� ���� ��

�.

�� �� ��

�� �� � �� ����� �� �� �� ��� �����.

�� ��

BAROC �� ��� ��� ���� � ��� �� ���� �� ��

��� ��� ��, �� �� ���� ���� ����, � � � .

��� �� �� �� ��(_), a - z(���) � 0 - 9��

�.

� ��� ��, �� �� ���� ��� �� �� � . � �

�� ��� �� �� ���� �� ���� ����� ���

�� � � ��� ���. ��� �� �� �� ��(_),

a - z(���) � 0 - 9���. � ���� �� ��� ���

�� �� � ����.

� �� � ��� �� �� ��� filename.rls ���� ���. � �

��� � ��� � ��� � ��, .rls �� �� ��� �

���� ���� ����. ��, � �� ��� � �� ��

�� ����.

� � � � ��� filename.rpk ���� ���.

� �� � ��� �� �� ��� �� � ���. ���, ��

� ���� � ��� ������ �� ���. � �� ��

��� �� ��� ��� �� ���. � ��� � � �

� � ��, ����� ��(_)� ��� �� ��

�� ��� �����. � ��� ���� ����, � ��

� � �� � �� � � ��� ������.

� �� � �� ��� ��� ��� �� � ��� ������ �

� � ���. � �� ��� ��� ��� ��� �� ��

�. � �� ��� � � �� � ��, �����

��(_)� ��� �� �� �� ��� �����. � �

� ��� ���� ����, � �� � � �� � �

� � � ��� ������.

�� 58 ���� ����� ������.

© Copyright IBM Corp. 2003 57

��

�� ��� ��(_) �� ���� �� � ��, � ���� ��� ���

��. �� � ���� �� ���� ��� ��� ���� ��� ���� �

���.

��� ��� ���� ����. ��� ������ ��� ��� ����

�� ��� ��� ��� �������.

�: �� �� �, �� ��� ��� ��� ������. ��� ��� ��

���� �� ��� ���� �� ��� �� ��� �� ��� � �

���. �� ��, _no_value ��� ������ �� ��� ����� �

� �� ��� �� ����_origin � _no_value ��� ��� ��� ��

�������.

where [origin:_origin equals _no_value]

��� ���� �����. ��� ��� ����, ���� ��� ��� ���

��. ��� ���� ��� ��� ��� � ���� � �� ���, ���

��� ���� �� ��� ���� ��� ��� ���� �� �� �� ���

��� ����. Prolog �(�: read � write)� � ��� ����� ��� �

�� � ���. �� ��� 468 ���� �read� � 489 ���� �write�� �

�����.

��� ���� � � ��� ��� �� ���, �� � � �����

� �� ���. �� ��, Level_1� ��� ��� ��� 'Level_1'� �

� ����.

�� ��� ��� ���� ���, �� �� � �� �� �����.

�� �� ��� TEC_Start ����� ����� ����, TEC_Start ��� �

�� ��� ���� ������ ��� ���.

rule: unquoted_single_class1: ( event: _event of_class _class % The name of the event class is stored in variable % _class. where [ msg: equals ’unquoted event filter 1’ ], action: ( set_event_message(_event,’msg changed to %s’, [_class]) ) ).

58 IBM Tivoli Enterprise Console: � �� ���

rule: unquoted_single_class2: ( event: _event of_class TEC_Start % The name of the event class is stored in variable % TEC_Start. To filter on event class TEC_Start only, % specify ’TEC_Start’ (within quotes) where [ msg: equals ’unquoted class filter 2’ ], action: ( set_event_message(_event,’msg changed to %s’, [’TEC_Start’]) ) ).

�� ��

�� ��� � � �� � �� ��� ��� � � ��� ���� �� �

����. �� ��� ��� ��� ����.

v �� � ��� ��� � ��� ��� ����� �� ��� ��� �

���. � ��� ���� ��� ��� �� �� �� �� ���

�� ����� ������ � ��� � ���.

v � �� �� �� ��� ��� � ��� � � ��� ���� ���

����. ��� �� �� ��� �� �� �� ��� ���� �

�� �� ����.

�� �� ���� � ���� ��� �� �� �� ��� �� ��� where �

���� � �� �� � �� �� �� �����.

rule: maintenance_started: (event: _event of_class ’TEC_Maintenance’ where [origin: _origin])

��� ��

��� ��� � ��� ��� �� � � ���� �� � � ���, �

� ����� ��� � � ��� ���� �� �����. �� ����(�:

���)� ��� ���� � ���� �� ���� ��� ���� � ��

� ��� �� �� ���.

��� ��� ��� ���� ���� ���� � �� ����, �� � � ��

�����. �� �� �� �� ��, �� ����� ��� �� ���� ��

�� � ��� �� ���� �� ��� ���� � ��� � ���. �� �

� � � ���� ����. �� ����� ��� ���� ��� ��

��� ������. �� � � �� ���� � � � ���. �� ��

� ����, �� �� ��� ��� � ���.

� 4 � � �� �� 59

��� ��� ��� ��� ������ �� �� ���� ��� � ���. �

� ��, origin � sub_origin ��� ���� 2�� � �� � ���. ��

������ atomconcat � set_global_var �� ���� �� ������.

atomconcat([_origin, _sub_origin], _key), set_global_var(’My group key’, _key, ’My value’)

��� ��� ��� �� �� ��(�: ��, � , �� �)� � � ���.

��� �� ���� �����, �� ���� ���([ ])� �����. �� �

�� ���� �� ��� � ���, �� ������ �� ��� ����

�����.

set_global_var(’My group key’, _key, [’a’, ’b’, ’c’]), % Assign global variable values. get_global_var(’My group key’, _key, [_var1, _var2, _var3], [’’, ’’, ’’]) % Retrieve global variable values into regular values % The default initialization values (’’) are null.

��� �� �

��� �� ��� �� �� �� �� ���. �� ����, � �� �

�� [i] � [o] ���� �� �� �� ��, � � �� ��� ��

�� � ����� ����� �� �� � �� �� ������ �� �

����.

�� ��� ��� �� �� �� �� _into� �����. ��� ��� ���

� �� ��, �� _init ��� ���� _into� �� ��� �����.

get_global_var(_groupkey[i], _key[i], _into[o], _init[i])

�� ��� ��� ��� _to� �����. _groupkey � _key �� ��� �

��� ���.

set_global_var(_groupkey[i], _key[i], _to[i])

�� ��� ��� �� �� ��� ��� _to ��� ������.

reset_global_grp(_groupkey[i], _to[i])

�� ��� � � ��� �� �� ��� �� ��� ��� �� _key �

_into �� ��� ���� �����. _groupkey �� ��� ���� �

��. � �� ��� ���� ���� � ��� � ���. _key� ���

��� set_global_var �� ���� �� �� � � ������ �� �

�����.

get_global_grp(_groupkey[i], _key[o], _into[o])

��

� ���� � ��� ����� �� ��� � ���. �� ��,

'WARNING', 'TEC_Error' � 'on'� � � �����.

60 IBM Tivoli Enterprise Console: � �� ���

� ���� ������ ������. �� ��, 9, 5.4 � 0xFF1953� � �

�����.

��

��� �� � � � ���� �� ��� ���. /* � */ ��

��� �� � ���� ��� ���� ����� �� �����. �

��� ���� �� ��� �� �� �� � ���. �� � ��

� �� ��(%)���. � � �� � �� � �� ���� ����. ��

� ��� ���� �� �� ��� �(nest)�� � ����. %� /*

*/ �� �� �� � ��, � ��� ��� ��� ���� ���

��.

BAROC ���� � � � ��� �� ��(#)���.

� ��

� ���� �� � ��� �� ���� ��� ����� ����, �� � ��

� �� ��� �����. ��� � ��� �� ��� 11 ���� �� ����

���.

v � �

v �� �

v �� �

v � �

v �� �

� �� ��� ��

BNF(Backus Naur Form) ���� � �� �� �� ��� �� HTML

��� ��� ��� �� ��� ���.

$BINDIR/../generic_unix/TME/TEC/BOOKS/HTML/rulep.html

��� �� CD� �� ��� ���.

/BOOKS/HTML/rulep.htm

��� � ��� �� ��� �� � ��� �����.

� �� ��

�� ����� � �� �� ��� �����.

rule: rule_name: ( description: ’description_text’,

� 4 � � �� �� 61

directive: directives, event: event_filter where [ attribute_conditions ], action: action_name: ( action_body ) ).

��� ����

v ��� ��� 70 ���� ���� ���� ���� ���.

1. ��� � � ��� ��� ���� ��� Printer_Error_Cleared ���� �

�����.

rule: print_reset :( event: _event of_class ’Printer_Error_Cleared’ where [ status: equals ’OPEN’ , hostname: _hostname ] , reception_action: ( all_instances(event: _prt_ev of_class within [’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’, ’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Door_Open’ ] where [hostname: equals _hostname, status: outside [’CLOSED’] ], _event - 3600 - 3600 ), change_event_status( _prt_ev, ’CLOSED’ ), drop_received_event ) ).

2. ��� � � ��� ��� ��� ���� ��� 90� �����. ��

� ���� ���� ���� ���, �� �� �(64 ���� ���

�� �� ���� �� 1� ��� �� ��)� ����.

rule: print_assist : ( event: _event of_class within [’Printer_Paper_Out’,

62 IBM Tivoli Enterprise Console: � �� ���

’Printer_Toner_Low’, ’Printer_Offline’, ’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Door_Open’ ] where [ status: _status equals ’OPEN’ , hostname: _hostname, msg: _msg ] , reception_action: ( set_timer(_event, 90, ’’) ) ).

�� � �� ��

�� ����� �� �� �� ��� �����.

change_rule: rule_name: ( description: ’description_text’, directive: directives, event: event_filter, where [ attribute_conditions ], sender: sender_filter, attribute: attribute_change_filter, action: action_name: ( action_body ) ).

��� ����

v �� �� ����� �� � � ��� �� ��� �����.

v �� �� �� ��� ����� � ����.

v ��� ��� 70 ���� ���� ���� ���� ���.

v �� �� � �� �� ��� 74 ���� ��� � ���� ���� ��

�.

�� �� � ��� ��� ����� ���� tec_print� �� ���� ����

�. � ���� �� ���� ��� ���� �����(num_actions ��� 1�

��)� ��� � �����.

� 4 � � �� �� 63

change_rule: print_chg_assist : ( event: _event of_class within [’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’, ’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Error_Cleared’, ’Printer_Door_Open’ ] where [ hostname: _hostname, status: _status outside [’CLOSED’], num_actions: equals 1, msg: _msg ] , attribute: status set_to _new_status within [’CLOSED’], action: ( exec_program(_event, ’scripts/TEC_Send_Mail.sh’, ’"TEC - %s: %s" tec_print "The following condition for printer \ %s has been fixed:\n\t%s"’, [_new_status, _msg, _hostname, _msg], ’YES’) ) ).

��� � �� ��

�� ����� �� �� �� ��� �����.

timer_rule: rule_name: ( description: ’description_text’, directive: directives, event: event_filter, where [ attribute_conditions ], timer_duration: timer_duration_filter, timer_info: timer_info_filter, action: action_name: ( action_body ) ).

��� ����

v ���� �� ��� ��� ��� �� �� �� ����.

v ��� ��� 70 ���� ���� ���� ���� ���.

64 IBM Tivoli Enterprise Console: � �� ���

v �� � ��� 76 ���� ��� � ���� ���� ���.

v ��� 234 ���� ���� � set_timer �� �����. ��� ��

�� � � ��� 62 ���� 2� �����. ��� ���� �� � �

�� 2� �����.

v TEC_Tick ��� ���� �� ��� ��� ���. �, ���� �� �

�� ����. ���, ���� ���� ��� ��� ���� � �� �

���.

v ��� �� � � � timer_info ����� ���� �� ��� ���

�� � ���. ��� ��� timer_info� �� ��� ��� ��� �

� �� ����. timer_info� ���� � ��� ��� �� � �

� �� � � ��� � � ���.

1. �� �� � ��� ��� ��� ��� ��� ��� ��� ��� �

�� �� ��� ���� ���� ��, �� � ���� �� ��� �

��� �� �� ���� tec_print� ����. 61 ���� �� �� �� �

��� �� 2� ��� ��� �� � �� ����.

timer_rule: timer_print_assist : ( event: _event of_class within [’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’, ’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Door_Open’ ] where [ status: _status equals ’OPEN’ , hostname: _hostname, msg: _msg ] , action: ( exec_program(_event, ’scripts/TEC_Send_Mail.sh’, ’"T/EC - %s: %s" tec_print "The printer %s has the \ following condition:\n\t%s"’, [_status, _msg, _hostname, _msg], ’YES’) ) ).

2. �� �� � ��� �� 1 �� �� �� ��� ����� �� �

��� �� ���� ���� FATAL� ����. �� 2 ��� � �� �

��� �����.

� 4 � � �� �� 65

timer_rule: ’upgrade_level1’: ( event: _event of_class ’universal_host’ where [ status: outside [’CLOSED’,’ACK’] ] , timer_info: equals ’Level 1’, action: raise_sev: ( set_event_severity(_event, ’FATAL’), set_timer(_event, 90, ’Level 2’) ) ).

� � �� ��

�� ����� � �� �� ��� �����.

simple_rule: rule_name: description: ’description_text’ directive: directives event: event_filter where [ attribute_conditions ] when: event_conditions: event_actions

��� ����

v ����� ��� ���� ���� _event � _class ��� � ��� ��

� ����. �� ��� � ���� ����� �����.

v �� ��� �� �� � ���. �, � �� �� �� ��� ���

��� ����.

– n minutes_after_event_reception(n� ��)

– event_acknowledged

– event_closed

– event_received

– n �� frequency_exceeds m(m � n� ��)

– severity_downgraded

– severity_upgraded

v �� �� � ��� ��� �� � ���. �, � �� �� �� �

�� ��� �� �� ��� ����.

66 IBM Tivoli Enterprise Console: � �� ���

��� �� ��

change_event_severity ��� ��� �� � �� �����. ���� �� ��, ��, ��, ��, �� � ���

� � � ���.

��: change_event_severity(new_severity)

change_event_status �� ��� �� � �� �����. ��� OPEN, RESPONSE, ACK � CLOSED� �

� ���.

��: change_event_status(new_status)

drop_duplicate_event �� �� CLOSED� �� �� ��� �� � ���� ��� ��� �� � ���

(�� �� �). ��, �� ���� repeat_count ��� �� ���� �� ��� ��

�� �����.

��: drop_duplicate_event(time_window)

exec_program �� ��, ���� �� �� ���� �����. � � ��� $BINDIR/TME/TEC

���. ��, ���� �� ���� ��� ��� �� ���� �����. � ���

��� �� �� �� ��� 154 ���� �exec_program�� ������. exec_program

� �� �� �� �����.

�: � ��� exec_program ��� ��� ��, ��� ��� _arg_list �� �� �

� ����. _arg_list �� �� �� �� �� � � exec_progrma � �� ��

� ����.

��: exec_program(prog_name, _format_string, _arg_list, watch_status)

exec_task ��� ��� ������� ���� �����. � ���, ���� ��� ��� ��

���� �����. � ��� ����� ��� ������ �� ��� ���� ����

�. � ��� ��� �� �� �� ��� 160 ���� �exec_task�� ������.

exec_task � �� �� �����.

�: � ��� exec_task ��� ��� ��, ��� ��� _arg_list �� �� ��

����. _arg_list �� �� �� �� �� � � exec_task � �� ��� ���

�.

��: exec_task(task_name, format_string, _arg_list, watch_status)

forward_event ���� �� ��� ��� ����. � ���� TEC_RULES ������ �

tec_forward.conf ��� ServerLocation ��� ���� � ���. tec_forward.conf �

�� �� �� ��� 177 ���� �forward_event�� �� ��� ������.

��: forward_event()

set_event_message ����� msg ��� �� ���� �����. �� �� ���� �� ��� ��� �

� � ���. � ��� ��� �� �� �� ���

227 ���� �set_event_message�� ������. set_event_message � �� �� ��

�����.

�: � ��� set_event_message ��� ��� ��, ��� ��� _value �� ��

�� ����. _value �� �� �� �� �� � � set_event_message � ��

��� ����.

��: set_event_message(_format, [ _value])

v � �� ��, �� �� �� ��� ��� ��� � ��� ��� �

���� ��� ���� ����.

v ��� ��� 70 ���� ���� ���� ���� ���.

� 4 � � �� �� 67

�� � � ��� 5 �� su ��(switch user)� �� �� � � ����

Su_Failure ���� ��� FATAL� �����.

simple_rule: escalate_su_failure: description: ’Escalate more than 3 su root failures in 5 minutes.’ event: Su_Failure where [ to_user: equals ’root’ ] when: frequency_exceeds 3 within 5 minutes: change_event_severity(’FATAL’).

�� � �� ��

�� ����� �� �� �� ��� �����.

correlation_rule: rule_name: description: ’description_text’ directive: directives event_relation: event_class1 operator event_class2 within: integer minutes when: [ event_class1.attribute1 equals event_class2.attribute2 ]

��� ����

v event_relation �� ��� ��� ����.

cancelled by

cancelled by ��� ���� ��� ���� ��� ��� ��� �

��� �� �����.

cancels

cancels ��� ��� ��� ���� ��� ���� ��� ����

�� �����.

caused by

caused by ��� ��� � ���(� ���)� ���� � �

��(� ���)� �����. � ������� date_reception �

event_handle� � ���� cause_date_reception � cause_event_handle

��� �����. � ���� �� �� �� � ���� �� ��

� �����. � ���� ��� �� �� ����� �� �

���� �� ��� ����.

causes ���� � ���(� ���)� ��� � ���(� ���)� �

����. � ������� date_reception � event_handle� � �

68 IBM Tivoli Enterprise Console: � �� ���

��� cause_date_reception � cause_event_handle ��� �����. �

�� � ���� ��� �� �� ����� �� �� ���

� �� ��� ����.

v when ��� ��� event_class_name. attribute� �����. ���, attribute

� event_class_name ��� ���� �� ��� �����.

v equals ��� �� �� ��� �� �����.

v �� �� ��, ��� ��� � �� ��� �� �� �� ��� ��

���� ���� ����.

��� �� �� � ��� � ���� � �� ���� �� �� ����

���, �� �� ���� �� �� ���� ���� � �� ��� ��� �

� � ���.

��

��� �� ���� �� ���� �� ��� �� �� �����. ��

�� ���� �� �� ����. ���� ����� ��� ���� ����

�� ��� ��� ���. ��� � �� ��� �����.

correlation_rule: fan_fail_causes_temp_warn: description: ’This rule links a fan failure event and a temperature warning event on the same computer.’ event_relation: Fan_Failure_Notification causes Temperature_Warning within: 10 minutes when: [ Fan_Failure_Notification.hostname equals Temperature_Warning.hostname ] correlation_rule: temp_warning_causes_temp_shutdown: description: ’This rule links a temperature warning event and a temperature shutdown event on the same computer.’ event_relation: Temperature_Warning causes Temperature_Shutdown within: 15 minutes when: [ Temperature_Warning.hostname equals Temperature_Shutdown.hostname ]

� 4 � � �� �� 69

v ��� ��

v �� � ��

v �� � ��

��� ��

��� ��� ��� ��� ��� �����, � ��� ���� ��

�� ������. ���� ��� �� �� ���, �� �����. ��� �

�� �� ��� ���� ��� ���� �� ����� � ����� ��� �

���. ���� ���� ���� ���, �� �� �� �����.

�� ���� �� ���� �� ��� ���� ��� ��� ��� ��

� ���. � ��� ���� ��� ��� �� �� �� �� ��

� �� ����� ������ � ��� � ���. � ��� ��� �

���� ��� ��� ��� ����� �� �����.

�� � ��� �� � ���� ��� ��� ��� ���� ��� ���

���� �� �� ��� �� � ���. � ��� � � ��� ����

��� ����. ��� �� �� ��� �� �� �� ��� ���� �

�� �� ����.

��� ��� � ���� �� � ����� ��� ����

�. � ��� �� ��� �� �� ��� �� � �, ���� �� ��

��� _event���. ��� � ��� � � �� �� ���� �� � �

�� ��� ��� �����. � � �� ��� � ��� �� � ����.

of_class ��� _event ��� ���� � �� �� �� ��� �� � ��

� ��� ��� �����. � �� �� ��� �� ��� �� � ���

�. of_class ��� �� ��� ��� ��� �� ��� �� �����.

��� ��� ��� ���� ���� �� ��� ���� �����

�� �� ������. �� ��� ��� ��� ���� �� ���� ���

��� �����.

_ _ ��(� �� �)� �� ����� ���, ���� ��

� ���� ���� �������. � ��� �� ���� �� �

�� ��� ���� ��� ��� �� ��� ����. �� �� �

�� ��� �� ��� ���� �� ���� �� ���� ��� ��

�� ��� �� ��� �������.

event: _event of_class _

_class _class ��� ���� ��� ���� ���� ������

�. �� �� ��� ��� �� ��� ���� �� ���� �� ��

�� _class ��� ��� ���� ���� �������.

70 IBM Tivoli Enterprise Console: � �� ���

event: _event of_class _class

class_name

��� ��� ���� ��� �����. �� ��� ����

Printer_Error_Cleared ��� ����� �����.

event: _event of_class ’Printer_Error_Cleared’

�: class_name� ���� ������� ��� ��� �� �

� class_name� ����� �� ���� �� �����.

fire_on_non_leaf ���� ���� �� �� ��, class_name� �

����(�� ����� )�� ��� ��� �� �� ����

�.

_class within [class_name1,...]

� ��� ��� ��� � �� ��� ��� ���� �� �����

�. ���� ��� �����, ��� ��� �� �� ���

��.

��� �� ��� ��� ��� ������� ��� ��� �� ��

������ ����� �� ���� �� �����.

fire_on_non_leaf ���� �� ���, ��� ���� ������ �

� ��� ��� �� � �� �����. ��� ��� ��� ��� �

�� ��� ���� ��� �� � ���. ��� ��, ���� ��

�� ��� ��� ��� ��� ��� ���. ��� ���

���� �� �� � � � ���� � �� ��� ��� ���

� �� ��� �����.

event: _event of_class within [’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’, ’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Door_Open’ ]

�: � ��� _class ��� ���� ��� �� ���� �� ���

��� ��� �� � ���. �� ��, ��� ��� �� ��

� �� �� � ���. ���� �� �� � ��,

_class ��� ��� ��� ���� �������.

event: _event of_class _class within [’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’,

� 4 � � �� �� 71

’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Door_Open’ ]

�� ����� ��� LIST_OF �� ���� ��� ��� �����.

;Class file

TEC_CLASS: Logfile_Base ISA EVENT DEFINES { alist: LIST_OF STRING, default=[’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’]; }; END

;Rules file print_reset: ( event: _event of_class ’Printer_Error_Cleared’ where [ status: equals ’OPEN’, alist: _aclasslist ], reception_action: ( first_instance( event: _prt_ev of_class within _aclasslist where [ status: outside [’CLOSED’] ], _event - 3600 - 3600 ), change_event_status(_prt_ev, ’CLOSED’) ) ).

_class outside [class_name1, ...]

� ��� ��� ��� ���� �� ��� ��� ���� �� ���

���. ���� ���� ��� ��� ��� ��� ��� �� �

��. ���� ��� �����, ��� ��� �� �� ��

�� ����. ��� �� ��� ��� ��� ������� ��� �

�� �� �� ������ ����� �� ���� �� ���� �

���. fire_on_non_leaf ���� ���� �� ���, ��� ��� �

� �� ��� ���� ������ �� �� ���� ����. ��

��� ���� ��� � � ���� ���� ����.

event: _event of_class outside [’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’, ’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Door_Open’ ]

�: � ��� _class ��� �� �� _class�� ��� �� �� ��

� ���.

72 IBM Tivoli Enterprise Console: � �� ���

�� ��: �� ���� ��� ��� �� � ��� � �� �� �

���. �� ��� ��� ��� where ����. �� ��� ����

�� �� �� �� ��� �� ���� � ��� ���� ����. �� �

� �� ��� �� ��� ��� ���� � ���. ��� ��� _class

��� ����, ��� �� �� ��� ���� ����.

���� �� ��� ����� �� ��� ��� ��� �� ��

�� ����. ���� ��� ��� ��� �� � �� �� ��� ���

�� �����.

�� ��� �� �� ��� �� � ���. where �� where ���� ��

���� ���� �� ���� ����. where �� �� �� ��� ���

��� �����. �� ��� ���� ���� � where �� ��� ���.

v �� �� ���. �� ��� �� �� ����� � ����.

comparison_operator

�� �� �� �� ���. �� ��� ��� ����.

– equals

– greater_than

– greater_or_equals

– smaller_than

– smaller_or_equals

– within

– outside

within ��� �� �� ��� � ��� ��� ��� ���

�� ��, outside ��� �� �� ��� �� �� ��� ��

� ������.

�� ��� �� ��� �� OPEN� ��� ������. OPEN�

��� ���� ��� ������ ���, ������ �� ��

� � ������ ��� ����.

where [status: equals ’OPEN’],

�� ��� �� ��� �� OPEN �� ACK� ��� �����

_status ��� ��� �������.

where [status: _status within [’OPEN’,’ACK’]],

�� ��� �� ��� �� CLOSED ��� �� ��� ����

��.

where [status: outside [’CLOSED’]]

�: ��� ��� ��� �� ��� ��� ����� �����.

� 4 � � �� �� 73

v ��� �� ��� � ����. �� ��� �� _status ��� �� ��

� ��� �������. �� �� � ���� ����.

where [status: _status],

v �� ��� ��. �� ��� �� ���� ��� critical ��� ���

� �� ������. ���� ���� ���, _hostname ��� ���� �

� ���� ���� �������.

where [ status: _status outside [’CLOSED’], severity: equals ’CRITICAL’, hostname: _hostname ],

�� � ��

�� �� �� ��� �� ��� �� � ���.

v �� ��

v �� �� ��

��� ��: �� �� �� ��� �� ��� ��� �� ����� ���

�. �� ��� ��� �� ��� � � ���.

agent ��� ���

engine

� ��

operator(��)

��� � ���� ��

�� ��� �� �� ��� ��� ����.

equals ��� �� �� ��� ������. �� ��� ��� � ��

� ��� ������.

sender: equals engine,

�� ��� ��� ��� ��� ������. � ��� �� ��

� �� � � � �� _sender� ������� ���(_x ���

�� ����� �� � ��).

sender: _sender equals operator(_x),

outside

��� ��� � ��� �� ��� ��� ������. �� ���

��� ��� ��� ������.

sender: outside [agent,engine],

74 IBM Tivoli Enterprise Console: � �� ���

within ��� ��� � ��� ��� ��� ������. �� ��� ��

� �� ��� ���� ��� ����� ���� ��, _sender �

�� �� ��� �������.

sender: _sender within [operator(’root@orange’), operator(’root@red’), operator(’root@blue’) ],

��, �� ������ �� ��� ��� �� ������ � �� ��

� �� � ���.

sender: _sender,

�� �� ��: �� �� �� �� ��� ���� �� �� �� ��� ���

�� ����� ����.

�� �� ��� �� ��� ��� � set_to���. set_to ��� ���

� ���� ��� ��� �����. set_to ��� ���� � ���

� ��� ��� ��� �, �� ��� ��� �� ���. set_to ��� �

��� � ���� � � �� �� ��� � ���. �� ��� ��, �

�� ��� ��� �� ���� � ���� ���.

�� ��� �� �� ���� � ����.

v equals

v greater_than

v greater_or_equals

v smaller_than

v smaller_or_equals

v within

v outside

within ��� �� �� ��� � ��� ��� ��� ����� ��,

outside ��� �� �� ��� �� �� ��� ��� ������.

�: ��� ��� ��� �� ��� ��� ����� �����.

�� ����� ��� �� �� ��� �����.

v �� �� ��� �� ��� CLOSED� ������ �����.

attribute: status set_to ’CLOSED’,

�: �� �� ��� �� �� ���� IBM Tivoli Enterprise Console ���

�� ����� �������. �� �� ���� �����. � ���

� ��� ���, �� ����� �� �� ���.

� 4 � � �� �� 75

v �� �� ��� �� ��� �� �� ��� ������ �����. _newstatus

��� ��� ���� ��� �������.

attribute: status set_to _newstatus,

v �� �� ��� �� ��� ACK �� CLOSED� ������ �����.

_newstatus ��� ��� ���� � ��� �������.

attribute: status set_to _newstatus within [’ACK’,’CLOSED’],

v �� �� ��� repeat_count ��� 5�� � ��� ��� ��� �����.

_newrepeatcount ��� ��� ��� ��� �������.

attribute: repeat_count set_to _newrepeatcount greater_than 5,

v �� �� ��� �� ��� fred, wilma �� betty� ������ ����

�. _newadministrator ��� ��� ���� ��� �������.

attribute: administrator set_to _newadministrator within [’fred’,’wilma’,’betty’],

��� � ��

�� �� �� �� �� ��� �� � ���.

v timer_info ��

v timer_duration ��

timer_info ��: �� �� timer_info ��� set_timer �� timer_info

�� ��� �� ��� �� ����� ����. set_timer �� ���� �

��� ��� ���� � �����. set_timer �� timer_info �� �� �

(�: ��, � �� ���� ��(�: ��))� � � ���.

�� ��� timer_info ���� � ����.

v equals

v greater_than

v greater_or_equals

v smaller_than

v smaller_or_equals

v within

v outside

within ��� �� �� ��� � ��� ��� ��� ����� ��,

outside ��� �� �� ��� �� �� ��� ��� ������.

�: ��� ��� ��� �� ��� ��� ����� �����.

�� ����� ��� timer_info ��� �����.

v �� timer_info ��� �� ��� �� 1� ������ �����.

76 IBM Tivoli Enterprise Console: � �� ���

timer_info: equals ’Level 1’,

v �� timer_info ��� �� ��� �� 1 �� �� 2� ������ ���

��. _timerinfo ��� �� ��� ��� �������.

timer_info: _timerinfo within [’Level 1’,’Level 2’],

v �� timer_info ��� �� _timerinfo ��� �� ��� �������.

timer_info: _timerinfo,

timer_duration ��: �� �� timer_duration ��� set_timer ��

timer_duration �� �� ��� �� �� ����� ����. set_timer ��

���� ���� ��� ���� � �����. set_timer �� timer_duration

�� ��� �� ��� �� �� ���� �� ����.

�� ��� timer_duration ���� � ����.

v equals

v greater_than

v greater_or_equals

v smaller_than

v smaller_or_equals

v within

v outside

within ��� �� �� ��� � ��� ��� ��� ����� ��,

outside ��� �� �� ��� �� �� ��� ��� ������.

�: ��� ��� ��� �� ��� ��� ����� �����.

�� ����� ��� timer_duration ��� �����.

v �� timer_duration ��� �� �� ��� 60 � ����� �����

� �����.

timer_duration: equals 60,

v �� timer_duration ��� �� �� ��� 60 �� 90 � �����

������ �����. _timerduration ��� �� �� ��� ��� ��

�����.

timer_duration: _timerduration within [’60’,’90’],

v �� timer_duration ��� �� _timerduration ��� �� �� ����

�������.

timer_duration: _timerduration,

� 4 � � �� �� 77

��

�: � �� ��� ��� �, �� � �� �� �����. � �� 66 �

��� �� �� �� ���� ��� �� � �� � � ��� ����

�. �� �� �� ��� �� 68 ���� ��� �� �� ���� ��� �

� ��� ��� �����.

���� �� � ��� ��� ��� ����, �� ���� � ��

� �� ��� �����. ��� �� ��� �� �� �� ��� ���

� ���. ��� � ��� �� ��� � �� � ���. ��

����� �� �� � ��� ��� �����.

��� ��� �� ��� ����, ��� ����� �����.

v action

v reception_action

v redo_action

��� � �� �� � ��� � ��, � � ��� ��� ���. ��

��� �� ��� ��� ��� ���. ��� ��� ��� ���� ��

�, � ����� ��� ��(�: action_1, action_2 �)� �����.

��� ���� ���� �(�: commit_action �)� ��� �� �, � �

�� ���� ��� �� ��� ��� ��� ��� �����. �� ���

� �� �� ��� ��� ���� �� ����. (���, �� �� � ��

��� Prolog �� �� �� ����.) Prolog �� �� �� ��� �� �

� ��� �� ����� ���, �� � �� ��� ��� �� ��� ���

�� �� �����.

�� ��

��� ��� �� ���� � �� ��� � �����.

action �� ��� ��� �����. � ��� �� ���� �� �����.

reception_action

�� ��� ���� �� ���� �� ��� � �����. � ���

78 IBM Tivoli Enterprise Console: � �� ���

� � ���� ����� ��� ��� � �����.

reception_action� � ��� ����.

�: �� ���� generate_event �� ���� ��� �� ���� �

� ��� ���� ��� reception_actions� ��� �� ���� �

� �����.

redo_action

��� ��� ��� ��� ���� ����� �� �����. ���

��� ���� ����. redo_analysis �� ��� ��� ���.

redo_action� � � ��� ����.

�� ����� �� �� ��� ���� �����.

v oserv_script reception_action� ���� universal_oserv�� ���� WARNING

�� ���� ���� ��� �����. reception_action� ��� ��� �

��� ���� ����.

v link_host �� ��� ��� ��� �� �� �� �� ���� �� ��

���. ���� �� ������, ��� ������ �� ��� ���� �

�� ���.

� ��� �� �� �� redo_action��� ������, ��� �� �� �

����. �� ��� ���� ��� ��� ���� ��� ��� ��� �

��� ��� ����� . ��� ��� �� �� ��� 215 ����

�redo_analysis�� ������.

rule: link_oserv_to_host: ( description: ’Link the universal_oserv to universal_host if they are related’, event: _event of_class ’universal_oserv’ where [probe_arg: _probe_arg, severity: equals ’WARNING’], reception_action: ’oserv_script’: ( exec_program(_event, ’oserv_beep.sh’,’%s’,[_probe_arg], ’YES’) ), action: ’link_host’: ( first_instance( event: _host_ev of_class ’universal_host’ where [severity: within [’CRITICAL’,’FATAL’], probe_arg: equals _probe_arg, status: outside [’CLOSED’] ]), set_event_status(_event,’ACK’),

� 4 � � �� �� 79

link_effect_to_cause(_event, _host_ev) ) ).

���

���� �� � � ���. � �� �� � �� ���� directive: ���

���� �����. ��� �� � ��� ���� �����, ���� ���

�����(�: directive: fire_on_non_leaf, profile). ���� ��� �� ���

��.

fire_on_non_leaf

�� �� �, ����� ���� �� �� �� �� ��� ��

�. � ���, �� �� �� ��� ���� ��� �����. ��

�� ��� � ��� �� ��� �� ���.

�� ����� ��� ��� �����. � �� ��� � ��� ��

� EVENT� ��� ��� ���� ��� �� �� ���� ����

���. �� �� ���� � ��� ������ �����.

rule: test_rls: ( directive: fire_on_non_leaf, event: _evt of_class within [ ’EVENT’ ] where [ ], reception_action: action0: ( drop_received_event ) ).

profile

� �� ����� �� ��� ���. � ���� ����� � �

� �� ��� ���� �� ��� �� � �� ����. profile �

��� � ��� �� �� �� � �� �� � ���. �� wrb

-comprules -profile ��� ���� �� � ���� ����� ��

���. ����� � ��� �� � ����. �� ��� 264 ���

� �� ������� ������.

trace � ��� ��� �� ��� ���. trace ���� � ��� �� ��

�� � �� �� � ���. �� wrb -comprules -trace �� �� �

�� �� �� ���� �� � ���� �� �� ���. ��� �

��� �� � ����. �� ��� 259 ���� �� ���� ���

���.

80 IBM Tivoli Enterprise Console: � �� ���

� �� ��

�� ��� � �� �����. �� ����� �� ����� �����

� �� ����. � ��� �� ���� Prolog ��� ��� �� �,

��� �� ����� �� �� ����� �� ���. �� ��� ��

��� �� ���� ��� �� ����� �� ��� � �� ���.

57 ���� � 4 � �� �� ���� Prolog� �� ��� �� ��� ��

���� �� ���.

� ���� IBM�� ��� �� �� �����. �� �� �� �� ��

���� ��� ����� ���. �� �� � �� ��� �� �� �

��� �� ��� ���.

� �� �� � ��

� �� �� ������. ��� ��� �� ��� �� �� � �� ��

�� ���� �� ���. �� 88 ���� �� �� �� �� � �

�� �� �����.

��� ��

� �� ��� �� ���� ���� ���� ��� ��� �� �� �

� ���� �� � �� �, ���, � � ��� ���� ��� �

�� ���� ����. �� ��� ��� ���� ��� ��� �� ��

� ��� ���� �����.

239 ���� � 5 � ��� ���� � �� ���� �� �� ��� ���

��.

�� ��� � ��� �� � �� ���.

� ��

all_clear_targets ��� ��� ���� ��� ��� �� ���� ��

���.

any_clear_target ��� ��� ���� ��� ��� �� � ����

�����.

any_clearing_event �� ���� ��� ��� �� ���� �����.

attr_condition ��� ���� � ���� �� �� �� ��� ��

���.

attr_exception ��� ���� �� ���� �� ��� ��� ��

��� �����.

attr_sequence ��� ���� ���� ��� �� ���� ��� �

� �����.

clears ��� ���� �� ��� ���� �� ��� ���

� �����.

� 4 � � �� �� 81

� ��

create_clearing_event ��� ���� �����.

create_event_sequence ��� �� ���� ��� �����.

first_causal_event � ���� ��� � � ���� �� ��� �

�� ����.

first_effect_event � ���� ��� ��� ����� �� �� � �

��� �� ��� ��� ����.

first_related_event �� ���� ��� ����� �� �� ���� ��

��� ��� ����.

is_clearing_event ���� create_clearing_event �� create_event_sequence

�� � ��� ����� ������ ������.

link_effect_to_cause � ���� � ���� �����.

unlink_from_cause � ����� � ����� ��� �����.

��� �� ��

� �� ����� ����� ��� ���� �� � �� ���

� ��� ���� �� ��� ��� ���� ����. �� ���� �� ��

� �� �� ���� �� ���� ���� �� ���� � �����. �

�� �� � �� ���� � � ���� �� ��� ��� ����.

v ��� ��� ���� � ����� � ���� �����.

v ��� ��� ���� �����.

v ���� ��� ��� ���� ��� ���.

v � ���� ���� �����.

v ��� �� � ��� �� ���� ����.

v ��� ��� ��� �����.

���� �� ��, ��� �� ��� �� ��� �� � ���.

v ��� ���

v �� ��

v �� ����� �� ��� ��� �� �� ��� �� ��

v ��� ��� � �� �� ���� �� ��� �� �� ��� �

�� ��� ��� �� ���

v �� � �� �� ���

v �� �� ��� �� ��� �

v ����� ���� ���� ��� ��

82 IBM Tivoli Enterprise Console: � �� ���

�� ��� � ��� �� � �� ���.

� ��

all_duplicates ��� �� �� � �� � ��� ��� ���

� ���� �� � � �����.

all_instances ��� ��� ��� ��� ���� �� � � ��

���.

create_cache_search_criteria ��� �� ��� �� ��� �� �����.

first_duplicate ��� �� �� � �� � ��� ��� ��

� ���� �� � � �����.

first_instance ��� ��� ��� �� ���� �� � � �

����.

print_cache ��� ��� ��� �����.

search_cache create_cache_search_criteria �� ��� ��� ��

�� ��� ��� ��� �����.

��� ����:

v ��� �� � ��� ��� ��� ��� ���� �� �� �� ��

���� ���, �� ��� �� ���� � ��� �����.

v �� � �� ���� �� �� �� � �� �� �� � ��� �

��. �� �� � �� ���� ���� � �����

���� ���� ��� ���� �� �� �� ���� �� ���

�� � ��� ���. ���� ���, �� �� �� ��

�� �� ������ �� 0�� �����. �� � �� �� ���� �

��, �� ��� ����.

v ��� � �� ��� redo_analysis, �� � �� �� � �� ��

�, ���� ��� ���� � � ��� ���� ��� � ���.

� ���: � ���� �� ��� �� �� ���� ��� �����

�.

v dup_detect facet� YES� ��� �� ��� �� �� �

v dup_detect facet� YES� ��� ��� ���, ���� �� ���� ��

��.

�: ��� �� ����� � ���� ���� � ���� �� � ���.

�� ��� 73 ���� ��� ���� ������.

����� � ���� ��� ������� ���� ��, �� ���� �

��� �� ���� ��� �� �� � �����.

� ���� first_duplicate � all_duplicates �� �����.

� 4 � � �� �� 83

�� ��

�� �� � �� ��(�:� �� ��, � �� �� �� � ���� �� �

�)� ���� ����.

��� ���� ��, �� � ���� �� � ��� �� ��� ��

�� �� � ��� �� �� ��� ���, ��� � ��� �� ���

�� �����. �� ���� � ��� � ��� ���� ��� ��� �,

� �� �� � ���� �� ���� � ���.

�� ��� � ��� �� � �� ���.

� ��

commit_action � �� �� ��� ��� �����.

commit_rule � �� ��� ��� �����.

commit_set � ��� ��� ��� �����.

BAROC �

�� �� � ��� �� ����� ��� BAROC ��� ���� ����.

�� ��� � ��� �� � �� ���.

� ��

bo_add_at_slotval_begin ��� ��� ��� � �� ��� �����.

bo_add_at_slotval_end ��� � �� �� ��� ��� �����.

bo_get_class_of ���� ���� ����.

bo_get_class_slots ��� ���� �� �� ��� ����.

bo_get_enum_options � ��� ����.

bo_get_slotval ������ ��� �� ����.

bo_is_defined_for_class ��� ��� ���� �� ������ � ���.

bo_is_direct_super_of ��� ���� �� ��� ���� � �����

� � ���.

bo_is_super_of ��� ���� �� ��� ���� ������ �

���.

bo_remove_from_slotval �� � ������ �� ����.

bo_reset_default_slotval ���� �� �� �� � ��� ������.

bo_set_slotval ��� �� �� �����.

print_class_tree ��� ��� �� �� ��� �� � ������ �

�� ����� �����.

��� �

�� �� ���� ��� ���� � ��� �� ���� ����.

create_event_criteria �� ���� ��� �� � �����. ��� ��

check_event_criteria �� �� �� � ���� ��� �� �����. �� �

84 IBM Tivoli Enterprise Console: � �� ���

�� � � ��� ��� ��� �� �� �� ���� �� �� �

�� � �� ���� ��� � ���.

�� ��� � ��� �� � �� ���.

� ��

check_event_criteria ���� �� ��� ���� �� �� ����

�����.

create_event_criteria � � �� �� � � � ��� � . ��� � �

check_event_criteria � � create_cache_search_criteria

�� �����.

��� �

�� �� ��� �� ��� ���� ���� � ��� �� ���� ��

��.

�� ��� � ��� �� � �� ���.

� ��

init_event_activity ��� � ���� ��� �� �� �� ����

�.

print_event_activity init_event_activity �� ��� ��� � ���� �

����.

reset_event_activity �� ��� �� �� �� �� 0�� ������.

update_event_activity print_event_activity_report �� ��� �� ��� �

�� �����.

�� �� ��� �� �� ��� �� ���� ������ � �� �� ��

� ��� ���� � ��� �� ���� ����. ��� ���� ��

�� ���. �� ��� � ��� �� � �� ���.

� ��

check_all_thresholds �� ���� �� ���� �� ���� �� �

����.

check_threshold �� ���� ���� ���� �� ���� ��

�����.

create_threshold ���� �����.

�� � �

�� �� ��� �� � �� ���� �� �� � � ��� �� ���

��. �� � � �� Perl ���� ���� Tivoli Management Framework�

�� ���� �� ����. �� �� � ��� ���� � log_error �

� ���� ��� �� �� �� ��� ���� TEC_Error ���� ��

� 4 � � �� �� 85

��. �� ��� � ��� �� � �� ���.

� ��

re_after_match ��� �� � �� ���� � ��� ��� �

�� �� ��� �� ��� � ���� �����.

re_before_match ��� �� � �� ���� � ��� ��� �

�� �� ��� �� ��� � ���� �����.

re_create �� �� � � �� � �� �� � �� ��

���.

re_match ��� �� � �� ���� � ��� ��� �

�� ��� �����.

re_search_string ��� �� � �� ���� � ��� ��� �

���.

re_substitute ��� �� � �� ���� � ��� ��� �

��, ��� ���� � � � ���� �����.

re_substitute_global ��� �� � �� ���� � ��� �� ���

���, �� ��� ���� � � � ���� �

����.

��� ��

��� ��� �� �� ��� �� �� ��� ��� ���� ����. ��

� ��� 59 ���� ���� ���� ���� ���.

�� ��� � ��� �� � �� ���.

� ��

erase_globals �� ������ ��� �� �� �� ��� ��� �

���.

get_global_grp ��� �� �� �� ��� ��� �� ����.

get_global_var ��� ��� �� ����.

get_globals �� ��� ��� ����.

global_exists ��� ��� ��� �� ��� � ���.

load_globals ��� ��� ���� �� ���� �����.

reset_global_grp ��� �� �� �� ��� ��� �� ������.

save_globals �� ��� ��� ������ ��� �����.

set_global_var ��� ��� �� �����.

�� �

�� �� ��� ��� ��� �� ���� ����.

86 IBM Tivoli Enterprise Console: � �� ���

�� ��� � ��� �� � �� ���.

� ��

convert_ascii_time �� ��� �� �����.

convert_gm_time �� �� �� ���� ��� �� ��� �����.

convert_local_time �� �� �� �� �� ��� �� ��� ����

�.

get_gm_time ���� ��� � � � ��� ����.

get_local_time � �� �� ��� ����.

get_time ��� � � �� ��� � ��� ����.

resolve_time �� ��� ��� ����.

�� � ��� ��

�� �� ��� �� ���� ��� �����.

� ��

exec_program ���� �����.

exec_program_local ���� �� ���� �����.

exec_task ���� ��� �������� �����.

exec_task_local ���� �� ��� ��� �������� ��

���.

�� � �� �

�� �� ��� ��� �� � ��� ��� ����� �����.

� ��

add_to_repeat_count ���� repeat_count ��� �� �����.

change_event_administrator ���� ��� �����.

change_event_severity ���� ���� �����.

change_event_status ���� ��� �����.

decrement_slot ��� �� �� ��� �� ���.

get_attributes ��� �� �� ����.

increment_slot ��� �� ��� �� �� �����.

place_change_request �� �� ��� �����.

re_split_event_id server_path ��� ��� ��� �� ���.

set_event_administrator ���� �� ��� �����.

set_event_message ���� msg ��� �����.

set_event_severity ���� ���� �����.

set_event_status ���� ��� �����.

� 4 � � �� �� 87

�� �

��� �� �� ����.

�� ��� � ��� �� � �� ���.

� ��

check_and_increment_count init_count �� �� ��� ��� � ���.

clear_closed_events ��� ����� �� ��� ���� ����.

drop_change_request �� �� ��� �� �� ��� ���� �� ���

�.

drop_received_event �� ��� �� ���� ����.

forward_event ���� ��� ��� �����.

generate_event �� ���� ����.

get_config_param � �� �� ��� ����.

init_count ��� ���� �����.

ip_node_unreachable ���� �� � �� ����� ��� ��� ��

���.

re_mark_as_modified ��� ������� ���� �� ��� �����.

re_send_event_conf ���� �� ��� ��� ����.

redo_analysis ���� �� �� �����.

remove_bslashes ��� ���� ���� ��� �����.

set_timer ���� ��� �����.

���

�� �� ��� ��� �� �� ����� �� ����.

�� ��� � ��� �� � �� ���.

� ��

log_error � ��� ���� �� ���� ����.

set_detailed_debugging �� �� � ��� �� ��� ���.

set_log_error_source log_error �� �� �� �� ������ ��

�� �� �� ID� �����.

trace_it �� �� � �� ��� � �� ��� �����.

� �� �� ��� �

�� ��� � �� �� ���� � �� ���.

88 IBM Tivoli Enterprise Console: � �� ���

add_to_repeat_count ���� repeat_count ��� �� �����.

��: add_to_repeat_count(_event, number)

��: � �� ����� ��� � ���� �� ���� � �����.

� ���� ��� � �� ���� repeat_count ��� � �� ���� �

���� �����.

��:

_event repeat_count ��� ���� ���

number

�� repeat_count �� �� ���� �

�: �� ����� ��� ���� �� ���� ���� �� �����.

1. ��� �� ��� ���� ���� ���� �� ���� ��

�� � ���� �� �� �����. �� �� �� �� 10���.

2. � ���� ���� ���� ��� ���� repeat_count ��� 1 ���

�, �� ��� ���� ����, � �� �� � ��� �����.

�� ���� ���, �� ��� ���� ����� ���� ��� ���

�����.

rule: printer_problem:( event: _event of_class within [’Printer_Paper_Out’, ’Printer_Toner_Low’, ’Printer_Offline’, ’Printer_Output_Full’, ’Printer_Paper_Jam’, ’Printer_Door_Open’], reception_action: ( first_duplicate( _event, event: _printer_ev where [ status: outside [’CLOSED’] ], _event - 600 - 600 ), commit_rule, add_to_repeat_count(_printer_ev, 1), drop_received_event ) ).

��: first_duplicate

� 4 � � �� �� 89

all_clear_targets ��� ��� ���� ��� ���� �� ���� �����.

��: all_clear_targets(_clear_event, _target_event )

--��--

all_clear_targets(_clear_event, _target_event, time_before, time_after)

��: � �� _clear_event� ��� �� ���� �� ��� ��� ���

� �����. ��� ��� ���� _target_event� �����.

time_before � time_after �� ���� �� ��, ��� �� � �� ��

� ��� 2 (1 � � 1 �)� �����. � �� �� �� � ���

�� �� ��� �� ��� ��� ���.

��:

_clear_event

��� ����� �

_target_event

_clear_event� ��� ���� ��� ��� ����� �. � ���

���.

time_after

_clear_event� ��� �� �. � �� ��� �� �� �� ��

� ���� � �����.

time_before

_clear_event� ���� �� �. � �� ��� �� �� �� �

�� ���� � �����.

�: �� ��� ���� �� ��� �� ���� �� ��� ���

����. ��� ���� ��� � �� �����. � �� � ����� �

��� ���� �� �� ���� ������.

rule: ’clear_target_events’:( event: _clr_ev of_class ’EVENT’, action: ’search_for_target’:( all_clear_targets(__clr_ev, _tgt, 3600, 0), set_event_status(_tgt, ’CLOSED’) ) ).

��: any_clear_target, create_clearing_event, create_event_sequence

90 IBM Tivoli Enterprise Console: � �� ���

all_duplicates ��� �� �� � �� � ��� ��� ��� � ���� �� � � ��

���.

��: all_duplicates(_event, event: _duplicate where attribute_conditions)

--��--

all_duplicates (_event, event: _duplicate where attribute_conditions, _referenceEvent

-time_before -time_after)

��: � ��� � ��� ����� ���� ����. ���, all_duplicates

�� � �� � �� ��� �����. � ��� all_duplicates �� �

� �, �� �� ����� �� ��� �� �� ���� �� �

� ��� �����.

� ���� ���� �� ������ ��� ��� ���� ��

��. � ���� �� �� ��� 83 ���� �� ����� ������.

��:

_event � ����� �

_referenceEvent

� ��� �� �� �� �� ����� �

event:_duplicate where attribute_conditions

��� �� ��� �� ��� ��� �����. _duplicate� ��� �

�� � ����� �� �������. �� ��� 70 ���� ��

�� ���� ������.

-time_after

�� ��� �� �

-time_before

�� ��� �� �

�: �� ����� �� ��� ���� �� �����.

1. ��� �� OV_NODE_DOWN ����� ���� 600 �� �

�� � �� �� ��� ��� �����.

2. � ���� ���� �� ���� ���� �� ���� ��

���.

rule: dup_nfs_not_resp:( event: _event of_class ’OV_NODE_DOWN’ where [severity: _severity],

� 4 � � �� �� 91

action: dup_event_severity:( all_duplicates(_event, event: _dup_OV_ev where [status: outside [’CLOSED’] ], _event -300 -300 ), set_event_severity(_dup_OV_ev, _severity) ) ).

��: first_duplicate

92 IBM Tivoli Enterprise Console: � �� ���

all_instances ��� ���, �� � �� � ��� ��� ��� ���� �� � � ���

��.

��: all_instances(_event, event: _eventInstance of_class class where

attribute_conditions)

--��--

all_instances(_event, event: _eventInstance of_class class where attribute_conditions,

_referenceEvent -time_before -time_after)

��: � ��� � ��� ����� ���� ����. ���, all_instances

�� � �� � �� ��� �����. � ��� all_instances �� ��

�, �� �� ����� �� ��� �� �� ���� �� �

� ��� �����.

��:

_event � ����� �

_referenceEvent

� ��� �� �� �� �� ����� �

event: _eventInstance of_class class where attribute_conditions

��� �� ��� �� ��� ��� �����. _eventInstance� ���

� ��� ���� �� �� �������. �� ��� 70 ��

�� ���� ���� ������.

-time_after

�� ��� �� �

-time_before

�� ��� �� �

�: �� �� ��� �� ��� Pascal �� �� ��

NFS_SERVER_NOT_RESPONDING ���� �� �����.

action: ( all_instances(_event, event:_nfs_ev of_class ’NFS_SERVER_NOT_RESPONDING’ where [server: equals ’Pascal’]), set_event_status (nfs_ev, ’CLOSED’) )

��: first_instance

� 4 � � �� �� 93

any_clear_target ��� ��� ���� ��� ��� � �� � ���� �����.

��: any_clear_target(_clear_event, _target_event)

--��--

any_clear_target(_clear_event, _target_event, time_before, time_after)

��: � �� _clear_event� ��� �� ���� �� ��� ��� �

�� � �����. ��� ���� _target_event� �����.

time_before � time_after �� ���� �� ��, ��� �� � �� ��

� ��� 2 (1 � � 1 �)� �����. �� �� �� �� � ��

� �� �� ��� �� ��� ��� ���.

��:

_clear_event

��� ����� �

_target_event

_clear_event� ��� ���� ��� �� ����� �. � ��

� ���.

time_after

_clear_event� ��� �� �. � �� ��� �� �� �� ��

� ���� � �����.

time_before

_clear_event� ���� �� �. � �� ��� �� �� �� �

�� ���� � �����.

�: �� ��� ���� �� ��� �� ��� ���� �� �

�� ��� ����. ��� ���� ��� � �� �����.

rule: ’clear_target_event’:( event: _clr_ev of_class ’EVENT’, action: ’search_for_target’:( any_clear_target(_clr_ev, _tgt, 3600, 0), set_event_status(_tgt, ’CLOSED’) ) ).

��: all_clear_targets, create_clearing_event, create_event_sequence

94 IBM Tivoli Enterprise Console: � �� ���

any_clearing_event �� ���� ��� ��� � �� ���� �����.

��: any_clearing_event(_event, _clear_event)

--��--

any_clearing_event(_event, _clear_event, time_before, time_after)

��: � �� _event� �� ��� � � �� ��� ���� �� ��

� ��� ��� � �����.

time_before � time_after �� ���� ���, ��� �� � �� �� �

� 2 (1 ��, 1 ��)�� �����. � �� �� �� ���� ���

� �� �� ��� �� ��� ��� ���.

��:

_clear_event

_event� �� ��� �� ��� ����� �. � ��� ���.

_event ��� ���� ��� � ����� �

time_after

_event� ��� �� �. � �� ��� �� �� �� ��� ��

�� � �����.

time_before

_event� ���� �� �. � �� ��� �� �� �� ��� �

��� � �����.

�: �� ��� ���� ��� �� ��� ���� �� ���

��� ����. ��� ���� ���� ���� �� ���� ��

� �����. � �� � ����� ����, ���� �� �� ���� �

�����.

rule: ’check_for_clear’:( event: _ev of_class ’EVENT’, action: ’search_for_clear’:( any_clearing_event(_ev, _clr, 3600, 0), set_event_status(_ev, ’CLOSED’), commit_set ) ).

��: create_clearing_event, create_event_sequence

� 4 � � �� �� 95

attr_condition ��� ���� � ���� �� �� �� ��� �����.

��: attr_condition([classes], [attribute_conditions])

��: � �� ��� ���� �� ��� ���� �� �� ��� ����

� �����. create_event_sequence �� event_details ���� �� ���

�� ���. (create_event_sequence �� attribute_conditions �� ���

���� �� ���� �� �� ��� �����.)

��� ���� �� �� ��� clears �� �����.

��:

classes

�� ����, �� ��� ��� �� ��� ��� ���� ��(�:

[‘upsOnBattery’, ‘lowBattery’, ‘upsDischarged’])

attribute_conditions

��� ���� classes �� ��� ��� ���� ����� ���

�� �� ��� ��. �� ��� �����. �� ��� ��� ���

�� �� ��� �����(�: [severity,equals,‘HARMLESS’]) � ��

��� �����, �(nest) ��(�: [[severity,equals,‘HARMLESS’],

[hostname,equals,orange]]� ������.

��� ����, � �� �� �� �� ��� �� �� ����� 140

���� �create_event_criteria�� �� attribute_conditions � ��� �

�����.

�: �� ����� ���� ��(APC(American Power Conversion) ���

�� �� �� � IBM Tivoli Distributed Monitoring)��� ��� ���� ��

��� ��� �����. APC ���� �� �� ����� ���� � ��

� �� ��� �����. Tivoli Distributed Monitoring� universal_host ���

� probe_arg ��� ���� �� �� ����� �����.

attr_condition �� ��� ����� universal_host ���� ��� �� �

� ��� �����. (� ���� ��� �� �� FATAL�� ���.)

attr_exception ���� �� ��� ����� ����� ��� �� ��

�� �����.

create_event_sequence( [’upsOnBattery’, ’lowBattery’, ’upsDischarged’, ’universal_host’], [’hostname’, [’status’,’outside’,[’CLOSED’]]

96 IBM Tivoli Enterprise Console: � �� ���

[ clears(’powerRestored’,[ ], [’upsOnBattery’],[ ]), clears(’returnFromLowBattery’,[ ], [’lowBattery’],[ ]), clears(’dischargeCleared’,[ ],[’upsDischarged’],[ ]), clears(’universal_host’, [ [’severity’, equals,’HARMLESS’] ] [’universal_host’], [ ]), attr_condition(’universal_host’, [’severity’,equals,’FATAL’]), attr_exception(’hostname’,’universal_host’, ’probe_arg’) ] ),

��: attr_exception, create_clearing_event, create_event_sequence

� 4 � � �� �� 97

attr_exception ��� ���� �� ���� �� ��� ��� �� ��� �����.

��: attr_exception(attribute, [classes], exception_attribute)

��: � �� ��� ��� �� ���� �� � ��� ���� �� ���

���� �� �� ��� ���� � �����. create_event_sequence ��

event_details ���� �� ��� �� ���.

�� ��, ���� ��� ���� hostname ���� ��� ��� ����

���� ������. �� ���� ��� probe_arg ��� ��� ���

��� �����. �� ��� �� � ���� ����� ����

attr_exception �� ���� �� �� ��� �� �� ���.

��� ��� �� � �� ��� � attr_exception �� ���� ���.

��:

attribute

�� ��� � ��. � ��� ��� ��� �� create_event_sequence

�� attribute_conditions �� ���� ���.

classes

attribute� �� �� ��� ��� ���� ��

exception_attribute

attribute� � �� ��

�: �� ����� ���� ��(APC ��� �� �� �� � Tivoli

Distributed Monitoring)��� ��� ���� �� ��� ��� �����. APC

���� �� �� ����� ���� � ��� �� ��� �����. Tivoli

Distributed Monitoring� universal_host ���� probe_arg ��� ���� �

� �� ����� �����. attr_exception ���� ���� ����� �

�� �� �����.

create_event_sequence([’upsOnBattery’, ’lowBattery’, ’upsDischarged’, ’universal_host’], [’hostname’, [’status’, ’outside’, [’CLOSED’]], [attr_exception(’hostname’, ’universal_host’, ’probe_arg’)] )

��: create_event_sequence

98 IBM Tivoli Enterprise Console: � �� ���

attr_sequence ��� ���� ���� ��� �� ���� �� �� �����.

��: attr_sequence(class, attribute=[value_sequence])

��: � ��, ��� ��� �� ��� ���� �� �� ���� ��

� ��� ��� ���� �� �����. create_event_sequence �� event_details

���� �� ��� �� ���. �� ��� �� � � ��� �� ��

� ���� ����� ��� ���� ��� �� �����.

�: � � � �� ��� ��� ���� � ��� ��� �� ��� ��

� ���.

��:

attribute

�� �� ��� ���� ��� ��

class ��� �� ��� ���� ��

value_sequence

��� ���� ��� ���� �� �. � �� ��� �����.

�: �� ����� Compaq �� ���� ���� �� ��� ��� ����

�. � ���� �� �� ���(cpqTape3PhDrvStatusChange)���.

cpqTapePhyDrvCondition �� �� ��� ���� ��� OK ��� ��� �

���� �����.

��� ��� ��� � � ��� ���� �� ���� �� �� ���� ��

� ��� � � ���, �� �� � ��(���� ������ ��� ���

��)� attr_sequence �� ���� ���.

create_event_sequence( [’cpqTape3PhyDrvStatusChange’], [’hostname’, [’status’,’outside’,[’CLOSED’]]] [attr_sequence( ’cpqTape3PhyDrvStatusChange’, ’cpqTapePhyDrvCondition’=[’Degraded’, ’Failed’]) ] )

��: create_event_sequence

� 4 � � �� �� 99

bo_add_at_slotval_begin ��� ��� ��� � �� �� �� �����.

��: bo_add_at_slotval_begin(_event, _attribute, _value)

��: � �� _value �� _event ����� _attribute� �� � ��� ��

�� �����. � �� _attribute� ��� ��� �� ��� �� �

���.

��:

_attribute

_event�� ��� ��

_event ����� �

_value ��� �� �

�: �� ��� acl ��� ���� �� �����. � ��� ��

�� Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( % Before the call, the ’acl’ attribute contains % [admin]. bo_add_at_slotval_begin(_event, ’acl’,’user’) % Now the ’acl’ attribute contains [user,admin]. ) ).

��: ��

100 IBM Tivoli Enterprise Console: � �� ���

bo_add_at_slotval_end ��� ��� ��� � �� �� �����.

��: bo_add_at_slotval_end(_event, _attribute, _value)

��: � �� _value �� _event ����� _attribute ��� �� � ���

�� �����. � �� _attribute� ��� ��� �� ��� �� ��

��.

��:

_attribute

_event�� ��� ��

_event ����� �

_value ��� �� �

�: �� �� �� acl ��� �� �� �����. � ��� ����

Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( % Before the call, the ’acl’ attribute contains % [admin]. bo_add_at_slotval_end(_event, ’acl’,’senior’) % Now the ’acl’ attribute contains [admin,senior]. ) ).

��: ��

� 4 � � �� �� 101

bo_get_class_of ���� ���� ����.

��: bo_get_class_of(_event, _classname)

��: � �� _classname�� _event� ��� ���� ��� ����.

_classname� ��������, �� �� ���� ��� ��� �� �

�����.

��:

_classname

_event� ��� ��

_event ����� �

�: �� ����� ���� ��� ��� �� �� �����. �

��� ���� Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( bo_get_class_of(_event, _classname) % _classname is unified with ’Su_Success’. ) ).

��: ��

102 IBM Tivoli Enterprise Console: � �� ���

bo_get_class_slots ��� ���� �� �� ��� ����.

��: bo_get_class_slots(_classname, _attributes)

��: � �� _attributes ����� �� ��� ��� _classname� �� �

� ��� ����. ��� ���� ��� �� ��, �, ���� �� ���

�� ��� ���, �������� ��� ��� ���.

��:

_attributes

��� ��� ���� ��� ��� �� ��

��� ��� �� �� ��� �����.

1. ��

2. �� ��

3. �� ��

4. parse facet� �� ��

5. dup_detect facet� �� ��

��� ��� ��� �� ���� �� ���.

slot(attribute_name,complex_type, element_type,parse_setting,dup_detect_setting,’’)

_classname

��� ���� ��

�: �� ����� ���� ���� �� �� ��� �� ��

� �� �� �����. � ��� ���� Su_Success ���� �

���� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( bo_get_class_slots(_class, _slots) ) ).

�� ��� � ���� _attributes� �����. � ��� �� ��� ���

�� � �� IBM� �� ����� ���� ���.

[slot(server_handle,SINGLE,INTEGER,NO,NO,’’), slot(date_reception,SINGLE,INT32,NO,NO,’’), slot(event_handle,SINGLE,INTEGER,NO,NO,’’), slot(source,SINGLE,STRING,YES,NO,’’), slot(sub_source,SINGLE,STRING,YES,NO,’’), slot(origin,SINGLE,STRING,YES,NO,’’),

� 4 � � �� �� 103

slot(sub_origin,SINGLE,STRING,YES,NO,’’), slot(hostname,SINGLE,STRING,YES,NO,’’), slot(fqhostname,SINGLE,STRING,YES,NO,’’), slot(adapter_host,SINGLE,STRING,YES,NO,’’), slot(date,SINGLE,STRING,YES,NO,’’), slot(status,SINGLE,STATUS,YES,NO,’’), slot(administrator,SINGLE,STRING,NO,NO,’’), slot(acl,LIST_OF,STRING,NO,NO,’’), slot(credibility,SINGLE,INTEGER,NO,NO,’’), slot(severity,SINGLE,SEVERITY,YES,NO,’’), slot(msg,SINGLE,STRING,YES,NO,’’), slot(msg_catalog,SINGLE,STRING,YES,NO,’’), slot(msg_index,SINGLE,INTEGER,YES,NO,’’), slot(duration,SINGLE,INTEGER,NO,NO,’’), slot(num_actions,SINGLE,INTEGER,NO,NO,’’), slot(repeat_count,SINGLE,INTEGER,YES,NO,’’), slot(cause_date_reception,SINGLE,INT32,NO,NO,’’), slot(cause_event_handle,SINGLE,INTEGER,NO,NO,’’), slot(pid,SINGLE,STRING,YES,NO,’’), slot(from_user,SINGLE,STRING,YES,YES,’’), slot(to_user,SINGLE,STRING,YES,YES,’’), slot(on_tty,SINGLE,STRING,YES,YES,’’)].

��: ��

104 IBM Tivoli Enterprise Console: � �� ���

bo_get_enum_options � ��� ����.

��: o_get_enum_options(_enumname, _options)

��: _enumname � �� � �� ��� _options ��� �����.

��:

_enumname

� ��

_options

�� ��� �

�: �� ��� ���� �� SEVERITY � �� �� ���

��� ����. � ��� ���� Su_Success ���� ����� �

����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( bo_get_enum_options(’SEVERITY’, _options) % _options is unified with [UNKNOWN, % HARMLESS,WARNING,MINOR,CRITICAL,FATAL] ) ).

��: ��

� 4 � � �� �� 105

bo_get_slotval ������ ��� �� ����.

��: bo_get_slotval(_event, _attribute, _value)

��: � �� _event ����� _attribute �� �� ����. �� _value�

�����. _value� �� �� ����� _attribute� �� ��� ��� �

� ���.

��:

_attribute

�� � ��� ��

_event ����� �

_value _attribute �� �

�: �� ��� ������ sub_source ��� �� ����. � ��

� ���� Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( bo_get_slotval(_event, ’sub_source’,_sub_source) % _sub_source is unified with ’su’. ) ).

��: bo_set_slotval

106 IBM Tivoli Enterprise Console: � �� ���

bo_is_defined_for_class ��� ��� ���� �� ������ � ���.

��: bo_is_defined_for_class(_attribute, _classname)

��: � �� _attribute ��� _classname ���� ���� �� ����

�.

��:

_attribute

� ��

_classname

�� ��� �� � ��� ���

�: �� ��� ���� �� ��� pid�� ��� ��� �� �

����. � ��� ���� Su_Success ���� ����� ����

�.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( bo_is_defined_for_class(’pid’, _class) % Succeeds. ) ).

��: ��

� 4 � � �� �� 107

bo_is_direct_super_of ��� ���� �� ��� ���� �� ������ � ���.

��: bo_is_direct_super_of(_super_classname, _classname)

��: _super_classname� _classname� � ������� �����.

��:

_classname

_super_classname� � �����

_super_classname

_classname� � �����

�: �� ��� ���� Logfile_Su ���� � ������ ��

���. � ��� ���� Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( bo_is_direct_super_of(’Logfile_Su’, _class) % This predicate succeeds because % ’Logfile_Su’ is a % direct superclass of ’Su_Success’. ) ).

��: ��

108 IBM Tivoli Enterprise Console: � �� ���

bo_is_super_of ��� ���� �� ��� ���� ������ � ���.

��: bo_is_super_of(_super_classname, _classname)

��: � �� _super_classname� _classname� � �� �� �������

�����.

��:

_classname

_super_classname� �����

_super_classname

_classname� �����

�: �� ��� ���� Logfile_Base ���� ������ ���

��. � ��� ���� Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( bo_is_super_of(’Logfile_Base’, _class) % _class was instantiated to ’Su_Success’ % in event filter. % This predicate succeeds because % ’Logfile_Base’ is a superclass % of ’Su_Success’. ) ).

��: ��

� 4 � � �� �� 109

bo_remove_from_slotval �� � ������ �� ����.

��: bo_remove_from_slotval(_event , _attribute , _value)

��: � �� _value �� _event ����� _attribute ��� �� � ���

��� ����. � �� _attribute� ��� ��� �� ��� �� �

���.

��:

_attribute

_event�� ��� ��

_event ����� �

_value _attribute��� � ��

�: �� ��� acl ������ ��� �� ����. � ��� �

��� Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, % _class is unified with Su_Success. action: ( % Before the call, the ’acl’ attribute contains [admin]. bo_add_at_slotval_end(_event, ’acl’,’senior’), % Now the ’acl’ attribute contains [admin,senior]. bo_add_at_slotval_begin(_event, ’acl’,’user’), % Now the ’acl’ attribute contains [user,admin,senior]. bo_remove_from_slotval(_event, ’acl’, ’admin’) % Now the ’acl’ attribute contains [user,senior]. ) ).

��: ��

110 IBM Tivoli Enterprise Console: � �� ���

bo_reset_default_slotval ���� �� �� �� � ��� ������.

��: bo_reset_default_slotval(_event , _attribute )

��: � �� _event ���� _attribute ��� � �� �������.

��:

_attribute

_event�� ��� ��. �� ���.

_event ����� �

�: �� ����� � ��� �����. � ��� ����

Su_Success ���� ����� �����.

rule: baroc_example: ( event: _event of_class _class, action: ( bo_reset_default_slotval(_event, ’sub_source’) % The slot ’sub_source’ for the event % under analysis is set back to ’su’. ) ).

��: ��

� 4 � � �� �� 111

bo_set_slotval ��� �� �� �����.

��: bo_set_slotval( _event, _attribute , _value)

��: � �� _attribute ��� �� _event ����� _value ��� ����

�.

place_change_request ��� ���, �� �� � ��� �� ���� ���

����.

��, place_change_request�� ��, bo_set_slotval� ��� ������ �� �

�� � �� �� �� �� ���� ����. �� ���� ���� ���

�� �� ������ �� � �� �� �� � ��� �� ���� �

� �����. ���, � ���� �� �� ���� �� ��� bo_set_slotval�

���� ��, ��� ���� �� ����. ��� ����� ����� ��

�, re_mark_as_modified �� ��� ��� ������.

��:

_attribute

�� ��

_event �� ���� �� ��� �

_value ��� �� � �

�: �� ����� ���� hostname ��� � myhost� ����

�� �����.

bo_set_slotval(_event, hostname, ’myhost’)

��: bo_get_slotval, place_change_request, re_mark_as_modified

112 IBM Tivoli Enterprise Console: � �� ���

cancel_all_timers ���� ��� �� ��� �����.

��: cancel_all_timers(_event)

��: � �� ���� ��� �� ��� �����.

��:

_event �� ��� ��� ����� �

�: �� ��� �� ��� ���� ����� � ���� ��� �� ��

� �����. � ��� ���� ����� � ���� �� �� �� �� �

�� ����� �����.

rule: cancel_timers:( event: _ev of_class ’EVENT’, action: cancel_timers:( first_effect_event(_ev, _effect, 300, 300), link_effect_to_cause(_effect, _ev), cancel_all_timers(_effect) ) ).

��: cancel_timer

� 4 � � �� �� 113

cancel_timer ���� ��� ��� ��� �����.

��: cancel_timer(_event , _timer_duration, _timer_info)

��: � �� �� �� �� �� �� ���� ��� ��� ���

�����. ���, ���� ���� _event �� ���� ���. ����

�� �� ������ �� ��� �� �� Prolog �� ��(�� �)� �

� �� ���� ���. ������ �� ��� ��� ��� ����

��� ��� ���� ���.

��:

_event ��� �� ����� �

_timer_duration

��� �� ��( �). � �� ��� ��� � �����. �� �

�� 234 ���� �set_timer�� ������.

_timer_info

�� ��. � �� ��� ��� � �����. �� ��� 234 ��

�� �set_timer�� ������.

�: �� ��� ��� ��� ���� ���� �� ��� ��� ���� 5

��� ��� �����. 5 ��� ��� � ���� �� � �� �

� ��� ���� ��� ��� ��� � ���� �� � � ���� �

� ����� ���.

���� ����, ��� ��� �� 5 �� ��� ��� ���� �� ��

��.(��� ���� create_event_sequence �� �����.) ����

���� ��� ��� � ���� � ���� ���� �� ���� � �

��� ���� � ��� �����. ��� ���� ����� ���

� ��� ��� 5�� ����(��� � ���� ����� ��� ��)

��� �����.

��� � ���� 5 �� � �� ����, ��� ��� ���� �

���� � ���� ���� � ��� ���� ���� ��� �

����.

create_trouble_ticket �� ��� �� � ��� ��� �����. � ���

�� � scripts/create_trouble_ticket.sh�� ��� �� ��� �

�� ����� ����� �� ��� ���.

rule: set_timer_delay:( event: _ev of_class ’EVENT’,

114 IBM Tivoli Enterprise Console: � �� ���

action: perform_correlation:( first_related_event(_ev, _related, _type, 300, 300), ( _type == ’c’, link_effect_to_cause(_ev, _related), commit_set ; cancel_timer(_related, 300, _info), link_effect_to_cause(_related, _ev) ) ), action: set_timer:( set_timer(_ev, 300, 0), commit_set ) ). timer_rule: create_trouble_ticket:( event: _ev of_class ’EVENT’, timer_duration: equals 300, action: create_ticket:( exec_program(_ev, ’scripts/create_trouble_ticket.sh’, ’%ld’, [_ev], no) ) ).

��: cancel_all_timers

� 4 � � �� �� 115

change_event_administrator ���� ��� �����.

��: change_event_administrator(_event, new_administrator )

��: � �� ��� ���� administrator ��� ���� �� ��� ���.

��� �� �� ��� �� �� ��� ���� �� ��� ��� ���

�.

��:

_event ��� �� ����� �

new_administrator

� ��� ��

�: �� ����� ���� administrator ��� bjones� ����

�� �����.

change_event_administrator(_event, bjones)

��: set_event_administrator

116 IBM Tivoli Enterprise Console: � �� ���

change_event_severity ���� ���� �����.

��: change_event_severity( _event, new_severity)

��: � �� ��� ���� severity ��� ���� �� ��� ���. �

�� ��� �� ��� �� �� ��� ���� �� ��� ��� ���

�.

��:

_event ���� ��� ����� �

new_severity

� ��� ���

�: �� ����� ���� severity ��� CRITICAL� ����

�� �����.

change_event_severity(_event, ’CRITICAL’)

��: set_event_severity

� 4 � � �� �� 117

change_event_status ���� ��� �����.

��: change_event_status(_event, new_status)

��: � �� ��� ���� status ��� ���� �� ��� ���. ���

�� �� ��� �� �� ��� ���� �� ��� ��� ����.

��:

_event ��� ��� ����� �

new_status

� ��� ��.

�: new_status �� �� ACK�� OPEN ���� ��� ��� �

���.

�: �� ����� ���� status ��� ACK� ���� �� �

����.

change_event_status(_event, ’ACK’)

��: set_event_status

118 IBM Tivoli Enterprise Console: � �� ���

check_all_thresholds �� ���� �� ���� �� ���� �� �����.

��: check_all_thresholds(_referenceEvent , _name , _count)

��: � �� ���� ����� ���� �� ��� ���� ���� �

� �� �����. ��� �� ���� �� � � �����. � ���� �

�� �� � ���� ���� ���� �� �� _name � _count �� �

����.

��:

_count ���� ���� ���� �. � ��� ���.

_name �� ���� ��. � ��� create_threshold �� �����.

_referenceEvent

���� ����� ���� �� ��� ���� �� �� ���.

��� � ������.

�: �� ��� NT_Performance_Alert ���� ��� ��� �� ���� �

� ��� ��� �����.

check_all_thresholds(’NT_Performance_Alert’, _name, _count)

��: check_threshold, create_threshold

� 4 � � �� �� 119

check_and_increment_count ��� ����� �� ���� ���.

��: check_and_increment_count(_key1, _key2, _max_count, _cur_count)

��: � �� �� ��� ����� �� _max_count �� ���. �

� _max_count�� ��� �� ���� �� _cur_count� �����. � �

� �� _max_count�� �� �� ���� _cur_count� ������ ��

��.

�: ��� �� � ��� init_count �� ����, ��� � ���

� ���� check_and_increment_count �� ���� �� � ���.

check_and_increment_count �� ����� ��� 0 ��� ����

�� ��� 1� �����. � ���� ��� � �� ��� ���

�� �� ��� ��� �� �� ���. ���� ��� ��� �� �

� � ��� ����� �� ��� ���.

��� �� ��� � �� �� ���� � �����. _key1 � _key2� �

� �� ��� � ����� ��� � ���. �� ��, ��� ���

�.

v ��� ����� �� ���� �� �� �� ���� ��, �� � ��

� ��� ��� � ��� ���� �� ��� ���� event_class, hostname

��� ���� ��� � ���(�: perf_alert,orange).

v ����� ���� �� ��� �� �� �� ���� �� �� � ��

� ��� ���� � ��� ��� �� ��� ���� failure, component

��� ���� ��� � ���(�: paper_jam,flr4rm23).

��� ��� ��� �� ��� �����.

��:

_cur_count

��� �� � �. � ��� ���.

_key1 ��� �� 1� � ��. ����� ���.

_key2 ��� �� 2� � ��. ����� ���.

_max_count

��� �� ���. � �� ���� �� �����. ����� �

��.

�: �� ��� ��� ��� Printer_Jam� ��� �� ���� ���� �

� ��� �� ���. ��� ��� failure,component ��� ���� ����

�. Printer_Jam ���� hostname ���� ��� ���� �����.

120 IBM Tivoli Enterprise Console: � �� ���

��� ��� �� ���� �� ���� check_and_increment_count �� �

� � ���� �����. �� ���� �� ��� �� �� �� ���

�� �� �� ���� ���.

���� �� �� �� 5� �� � ���� ���, �� ���� �� �

�� init_count �� ���� 0�� ������. �� � � � ����

check_and_increment_count � �� �� ���� �� � ����� Prolog

��� ELSE ��� � ����.

rule: printer_jam: ( event : _ev of_class ’Printer_Jam’ where [hostname: _hn within [’flr4rm23’, ’flr3rm12’, ’flr1rm11’, ’flr6rm9’ ], action: check_count: ( (check_and_increment_count(printer_jam,_hn,5,_count) ; % ELSE clause follows exec_program(_ev,’scripts/notify.sh’, ’Printer failure on %s’, [_hn], no), init_count(paper_jam,_hn,0) ) ) ).

��: init_count

� 4 � � �� �� 121

check_event_criteria ���� �� ��� ���� �� �� ���� �����.

��: check_event_criteria(criteria_name, event )

--��--

check_event_criteria(criteria_names_list, operator, event)

��: � �� ���� create_event_criteria �� ���� ��� ��� �

� �����. �� ���� �� �� �����.

�� �� ��� ��� ���� � ��� �� ���� ����.

��:

criteria_name

�� ��� �� ��. � ��� create_event_criteria �� ����

���.

criteria_names_list

�� ���� �, �� ��� �� ��. �� ��� create_event_criteria

�� �������. � �� �� ��(�: [criteria1, criteria2])�� �

����.

event �� �� ��� ���� ��

operator

��� �� ��� ���� � �� ���� �� �����. �

�� ��� ����.

all �� �� ��� �� ���� � �����. �, � ��

�� criteria1� criteria2� � ��� �� �� � �� �

����.

any �� ��� � ��� ��� �����. �, � ����

criteria2� ��� � ���� �� �����.

�:

1. �� �� �� ���� �� ���� �� � ��� �� ���� ���

���� � ���. � ����� �� ��� �� create_event_criteria

�� ����� �� harmless_heartbeat � harmless_maintenance� ��� �

�����. � ��� �� ����, �� ���� ���� ���� ��

� �� �� �� �����.

rule: filter_event: ( event: _event of_class _class where [ ],

122 IBM Tivoli Enterprise Console: � �� ���

reception_action: check_criteria: ( check_event_criteria([harmless_heartbeat, harmless_maintenance ], any, _event ), drop_received_event, commit_rule ) ).

2. �� ��� ���� �� ���� create_event_criteria �� ��

142 ���� �� 2� ��� �� �����.

check_event_criteria(’db_critical’, _ev)

��: create_event_criteria

� 4 � � �� �� 123

check_threshold �� ���� ���� ���� �� ���� �� �����.

��: check_threshold(threshold_criteria_name, _referenceEvent, _count)

��: � �� ��� ���� ����� ���� �� ��� ���� ��

�� �� �� �����. �� ����� �����.

1. ��� ���� ��� ��� �� �� ��� ����� ��� �� �

� �����. � �� create_threshold �� _max_report_freq �� ��

�����.

2. �� �� ��� ��� ����, create_threshold �� �����. �� �

� �� �� �����, ��� ��� ��� �����. ��� ��� ��

�� ���� �� ����.

a. ��� �� � �� ���� ���(create_cache_search_criteria ��

��� ��)

b. �� ��� ��� � �� � �� � ���(create_threshold ��

_window �� ��� ��)

c. ��� �� �� ��� ���� ��� ���(create_threshold ��

_count �� ��� ��)

3. ���� ���� ���� check_threshold �� ���� _check_count ��

� ���� ���� �� �����.

���� ��� ���� � ��� not ��� ���� ���� �� �

���.

��:

_count ��� �� ���� ���� �. � ��� ���.

_referenceEvent

���� ����� ���� �� ��� ���� �� �� ���.

��� � ������.

threshold_criteria_name

�� ��� �� ��. � ��� create_threshold �� �����.

�: �� ��� �� ���� create_threshold �� ��� �� ���

� �� �����. � ��� ��� ����.

v ��� �� ��� db_critical_threshold���.

�: �� �� create_threshold �� TEC_Start ���� �� ���� ��

� � � � ��� ���.

124 IBM Tivoli Enterprise Console: � �� ���

v create_cache_search_criteria �� �� ��� ��� �� � �� ���

db_critical_search���.

v ���� �� �� �� �� ���� ���� 600���.

v ���� �� � ��� ���� � � ��� ����.

v ���� ����� �� ���� �� 300��� �� � ���.

�� ��� �� ���� �� ��� ��� �� ���� �� �

�� �� � �� �� �����. _event �� ���� �� �� �� 10

� ��� db_critical_search� ��� � �� ���� � �� ���� ��

�� check_hold �� ���� ��� 5 ��� �� ���� ����.

create_threshold(’db_critical_threshold’, ’db_critical_search’, 600, 3, 300) % Define the threshold criteria.

check_threshold(’db_critical_threshold’, _event, _count) % Apply the threshold criteria to received event.

��: check_all_thresholds, create_cache_search_criteria, create_threshold

� 4 � � �� �� 125

clear_closed_events ��� ����� �� ��� ���� ����.

��: clear_closed_events

��: � �� ��� ����� �� ��� ���� ����.

��: ��

�: �� ��� �� ��� ��� ��� �� � ��� ��� ��� ���

����.

print_cache(’/tmp/before’), clear_closed_events, print_cache(’/tmp/after’)

��: ��

126 IBM Tivoli Enterprise Console: � �� ���

clears ��� ���� �� ��� ���� �� ��� ���� �����.

��: clears(class, [attribute_conditions ], [target_events ],

[target_attribute_conditions ])

--��--

clears(class, [attribute_conditions], [target_events], [target_attribute_conditions],

[attribute_exceptions])

--��--

clears(class, [attribute_conditions ], [target_events ], [target_attribute_conditions

], create_reverse_lookup)

--��--

clears(class, [attribute_conditions], [target_events], [target_attribute_conditions],

[attribute_exceptions], create_reverse_lookup)

��: � �� �� ��� ���� �� ��� ���� ����� ���� �

� ���� ��� ���� � �����. create_event_sequence �� event_details

� ��� �� ��� �� ���.

�� �� ��� � create_event_sequence �� attribute_conditions �� �

�����, target_attribute_conditions �� � ���� ���.

�: ��� ��� ���� ��� ���� ���� �� ����. ��� ��

�� �� ��� ��� ��� ���� ��� create_clearing_event ��

���� ��� ���� �� � ���.

��:

attribute_conditions

���� ��� ���� ��� ��� ��� �� �� ��� ��. �

�� �� ���� �� ��� ��� ���.

� ��� ����� �� ��� ��� �� �� �� � � ��.

�� ��, ���� HARMLESS� � �� ���� ���� �

�� ����� ������ ��� ��� [severity,equals,

‘HARMLESS’]� � ���.

�: �� �� �� ��� ��� ���� �� �� ���� ��

��� ���� ���� �� ����.

� 4 � � �� �� 127

��� ����, � �� �� �� �� ��� �� �� ��

��� 140 ���� �create_event_criteria�� ��

attribute_conditions � ��� ������.

�� ��

�� ��� �� ��� �� ��� ��. �� ��� ��

� �� ��� ��� �� ��� �� ��� �� �� ��

� �� ��� ���(�: [hostname]).

class ��� ���� ��� ���

create_reverse_lookup

� ��� ���� �� �� � ���� ������ �����. �

� � ���� ��� ���� ��� � ��� ���� ��� ��

�� �� �� ���� ���(��� �� ��� ���� ��� �

��� �� �� ���� �� ���). � �� �� ��� yes �

� no���. � �� ���� ��� � �� no���.

target_attribute_conditions

��� ���� �� ����� target_events �� � � ���� ��

� �� �� ��� ��. create_event_sequence �� attribute_conditions

�� ��� �� ��� ��� ���� � ���.

target_events

class ���� ���� ��� ��� ���� ��

�: �� ��� Compaq �� ���� ���� �� ��� ��� �����.

� ���� �� �� ���(cpqTape3PhDrvStatusChange)���.

cpqTapePhyDrvCondition �� �� ��� ���� ��� OK ��� ��� �

���� �����.

clears �� ��� ���� OK ��� ��� cpqTapePhyDrvCondition ���

� cpqTape3PhyDrvStatusChange ����� �����.

create_event_sequence( [’cpqTape3PhyDrvStatusChange’], [’hostname’, [’status’,’outside’,[’CLOSED’]]] [ attr_sequence( ’cpqTape3PhyDrvStatusChange’, ’cpqTapePhyDrvCondition’=[’Degraded’,’Failed’]), clears( ’cpqTape3PhyDrvStatusChange’, [ [’cpqTapePhyDrvCondition’,equals,’OK’] ], [’cpqTape3PhyDrvStatusChange’], [ ]) ] ),

��: create_clearing_event, create_event_sequence, is_clearing_event

128 IBM Tivoli Enterprise Console: � �� ���

commit_action � �� �� ��� ��� �����.

��: commit_action

��: � �� � � ���� �� �� �� � ��� �� � �

� � ��� � ��� ��� ��� ����.

��: ��

�: �� ����� all_instances �� ��� � �� �� � �� �

�� ���� � �� �� ���� �� �����. � ��� �� �

� ��� ��� ���� ����. ���, �� � � � ��� ���

���� ����.

reception_action: action1: ( all_instances( _event, event: _dup_down_ev where [ status: outside [’CLOSED’] ], _event - 600 - 600 ), add_to_repeat_count(_dup_down_ev, 1), drop_received_event, commit_action ),

��: ��

� 4 � � �� �� 129

commit_rule � �� ��� ��� �����.

��: commit_rule

��: � �� � � ���� �� �� �� � ��� �� � �

� � ��� � ��� ��� ���� ���� ���. ��, ���

� �� � � ���� �� �� ��� �� �� ���� ���.

��: ��

�: �� ����� all_instances �� � �� �� � �� � ���

���� � �� �� ���� �� �����. � ��� �� �� �

�� ��� ���� ��, � � ��� � ��� �� �� ��� ��

���� ��� ����. ���, �� � ��� �� ����

����.

reception_action: ( all_instances( _event, event: _dup_toner_ev where [ status: outside [’CLOSED’] ], _event - 600 - 600 ), add_to_repeat_count(_dup_toner_ev, 1), drop_received_event, commit_rule ),

��: ��

130 IBM Tivoli Enterprise Console: � �� ���

commit_set � ��� ��� ��� �����.

��: commit_set

��: � �� ��� ���� ���� ���.

v � � ���� �� �� �� � ��� ��

v � ��� � ��� ��� ��

v ���� �� � � ���� �� �� �� ��

v ���� �� �� �� �� � ��� �� �� �� �

��: ��

�: �� ����� all_instances �� � �� �� � �� � ���

���� � �� �� ���� �� �����. � ��� �� �� �

�� ��� ���� �� �� � ���� � ��� �� �� ��� ��

���� ��� ����.

reception_action: ( all_instances( _event, event: _dupper where [ status: outside [’CLOSED’] ]), drop_received_event, add_to_repeat_count(_dupper, 1), commit_set ),

��: ��

� 4 � � �� �� 131

convert_ascii_time �� ��� �� �����.

��: convert_ascii_time(_time_structure, _time_string )

��: � �� �� ��� ��� ���� �� �����. _time_structure�

convert_ascii_time � �� ������ ���. _time_string� � ���

���.

��:

_time_string

_time_structure� � ��

_time_structure

�� �� ��� �����. ��� _time_epoch �� �� �� �� �

�� �� ���� � get_time �� �� ��� ���� ��

� ����.

�: �� ����� �� ������ � �� ��� �� �� �� ���

� � ���� ���� time_string ��� � � ���� �� �����.

get_local_time(_time_local_struct), convert_ascii_time(_time_local_struct, _time_string), bo_set_slotval(_event, time_string, _time_string)

��: bo_set_slotval, get_local_time

132 IBM Tivoli Enterprise Console: � �� ���

convert_gm_time �� �� �� ���� ��(GMT)� �� ��� �����.

��: convert_gm_time( _time_epoch, _time_gm_struct )

��: � �� �� �� �� GMT� �� ��� �����. _time_epoch�

convert_gm_time � �� ������ ���. _time_gm_struct� � ���

���.

��:

_time_epoch

�� �� �� �����. ��� _time_local_struct �� �� �� ��

��� �� ���� � get_local_time �� �� ��� ����

��� ����.

_time_gm_struct

�� ��� GMT ���� �����. ��� _time_epoch �� �� �

� �� ��� �� ���� � get_time �� �� ��� ��

�� ��� ����.

�: �� ����� �� ��� �����.

1. �� �� �� �� �

2. ���� �� time_epoch ��� ���� �

3. �� �� �� GMT ��� ���� �

4. GMT ��� � � ���� �

5. ���� time_string ��� � � ���� �

�� ��, time_epoch ��� � ��� � � time_string ��� ��� �

� �� �� � �����.

get_time(_time_epoch), bo_set_slotval(_event, time_epoch, _time_epoch), convert_gm_time(_time_epoch, _time_gm_struct), convert_ascii_time(_time_gm_struct, _time_string), bo_set_slotval(_event, time_string, _time_string)

��: bo_set_slotval, convert_ascii_time, get_time

� 4 � � �� �� 133

convert_local_time �� �� �� �� �� ��� �� ��� �����.

��: convert_local_time( _time_epoch, _time_local_struct )

��: � �� �� �� �� �� ��� �� ��� �����. _time_epoch

� convert_local_time � �� ������ ���. _time_local_struct� �

��� ���.

��:

_time_epoch

�� �� �� �����. ��� _time_local_struct �� �� �� ��

�� �� ���� � get_local_time �� �� ��� ���� �

�� ����.

_time_local_struct

�� ��� �� ��� �����. ��� _time_epoch �� �� �

� �� ��� �� ���� � get_time �� �� ��� ��

�� ��� ����.

�: �� ����� �� ��� �����.

1. �� �� � �� �

2. ���� �� time_epoch ��� ���� �

3. �� �� �� �� �� ��� ���� �

4. �� �� �� ��� � � ���� �

5. ���� time_string ��� � � ���� �

�� ��, time_epoch ��� � ��� � � time_string ��� ��� �

� �� �� � �����.

get_time(_time_epoch), bo_set_slotval(_event, time_epoch, _time_epoch), convert_local_time(_time_epoch, _time_local_struct), convert_ascii_time(_time_local_struct, _time_string), bo_set_slotval(_event, time_string, _time_string)

��: bo_set_slotval, convert_ascii_time, get_time

134 IBM Tivoli Enterprise Console: � �� ���

create_cache_search_criteria ��� �� ��� �� ��� �� �����.

��: create_cache_search_criteria(search_name, criteria_name, attributes,

dup_detect)

--��--

create_cache_search_criteria(search_name, criteria_name, attributes, dup_detect,

returnOrder)

��: � �� ��� �� ��� �� ��� �� �����. ��� ���

� �����.

v �� ��� ���� � search_cache �

v ��� ��� ���� �� �� ���� create_event_criteria �

�� �� ��� ��� �� � ���� ����� � ���� ����

��� ��� ���� ����. �� ��, ��� ���� ��� ��� ���

� ��� �� [A,B,C,D,E]� ������, ���� ��� ���� � �

� �� ���� ��� �� �����. �, C ���� ����� �� �� ��

���� C ���� �� �� ����, ���� E ���� ����� ����

�����. ���� ���� ���� ����� �� ��� A ���� ����

�� ����, � �� �� ��� B ���� ���� �� �����. �� ��

� ���� ���� � �� ���� �� ���� � �� � ���.

� �� ��� �� �� �� TEC_Start ���� �� ��� ��� ���

� ���. ��� ��� �� �� ��� ���� �� � � �����.

��:

attributes

� ��� �� ���� �� ��� ���� �� ��. �

�� �� ��(�: [hostname,severity])�� �����.

criteria_name

�� �� ��� ��� � �� ��� ���� ���� ��. ��

create_event_criteria �� ���� ���.

dup_detect

� ��� ��� ����� ��� ��� �����. ��� ���

����.

no � ��� ��� ����� ���� ����.

yes � ��� ��� ����� �����.

� 4 � � �� �� 135

return_order

�� �� ��� �� ��� ��� ��� ���� ��� ��� �

����. � �� ���� ���, � �� random���. ��� ��

� ����.

order �� �� ��� �� ��� ��� ��� ���� ����

�.

random

��� ���� ���� �����.

search_name

�� �� ��� ��. � ��� search_cache �� �� �����.

�: �� ��� db_critical ��� �� ���� db_critical_search �� ��

���. � �� db_critical ��� �� ��� hostname ��� �� ���

� �� � �� ���� ����. return_order �� ���� ��� �

�� ���� � �� ��� ���� ���� ��� � � random� �

����.

create_cache_search_criteria(’db_critical_search’, ’db_critical’, [’hostname’], yes )

��: create_event_criteria, search_cache

136 IBM Tivoli Enterprise Console: � �� ���

create_clearing_event ��� ���� �����.

��: create_clearing_event(class, [attribute_conditions], [target_events],

[target_attribute_conditions])

--��--

create_clearing_event(class , [attribute_conditions] , [ target_events] ,

[target_attribute_conditions], [attribute_exceptions])

--��--

create_clearing_event(class , [attribute_conditions] , [ target_events] ,

[target_attribute_conditions], create_reverse_lookup)

--��--

create_clearing_event(class , [attribute_conditions] , [ target_events] ,

[target_attribute_conditions], [attribute_exceptions], create_reverse_lookup)

��: � �� ����� ��� ��� �� ��, �� ��� ��� ���

� �� ��� ��� ��� �����.

� �� ��� ���� ��� ���� �� ��� ��� ��� ���� �

�� ��� ��� ��� ��� � ���.

��:

attribute_conditions

��� ���� ���� ���� �� ���� �� ��� �� ���

��. ��� �� ���� �� ��� ��� ���.

� ��� ����� �� ��� ��� �� �� �� � � ��.

�� ��, ���� HARMLESS� � �� ���� ���� �

�� ����� ������, ��� ��� [severity,equals,

‘HARMLESS’]� � ���.

��� ����� �� ��� �� ��� ���. �� �

� ��� ��� ���� ��� ����� �� ���� ���

�� �� �� ��� � �� ��� ����.

�: �� �� �� ��� ��� ���� �� �� ���� ��

��� ���� ��� � ���.

� 4 � � �� �� 137

��� ����, � �� �� �� �� ��� �� �� ��

��� 140 ���� �create_event_criteria�� ��

attribute_conditions � ��� ������.

�� ��

�� ��� �� ��� �� ��� ��(�: [hostname]). � �

�� ��� ���� ��� ����� �� ���� ��� ��

�� �� ��� � �� ��� ����.

attribute_exceptions

��� ���� �� ���� �� ��� ��� �� ��� �����.

� �� �� ��� ��� � �� �� �� ��� �� �

�� ��� ��� ��� ��� ���. �� ��, Tivoli Distributed

Monitoring� �� �� ��� ��� ���� probe_arg ��� ��

� ���.

�� ���� ��� ��� �� ��� �� �� ��� ���

� ���� �� � ���. �� ��� � �� �� ��� ���� �

����� attribute_exceptions �� ���� ��� �� ����

�.

attr_exception � �� �� attribute_exceptions �� ���� � �

����. �� ����� 98 ���� �attr_exception�� ������.

class ��� ���� ��� ���

create_reverse_lookup

� ��� ���� �� �� � ���� ������ �����. �

� � ���� ��� ���� ��� � ��� ���� ��� ��

�� �� �� ���� ���(��� �� ��� ���� ��� �

��� �� �� ���� �� ���). � �� �� ��� yes �

� no���. � �� ���� ��� � �� no���.

target_attribute_conditions

��� ���� �� ����� target_events �� � � ���� ��

� �� �� ��� ��. ��� �� ��� � � �, ��� ��

�� �� ���� ��� ���� ���� ��� �� ��� ��

�� ��� ���� � ���.

target_events

class ���� ���� ��� ��� ���� ��

�:

138 IBM Tivoli Enterprise Console: � �� ���

1. � � �� � � � � �� or igin � � � �� ���� ����

CiscoLinkDown ���� �� ��� ���� �����. �� � ���

� CiscoLinkUp ���� ���� CiscoLinkDown ��� �� �� �� �

���� ���� ����.

create_clearing_event(’CiscoLinkUp’, [ ], [’CiscoLinkDown’], [’origin’], no)

2. �� ��� cpqDa3PhyDrvStatusChange ���� �� ��� ���� ���

��. � ���� cpqDaPhyDrvStatus ��� ��� �� hostname �� �

� ���� ����, ���� ���� Fail � �� ���� ��� OK �

� �� � ���.

��� ���� ��� ���� � ��� ���� �� ����� �� �

� �� �� ���� ���� �� target_events ��� �����.

create_clearing_event( ’cpqDa3PhyDrvStatusChange’, [ [’cpqDaPhyDrvStatus’,equals,’OK’] ], [’cpqDa3PhyDrvStatusChange’], [’hostname’, [’cpqDaPhyDrvStatus’,not_equals,’OK’] ], no),

��: clears, create_event_sequence, is_clearing_event

� 4 � � �� �� 139

create_event_criteria ���� �� �� �����.

��: create_event_criteria(criteria_name , class , fire_on_non_leaf ,

attribute_conditions)

��: � �� ���� ��� ���� � ���� �� �����. ��

check_event_criteria ��� ��� � ��� ����, create_cache_search_criteria

��� �����.

� �� ��� �� �� �� TEC_Start ���� �� ��� ��� ����

���. �� �� ��� ���� �� � � �����.

��� � �� �� ��� �� � ���. ��� 198 ���� ���� �

log_error �� �� � ���.

v ��� ���� �� � ���.

v �� �� ��� ���� � ���.

��:

attribute_conditions

�� ���� �� �� ��� �����. ��� �� ��� � ��� �

��� �����. attribute_conditions �� ��� ��� ��� ��

��� �����. �� ��, �� ��� �� ��� ��� �� �

�� �����.

[[’attribute’, operator, ’value’], [’attribute, operator, ’value’]]

�:

1. �� � ��� �� �� ���. �� ��, greater_than ��

� � STRING ����� ��� ��� �� ��� �� � ��

��. ��� �� �� ���� ���� �� �� ������.

2. �� ��� SINGLE ��� ��� ��� ��� ��� � ���.

3. matches ��� Tivoli Management Framework�� ���� ��

�� Perl �� � � ��� �����.

4. ENUM ��� �� �� ��� �� ���� ����.

5. LIST_OF �� ��� ��� �� ���� ���� ����.

�� ��� ��� SIMPLE ��� ��� �� �� � � ��� �

�� ���. � �� ���� ��� ��� ���� ���� �

� �����. ��� 73 ���� ��� ����� ��� ��� �� �

���.

140 IBM Tivoli Enterprise Console: � �� ���

�� �� ���

ENUM, INTEGER, REAL equals greater_than greater_than_equal

less_than less_than_equal not_equals outside

within

STRING equals not_equals matches outside within

class �� ��� ��� ��� ���. � �� �� ��(�: [‘NT_SNMP’,

‘NT_Server_Start’])�� �����.

� ��� �� ���� �� �� � create_cache_search_criteria

�� � �� �� � return_order �� ���� ��, ���� ��

� ���� ��� ����.

�� ��� 135 ���� �create_cache_search_criteria�� ������.

criteria_name

criteria� �� ��� ��

fire_on_non_leaf

�� ���� ����� �� �� ���� � �� ��� � ��

��� �����. �� �� ����.

no � �� �� ����� � ��� ��� � ���.

yes � �� �� ���� �� ��� ���� � ��� ��� �

���.

�:

1. �� ����� �� ��� �� � �� ���� �� �����. �

�� ��� example_criteria���. ��� create_cache_search_criteria �

�� ���� �����. � �� TEC_DB ���� ���� �� ����

�� � ���.

�: � ��� �� ��� ����. � �� ��� ���� ��� �� �

��� �� �������.

create_event_criteria(example_criteria, ’TEC_DB’, no, [[’hostname’, equals, ’chair’ ], [’hostname’, not_equals, ’chair1’ ], [’hostname’, matches, ’ch.*r’ ], [’repeat_count’, within, [5]], [’repeat_count’, outside, [10,15]], [’repeat_count’, equals, 5], [’repeat_count’, not_equals, 6], [’repeat_count’, greater_than, 4], [’repeat_count’, greater_than_equal, 5], [’repeat_count’, less_than, 6], [’repeat_count’, less_than_equal, 5],

� 4 � � �� �� 141

[’severity’, within, [’MINOR’]], [’severity’, outside, [’FATAL’,’HARMLESS’]], [’severity’, equals, ’MINOR’], [’severity’, not_equals, ’FATAL’], [’severity’, greater_than, ’HARMLESS’], [’severity’, greater_than_equal, ’MINOR’], [’severity’, less_than, ’CRITICAL’], [’severity’, less_than_equal, ’CRITICAL’] ] ),

2. �� ��� db_critical ��� �� �����. � �� ���������

��� TEC_DB ���� CRITICAL� �� �� � ���� �����.

severity ��� � � 60� �� ENUM ���� �����. � ��� ��

������ �� ��� DB_SRV� ����� �����.

create_event_criteria(’db_critical’, ’TEC_DB’ yes, [[’hostname’,matches, ’DB_SRV*’], [’severity’, greater_than_equal, ’CRITICAL’] ] )

3. �� ��� ups_problem ��� �� �����. � �� ��� homer�

��� upsOnBattery, upsBatteryLow �� upsBatteryDischarged ���� ��

���.

create_event_criteria(’ups_problem’, [’upsOnBattery’, ’upsBatteryLow’, ’upsBatteryDischarged’], yes, [[’hostname’,equals,’homer’]] )

��: check_event_criteria, create_cache_search_criteria

142 IBM Tivoli Enterprise Console: � �� ���

create_event_sequence ��� �� ���� ��� �����.

��: create_event_sequence([event_sequence], [attribute_conditions])

--��--

create_event_sequence([event_sequence], [attribute_conditions], [event_details])

��: � �� ��� ��� ���� ���� �� � ���� ��� �� �

�� ���� � �����. ��� ��� ��� ��� ��� ��� ���(�

���� � ��)���.

� ��� ��� �� �� �� � ��� �� ���� ���� �� �� �

�� �� �� �����. ��� �� �� ��� TEC_Start ���� �� �

��� ���� �� � ���.

��:

attribute_conditions

��� ����� ���� ���( ���� ���� �

� ���)� �� ���� �� ��� �� ��� ��. ��� �

� ���� �� ��� ��� ���.

� ��� ����� �� ��� ��� �� �� �� � � ��

(�: �� ��, [severity,equals,‘HARMLESS’]). � ��� ��� �

�� ��� �� ���� �����. ��� ���� ���� �

����� ���� �� ��� 96 ���� ��� attr_condition

�� ���� ���.

��� ����, � �� �� �� �� ��� �� �� ��

��� 140 ���� �create_event_criteria�� ��

attribute_conditions � ��� ������.

�� ��

�� ��� �� �� ��� �� ��� ��. �� ���

��� �� ��� ��� �� ��� �� ��� �� �� �

�� �� ��� ���(�: [hostname]. � ��� ��� �

��� attr_exception� �� � ������ ���� � �

����. attr_exception �� 98 ���� ���� ���.

event_details

��� ��� ��� �� ��� ���� ��� ���� �� ��

����� ���� �� ��. �� � � �� �� �� ����

�.

� 4 � � �� �� 143

� ��

attr_condition ��� ���� � ���� �� �� �� ���

�����.

attr_exception ��� ���� �� ���� �� ��� ���

�� ��� �����.

attr_sequence ��� ���� ��� ���� ��� �� ���

� ��� �� �����.

clears ��� ���� ���� �� ��� ���� ��

���.

event_sequence

���� ������ ��� ��� � ��� ��� ��� ��(�:

[’upsOnBattery’, ’lowBattery’, ’upsDischarged’]).

�:

1. �� ��� ��� ���� ��� ��� �����. ���� ���� �

�(APC ��� �� �� �� � IBM Tivoli Distributed Monitoring)���

�� ���� ���. ��� �� �� �� ��� ��� 240 ���� �

��� �����.

��� ���� ��� ���� ���� ����� upsOnBattery ����

��� ����� �����. ��� ��� ���(universal_host)� Tivoli

Distributed Monitoring�� ����. ���� ��� ��� ���� clears

�� ��� ��� ���� ����. ��� �� �� �� ���� ���

�� ��� �� �� �� �� �����.

Tivoli Distributed Monitoring universal_host ���� �� �� ���� �

� �� probe_arg ��� ���� ���(��� �� �� �� ���� ��

� �� ��� ��) �� ��� �����. ���� � �� probe_arg

��� ��� �� �� �� ���� ��� �� ���� �� ���. �

� ��� �� ���� ��, create_event_sequence �� event_details �

��� �� attr_exception �� ��� �����.

���� �� ��� �� � universal_host ���� ���� FATAL�

����. ���� �� �� ���� �� ���� ��� HARMLESS�

�����. � ��� �� ���� ���� ��� ��� ���� ��

����. ���� FATAL ��� universal_host ���� ��� �� �

� �� ���� ����� ���� ��, create_event_sequence ��

event_details �� attr_condition �� ��� ���. ��, universal_host

���� ���� HARMLESS ��� ��� ������.

���� �� � clears �� �� attribute_conditions �� ��� ���

� ��� ����� �� ��� ���� ���� � �����. hostname �

144 IBM Tivoli Enterprise Console: � �� ���

�� hostname� create_event_sequence� �� attribute_conditions �� �

��� ��� ��� ��� ���.

� �� clears �� �� attribute_conditions �� �� �� universal_host

���� ��� ��� ��� ��� ��� � ��� ���� �����.

create_event_sequence� event_details ���� �� create_event_sequence

� � attr_exception �� �� attribute_conditions ��� hostname �

� ��� ��� ���� ��� ��� �� ��� ��� ����� ��

��.

create_event_sequence( [’upsOnBattery’, ’lowBattery’, ’upsDischarged’, ’universal_host’], [’hostname’, [’status’,’outside’,[’CLOSED’]] [ clears(’powerRestored’,[ ], [’upsOnBattery’],[ ]), clears(’returnFromLowBattery’,[ ],[’lowBattery’], [ ]), clears(’dischargeCleared’,[ ],[’upsDischarged’], [ ]), clears(’universal_host’, [ [’severity’, equals,’HARMLESS’] ] [’universal_host’], [ ]), attr_condition(’universal_host’, [’severity’,equals,’FATAL’]), attr_exception(’hostname’,’universal_host’, ’probe_arg’) ] ),

2. �� ��� ��� ���� ��� ��� �����. � ��� �� ����

���� ��� Compaq Insight Manager��� �� ���� ���. �

��� ��� 241 ���� ���� �����.

� ���� ��� ���� cpqTapePhyDrvCondition ��� ���� ��

���� ���� ����. �� OK � ��� ��� ���� �����.

� ��� ��� ��, �� �� � �� ��(���� ������ ��� �

�)� ���� �� create_event_sequence �� event_details ���� �

�� attr_sequence �� ���� ��� �� � ���.

event_sequence �� � ��� ���� �� ��� ��� ����� �

��� ���� �����. ��� cpqTapePhyDrvCondition ��� �����.

��� ���� �� ��� �� attr_sequence �� � ����� clears

��� target_attribute_conditions �� ���� ����.

create_event_sequence( [’cpqTape3PhyDrvStatusChange’], [’hostname’, [’status’,’outside’,[’CLOSED’]]] [

� 4 � � �� �� 145

attr_sequence( ’cpqTape3PhyDrvStatusChange’, ’cpqTapePhyDrvCondition’=[’Degraded’,’Failed’]), clears( ’cpqTape3PhyDrvStatusChange’, [ [’cpqTapePhyDrvCondition’,equals,’OK’] ], [’cpqTape3PhyDrvStatusChange’], [ ]) ] ),

3. � ��� �� ��� ��� ��� ��� ���. ��� ���� ���

� ��� ��� �����. ��� � ����� � ��� ��� �� ��

�� ��� �� ����. � ���� cpqHe3ThermalSystemFan �

cpqHe3ThermalCpuFan ��� ���� cpqHe3ThermalTemp ��� �� ��

� �������. � ��� ��� �� ���� ��� Compaq Insight

Manager��� �� ���� ���. � � ���� darkest shade,

��� ���� next lightest, ��� � ���� lightest���.

create_event_sequence �� ��� �� ��� ��� �� ��� ��

� �� �� �� ��� � ��� ��� ��� ���� � ��� �

�� ��� ���� � ��� � ���.

��� ����� �� ���� ���� �� ��� ������ ���

� ���� ���� ����� ���� �� ��� ���� ���. ��

� ��� �� ���� �� ���� �� �� �� ��� ��� �

��. � � �� � �� �� � �� � ���.

146 IBM Tivoli Enterprise Console: � �� ���

�� create_event_sequence �� � ��� �� ���� ��� ��� �

�� ���� �����. �� �� cpqHe3ThermalTempDegraded ���

� cpqHe3ThermalCpuFanFailed ���� �� ��� ��� ��� ��

�� �� �����.

create_event_sequence( [’cpqHe3ThermalSystemFanDegraded’, ’cpqHe3ThermalSystemFanFailed’ ’cpqHe3ThermalTempDegraded’, ’cpqHe3ThermalTempFailed’], [hostname, [’status’, equals, ’OPEN’]], [ clears(’cpqHe3ThermalSystemFanOK’, [ ], [’cpqHe3ThermalSystemFanDegraded], [ ]), clears(’cpqHe3ThermalTempOK’, [ ], [’cpqHe3ThermalTempDegraded], [ ]), clears(’cpqHe3ThermalConfirmation’, [ ], [’cpqHe3ThermalTempFailed], [ ]) ] ), create_event_sequence( [’cpqHe3ThermalCpuFanFailed’, ’cpqHe3ThermalTempDegraded’], [hostname, [’status’, equals, ’OPEN’]], [ clears(’cpqHe3ThermalCpuFanOK’, [ ], [’cpqHe3ThermalSystemFanFailed], [ ]) ] ),

��: ��

� 4 � � �� �� 147

create_threshold ���� �����.

��: create_threshold(threshold_criteria_name, cache_search_criteria_name,

_window, _count, _max_report_frequency)

��: � �� ��� ���� ���� �� ��� ��� ��� �� ��

���. ��� check_threshold �� � �����. ��� �� �� ��

TEC_Start ���� �� ��� ��� ���� ���. �� �� � � �

����.

��:

_count ���� �����. �� ��, ��� 5� 6�� ���� ���� ���

� ���� ����� �� ����.

_max_report_frequency

���� �� �� ��� ���� �� �� �� �� � �� �

�( �)� �����.

_window

���� �� � �� ���� ���� �� �� �� �� ��

�����. �� �� � ��� �� ���� �� ���

���. �� �� �� ���� �� � ��� �� �����. ��

��, 600(10)� �� �� �� ���� 5 � �� 5 �� ���

� �� ���� ���� ���� �� ���� �� ����.

cache_search_criteria_name

��� �� ��� �� � �� ���� ��� ��. � ��

create_cache_search_cri ter ia �� ������� . � ��

create_threshold � �� ��� ���� ���.

threshold_criteria_name

��� �� �� ��� ��. � ��� check_threshold ���� �

����.

�: �� ����� �� ��� �� ���� �� �����. � ���

��� ����.

v ��� �� ��� db_critical_threshold���.

v create_cache_search_criteria �� �� ��� ��� �� � �� ���

db_critical_search���.

v ���� �� �� �� �� ���� ���� 600���.

v ���� �� � ��� ���� � � ��� ����.

v ���� ����� �� ���� �� 300 � ��� ���.

148 IBM Tivoli Enterprise Console: � �� ���

create_threshold(’db_critical_threshold’, ’db_critical_search’, 600, 3, 300)

��: check_threshold, create_cache_search_criteria

� 4 � � �� �� 149

decrement_slot ��� �� ��� ����� �� ���.

��: decrement_slot(_event, _attribute_name, _by_value, _trigger)

��: � �� ��� �� ��� ����� �� ���.

�: ����� �� �� �� ��� ���� ����� ���� �� ����

�������.

��:

_attribute_name

�� ��

_by_value

� �

_event �� ����� �

_trigger

� �� ��� ���� �� �� ��� ��� ��� �����. �

�� ‘YES’, yes, ‘NO’ �� no���.

�: �� ����� � ���� �����.

decrement_slot(_event,host_down,1,no)

��: increment_slot

150 IBM Tivoli Enterprise Console: � �� ���

drop_change_request �� �� ��� �� �� ��� ���� �� ����.

��: drop_change_request

��: � �� �� �� ��� �� �� ��� ���� �� ����.

��: ��

�: �� ����� ���� ��� ACK �� CLOSED� ���� ��� �

�, ���� ��� Root-myHost-region� ���� �� ��� ���� ���

� msg ��� � ���� ���� �� �����. �� ��� ��� �� �

� ��� �� �� ���� ��� ����.

change_rule: deny_state_change_of_TTs:( event: _event of_class _class, sender: _sender equals operator(_x), slot: status set_to _new_status within [’ACK’, ’CLOSED’], action: ( _sender \== operator(’Root_myHost-region’), bo_set_slotval(_event,’msg’,’modification denied !’), drop_change_request ) ).

��: ��

� 4 � � �� �� 151

drop_received_event �� ��� �� ���� ����.

��: drop_received_event

��: � �� �� ���� �� �� �� ���� ���� ��

�.

��: ��

�: �� �� ���� ��� � NFS_NOT_RESPONDING ���� �� �

� �� ���� ��� ������� ���� ��� ���� �� ����

�. ��� repeat_count ���� ��� ��� �� ��� ��� �����.

rule: dup_nfs_not_resp:( event: _event of_class ’NFS_NOT_RESPONDING’, action: dup_and_drop_event:( first_duplicate(_event,event: _dup_nfs_ev where [status: outside [’CLOSED’] ] ), add_to_repeat_count (_dup_nfs_ev, 1), drop_received_event ) ).

��: ��

152 IBM Tivoli Enterprise Console: � �� ���

erase_globals �� ������ ��� �� �� �� ��� ��� ����.

��: erase_globals(_group)

��: � �� ��� �� �� �� ��� ��� �� ������ ���

�.

��:

_group

��� � �� �

�: �� ��� Maintenance ��� �� ��� ��� �� ������ ��

��.

erase_globals(’Maintenance’)

��: ��

� 4 � � �� �� 153

exec_program ���� �����.

��: exec_program(_event, file_name, _format_string, _arg_list, watch_status)

��: � �� ���� �����. ���� �� ��� ���� � ��

�.

�: exec_program� �� Null �� � �� ��� � ��� ��� ���

��� � ���. �� exec_program�� ��� �� ��� ����

���� �����.

��:

_arg_list

[1, 2, 3] ���� ���� �� �(�� ���� ��)� ��. trigger

���� �� ��� �� �� ��� ��� ���� �� ����.

�� ��, msg �� �� $msg �� ����� �� � ���. ���

� ��� ��� �� �� �� ��� �� �� ��� IBM Tivoli

Enterprise Console �� � ��� ���� ������.

�� � �� �� �� ��� ���� � ��� ���� ���

� ���. �� � � ��� ��� � ��� ���� �� �� �

� ���. �� � � �� ��� ���, � ��� []� �� �

��� � ���� ���. ���� ���� ��� 256� �����.

_event ���� ��� ���� ����� �. � ���� �� ��� �

� ���� ���� �� ����. ��� � ��� ��� �� �

� �� ��� �� �� ��� IBM Tivoli Enterprise Console �� �

��� ���� ������.

_format_string

��� �� � ���� �� �� � . %s (STRING), %d (INTEGER)

� %ld (INT32) �� ��� � ���� ���� �� � �����

�� � � ��� � ���.

file_name

�� ���� �� � �� ��. �� ��� $BINDIR/TME/TEC �

����� ��� � ���.

watch_status

��� ��� ���� ��� ��� �����. watch_status ��

‘YES’ �� ‘NO’� � ���. � �� ������ �� ���.

‘YES’ ��, �� �� ��� ��� � ��� � � � ���.

�: �� ����� � ��� �����.

154 IBM Tivoli Enterprise Console: � �� ���

exec_program(_event, % Pass in the event pointer for access to % its environment variables. ’scripts/send_notice’, % Program path/name. ’-m "%s" -s %s’, % Format string. [_msg, _severity], % Argument list. ’YES’) % Watch status. )

_format_string �� %s �� ��� ���� msg � severity ��� ���

��. send_notice ���� �� ���� �� � �� ��� �� � ���

��.

send_notice -m "Su to root failed for Joe" -s CRITICAL

msg ��� �� send_notice ��� �� � �� ����� �� �� ��

� �� ����� ��� ������.

��: exec_program_local, exec_task, exec_task_local

� 4 � � �� �� 155

exec_program_local ���� �� ��� ���� �����.

��: exec_program_local(_name, _event, file_name, format_string, _arg_list,

watch_status)

��: � �� ���� �� ��� ��� �� �����. (���� � �

�� ���� � ��� ����.) watch_status �� ’YES’� ���� �

� ���� ��� �, TASK_COMPLETE ���� ����. � ���� �

�� ��� �� ����� ���. TASK_COMPLETE ��� ����

tec.baroc ��� ���� ���. ��� �� ��� ��� ����.

command

���� �� ��� ��

end_time

���� ��� ��

execution_msg

��� �. � ���� � � ��� �� ��, � � � �

�� �� �������� � �� �����. � ��� 512��

� ���� ���.

exit_status

���� �� ��� �� ���� �� ��

start_time

���� ��� ��

task_name

���� ��� ��. ��� �� _name �� �������.

task_number

��� ��� �� ID. � ID� 1�� ���� ���� ��� ���

�� 1� �����.

task_status

���� �� �� ��

trigger_event_id

exec_program_local �� ��� ��� ���� ID

� �� �� � � � �� �� �����. �� �� ���� ���

��. �� �� ���� ��� � ��� ��� ��� �� �� ���

� � ���.

��:

156 IBM Tivoli Enterprise Console: � �� ���

_arg_list

[1, 2, 3] ���� ���� �� �(�� ���� ��)� ��. trigger

���� �� ��� �� �� ��� ��� ���� �� ����.

�� ��, msg �� �� $msg �� ����� �� � ���. ���

� ��� ��� �� �� �� ��� �� �� ��� IBM Tivoli

Enterprise Console �� � ��� ���� ������.

�� � �� �� �� ��� ���� � ��� ���� ���

� ���. �� � � ��� ��� � ��� ���� �� ���

� ���. �� � � % �� ��� ��� � ��� []� ��

���� � ���� ���. ���� ���� ��� 256� ����

�.

_event ���� ��� ���� ����� �. ���� �� ��� ��

���� ���� �� ����. ��� � ��� ��� �� �

� �� ��� �� �� ��� Tivoli Management Framework ����

������.

_format_string

��� �� � ���� �� �� � . %s (STRING), %d (INTEGER)

� %ld (INT32) �� ��� � ���� ���� �� � �����

�� � � ��� � ���. �� � � ���� ���,

_format_string �� ’’( �� �����) ���� ��� ���. 154

���� �exec_program� ����� �� � ��� �����.

_name

���� �� ��. ���� TASK_COMPLETE ����� ���

� � �����.

file_name

�� ���� �� � �� ��. �� ��� $BINDIR/TME/TEC �

����� ��� � ���.

watch_status

TASK_COMPLETE ���� ��� ��� �����. ��� ���

����.

‘NO’ ���� ��� � TASK_COMPLETE ���� ��� ���

�. � �� ������ �� ���.

‘YES’ ���� ��� � TASK_COMPLETE ���� ����. �

�� ������ �� ���.

�: �� ����� �� ��� �����.

1. program_start ���, ls(list) ���� TEC_DB ���� ��� � ����

�. ���� �� ���� �����.

� 4 � � �� �� 157

v ���� list_tmpdir��� ��� �����.

v ���� ���� �� �� �� ����.

v ���� ��� � TASK_COMPLETE ���� ����.

2. program_result �� �� ��� �� ���� �� list_tmpdir�� ��

� task_name ��� TASK_COMPLETE ���� ��� �� �����.

3. program_result �� process_program_result ��� ��� �����.

a. TASK_COMPLETE ������ execution_msg ��� �� �� _results

��� �� �����. � ��� � �����.

b. _results� OK � ��� �� ����.

c. �� OK ��� ���� ok �� �����. ���� ���, not_ok

�� �����.

rule: program_start: ( event: _event of_class ’TEC_DB’ where [ ], reception_action: start_it: ( exec_program_local(’lst_tmpdir’,_event,’ls /tmp’, ’’,[ ],’YES’) ) ). rule: program_result: ( event: _event of_class ’TASK_COMPLETE’ where [task_name: _task_name equals ’lst_tmpdir’, % Test for program name. If passed, assign % value to variable. task_number: _task_num % Assign task_number attribute value to % variable. ], reception_action: process_program_result: ( bo_get_slotval(_event,execution_msg,_results), % Get value of execution_msg attribute and assign to % variable. Attribute is a list type. member(_result_line,_results), (_result_line == ’OK’ -> % Test each element for OK value. ok % OK value found in list. Run ok predicate. ; % Else. do_not_ok_thing

158 IBM Tivoli Enterprise Console: � �� ���

% OK value not found in list. Run not_ok % predicate.) ) ).

��: exec_program, exec_task, exec_task_local

� 4 � � �� �� 159

exec_task ���� ��� �������� �����.

��: exec_task(_event, task_name, format_string, _arg_list, watch_status)

��: � �� ���� ��� �������� �����. ���� �� ��

� ���� � ���. Tivoli Enterprise Console ���� ���� ���� IBM

Tivoli Enterprise Console �� � ��� ����� �����.

�: exec_task� �� Null �� � �� ��� � ��� ��� ��� ��

� � ���. ��, exec_task� ��� �� ��� �������� �

����.

��:

_arg_list

[1, 2, 3] ���� ���� �� �(�� ���� ��)� ��. trigger

���� �� ��� �� �� ��� ��� ���� �� ����.

�� ��, msg �� �� $msg �� ����� �� � ���. ���

� ��� ��� �� �� �� ��� �� �� ��� IBM Tivoli

Enterprise Console �� � ��� ���� ������.

�� � �� �� �� ��� ���� � ��� ���� ���

� ���. �� � � ��� ��� � ��� ���� �� ���

� ���. �� � � �� ��� ��� � ��� []� �� �

��� � ���� ���. ���� ���� ��� 256� �����.

_event ���� ��� ���� ����� �. � ���� �� ��� �

� ���� ���� �� ����. ��� � ��� ��� �� �

� �� ��� �� �� ��� Tivoli Management Framework ���

� ������.

_format_string

���� �� � ���� �� �� � . %s (STRING), %d

(INTEGER) � %ld (INT32) �� ��� � ���� ���� ��

� ����� �� � � ��� � ���. �� � � ��� ��

���� ��, ���� ��� ��� �� ��� �� ���� ����

�� ��� �� ���.

-l tasklibname -h hostname -a arg1 -a arg2...

154 ���� �exec_program� ����� �� � ��� �����.

160 IBM Tivoli Enterprise Console: � �� ���

�:

1. �� � � -l, -h � -a �� Tivoli Management Framework

wruntask ��� ��� �� ���� . �� ��� Tivoli

Management Framework ���� ������.

2. ��� ��(-t TaskName) � -E wruntask �� �� exec_task �

� �� ����� �����.

task_name

�� ���� ��� �����.

watch_status

��� ��� ���� ��� ��� �����. watch_status ��

‘YES’ �� ‘NO’� � ���. � �� ������ �� ���.

‘YES’ ��, �� �� ��� ��� � ��� � � � ���.

�:

1. �� ����� T/EC ��� ������ Send_Email ���� ��� stumpy

�� ���� �� �����. � �, ��� �� ��� ��� ��

� ��� ��� � �� ��� ���� �����. ��� ��� ���

�� ����. wruntask �� ����� �� �� ���� ��� ���

� �� �����.

exec_task(_event, ’Send_Email’, ’-l "T/EC Tasks" -h "stumpy" -a "%s" -a "%s"’, [’[email protected]’, ’[email protected]’], ’NO’)

wruntask -t Send_Email -l "T/EC Tasks" -h "stumpy" -E -a "joe@company" -a "joe@company"

2. �� ����� MS SQL ������� ����� ���� ������

� Tivoli Distributed Monitoring���� ��� ���� ���� ����

���� �� �����. �� �� ��� �� CRITICAL ���

MSSQLDatabase_LogSpacePercentUsedDB� ������. collection �� ��

����� � ��� ���. � �� � ��� ��� exec_task �

� ���� �� ��� �������.

rule: plain_rule1_42: ( description:’ADSM incremental backup task’, event: _ev1 of_class within [ ’MSSQLDatabase_LogSpacePercentUsedDB’] where [severity: _ev1_severity collection: _ev1_collection, hostname: _ev1_hostname ] , reception_action: action0:( (exec_task(_ev1,

� 4 � � �� �� 161

’ADSMIncBackup’, ’-l MSSQLManagerTasks -h \’@%s:%s\’’, [_ev1_collection,_ev1_hostname], ’YES’ ) ) ) ).

exec_task �� ���� MSSQLDatabase ��� �� ���

master@holon@holon�� ��� � �� ��� ����.

wruntask -t ADSMIncBackup -l MSSQLManagerTasks \ -h @MSSQLDatabase:master@holon@holon -E

��: exec_program, exec_program_local, exec_task_local

162 IBM Tivoli Enterprise Console: � �� ���

exec_task_local ���� �� ��� ��� ��� �������� �����.

��: exec_task_local(_name, _event, file_name, format_string, _arg_list,

watch_status)

��: � �� ���� ��� �������� �� ��� �� �����.

(���� � ��� ���� � ��� ��� ����.) Tivoli Enterprise

Console ���� ���� ���� IBM Tivoli Enterprise Console �� � ��

� ����� �����.

�: � �� �� ���� ��� � ���.

watch_status �� ‘YES’� ���� �� ���� ��� �,

TASK_COMPLETE ���� ����. � ���� ��� ��� �� ����

� ���. TASK_COMPLETE ��� ���� root.baroc ��� ����

���. ��� �� ��� ��� ����.

command

���� �� ��� ��

end_time

���� ��� ��

execution_msg

������� �. � ���� � � ��� �� ��, � �

� ��� �� �������� � �� �����. � ��� 512

��� ���� ���.

exit_status

���� �� ��� �� ���� �� ��

start_time

���� ��� ��

task_name

���� ��� ��. ��� �� _name �� �������.

task_number

��� ��� �� ID. � ID� 1�� ���� ���� ��� ��� �

� 1� �����.

task_status

���� �� �� ��. � �� RUNNING, SUCCESS, FAILURE �

UNKNOWN�� root.baroc ��� �����.

trigger_event_id

exec_task_local �� ��� ��� ���� ID.

� 4 � � �� �� 163

� �� �� � � � �� �� �����. �� �� ���� ����

�. �� �� ���� ��� � ��� ��� ��� �� �� ��� �

� ���.

��:

_arg_list

[1, 2, 3] ���� ���� �� �(�� ���� ��)� ��. trigger

���� �� ��� �� �� ��� ��� ���� �� ����.

�� ��, msg �� �� $msg �� ����� �� � ���. ���

� ��� ��� �� �� �� ��� �� �� ��� IBM Tivoli

Enterprise Console �� � ��� ���� ������.

�� � �� �� �� ��� ���� � ��� ���� ���

� ���. �� � � ��� ��� � ��� ���� �� ���

� ���. �� � � �� ��� ��� � ��� []� �� �

��� � ���� ���. ���� ���� ��� 256� �����.

_event ���� ��� ���� ����� �. � ���� �� ��� �

� ���� ���� �� ����. ��� � ��� ��� �� �

� �� ��� �� �� ��� Tivoli Management Framework ����

������.

_format_string

��� �� � ���� �� �� � . %s (STRING), %d (INTEGER)

� %ld (INT32) �� ��� � ���� ���� �� � �����

�� � � ��� � ���. �� � � ���� ���,

_format_string �� ’’( �� �����) ���� ��� ���. �

� � � ��� ������ ��, ���� ��� ��� ��, ���

�� ���� ���� �� ��� �� ���.

-l tasklibname -h hostname -a arg1 -a arg2...

154 ���� �exec_program� ����� �� � � ��� ����

�.

�:

1. �� � � -l, -h � -a �� Tivoli Management Framework

wruntask ��� ��� �� ���� . �� ��� Tivoli

Management Framework ���� ������.

2. ��� ��(-t TaskName) � -E wruntask �� �� exec_task_local

�� �� ����� �����.

_name ���� �� ��. ���� TASK_COMPLETE ����� ���� �

�����.

164 IBM Tivoli Enterprise Console: � �� ���

file_name

�� ���� �� � �� ��. �� ��� $BINDIR/TME/TEC �

����� ��� � ���.

watch_status

TASK_COMPLETE ���� ��� ��� �����. ��� ���

����.

‘NO’ ���� ��� � TASK_COMPLETE ���� ��� ����.

� �� ������ �� ���.

‘YES’ ���� ��� � TASK_COMPLETE ���� ����. �

�� ������ �� ���.

�: �� ����� �� ��� �����.

1. task_start ���, send_dbadmin ���� TEC_DB ���� ��� � ���

��. ���� �� ���� �����.

v ���� send_dbadmin��� ��� �����.

v ��� ���� �� �� �� ���.

v ���� ��� � TASK_COMPLETE ���� ����.

2. task_result �� �� ��� ��� ���� �� send_dbadmin�� ���

task_name ��� TASK_COMPLETE ���� ��� �� �����.

3. task_result �� process_task_result ��� ��� �����.

a. TASK_COMPLETE ������ execution_msg ��� �� �� _results

��� �� �����. � ��� � �����.

b. _results� OK � ��� �� ����.

c. �� OK ��� ���� ok �� �����. ���� ���, not_ok

�� �����.

rule: task_start: ( event: _event of_class ’TEC_DB’ where [ ], reception_action: start_it: ( exec_task_local( ’send_dbadmin, _event, ’Send_Email’, ’-l "T/EC Tasks" -h "stumpy" -a "%s" -a "%s"’, [’[email protected]’,’[email protected]’], ’YES’ ) ) ).

� 4 � � �� �� 165

rule: task_result: ( event: _event of_class ’TASK_COMPLETE’ where [task_name: _task_name equals ’send_dbadmin’, % Test task name. Assign task_name value to % variable if passed. task_number: _task_num % Assign task_number attribute value to % variable. ], reception_action: process_task_result: ( bo_get_slotval(_event,execution_msg,_results), % Get value of execution_msg attribute and assign to % variable. Attribute is a list type. member(_result_line,_results), (_result_line == ’OK’ -> % Test each element for OK value. ok % OK value found in list. Run ok predicate. ; % Else. do_not_ok_thing % OK value not found in list. Run not_ok % predicate.) ) ).

��: exec_program, exec_program_local, exec_task

166 IBM Tivoli Enterprise Console: � �� ���

first_causal_event � ���� ��� � ���� �� ��� ��� ����.

�: ����� � ��� ���� ����� ��� ����� ��� � ���

� �����.

��: first_causal_event(_effect_event, _cause_event)

--��--

first_causal_event(_effect_event, _cause_event, time_before, time_after)

��: � �� create_event_sequence �� �� ��� ��� ���� �

���� �� ��� ��� ���� �����. ����

create_event_sequence �� ��� ��� ��� ���. �� ��, ��� A,

B, C � D� � ���� ��� ��� ����� ��� D� ��, �

�� A� ���� ��� �� ��� ��� A� �� ���� ����, ��

� B� ���� ��� B�, ��� C� ���� �� ����, ��� �� ��

�� �����.

time_before � time_after �� ���� ���� ��� �� � �� �� 2

(��� 1 ��� 1 )�� � �� �����. � �� �� �� � �

�� �� �� ��� �� ��� ��� ���.

��:

_cause_event

� ���� �� ��� � ����� �. � �� � ��

� ���.

_effect_event

� ���� � � ���� �� �. � ���

���.

time_after

� ���� ��� �� �. � �� ��� �� �� �� ���

���� � �����.

time_before

� ���� ���� �� �. � �� ��� �� �� �� ��

� ���� � �����.

�: �� ��� ��� ��� ��� � ���� �� ��� ��� ���

�. ��� ��� ���� � ���� ����� � ���� �����. �

�� ������� ���� � ���� �� ����. � ��� ���

� �� ���� �� � � � �� ���� ����.

� 4 � � �� �� 167

rule: ’link_effect_to_cause’:( event: _effect of_class ’EVENT’, action: ’search_for_cause’:( first_causal_event(_effect, _cause, 3600, 0), set_event_status(_effect, ’ACK’), link_effect_to_cause(_effect, _cause) ) ).

��: create_event_sequence, first_effect_event, first_related_event

168 IBM Tivoli Enterprise Console: � �� ���

first_duplicate ��� �� �� � �� � ��� ��� ��� ���� ��(�� �)

� ���� �� � � �����.

��: first_duplicate(_event, event: _duplicate where attribute_conditions)

--��--

first_duplicate(_event, event:_duplicate where attribute_conditions, _referenceEvent

-time_before -time_after)

��: � ���� �� �� ������ ��� ��� ���� ����.

� ���� �� �� ��� 83 ���� �� ����� ������.

-time_before � -time_after �� ���� ���� ��� �� � �� �� 2

(1 ��, 1 ��)�� � �� �����. � �� �� �� � ���

�� �� ��� �� ��� ��� ���.

��:

_event � ����� �

_referenceEvent

� ��� �� �� �� �� ����� �

event:_duplicate where attribute_conditions

��� �� ��� �� ��� ��� �����. _duplicate� ��� �

�� � ����� �� �������. �� ��� 70 ���� ��

�� ���� ������.

-time_after

�� ��� �� �

-time_before

�� ��� �� �

�: �� �� ���� ��� � NFS_NOT_RESPONDING ���� �� �

� �� ���� ��� ������� ���� ��� ���� �� ����

�. ��� repeat_count ���� ��� ���� �� ��� ��� �����.

� ��� �� �� ���� ��� 2 �(1 ��, 1 ��)�� � �� ��

� �� ������. � �� �� �� � ��� �� �� ��� �� �

�� ��� ���.

rule: dup_nfs_not_resp:( event: _event of_class ’NFS_NOT_RESPONDING’, action: dup_and_drop_event:(

� 4 � � �� �� 169

first_duplicate(_event,event: _dup_nfs_ev where [status: outside [’CLOSED’] ] ), add_to_repeat_count (_dup_nfs_ev, 1), drop_received_event ) ).

��: all_duplicates

170 IBM Tivoli Enterprise Console: � �� ���

first_effect_event � ���� ��� ��� ����� �� �� � ���� �� ��� ��

� ����.

��: first_effect_event(_cause_event, _effect_event)

--��--

first_effect_event(_cause_event, _effect_event, time_before, time_after)

��: � �� create_event_sequence �� �� ��� ��� ���� � �

��� ��� � ���� �� ��� ��� ��� � �����.

time_before � time_after �� ���� ���, ��� �� � �� �� �

� 2 (1 ��, 1 ��)�� �����. � �� �� �� ���� ���

� �� �� ��� �� ��� ��� ���.

��:

_cause_event

� ���� � � ���� �� �. � ���

���.

_effect_event

� ���� �� ��� � ���� �� �. � �� � ���

���.

time_after

� ���� ��� �� �. � �� ��� �� �� �� ���

���� � �����.

time_before

� ���� ���� �� �. � �� ��� �� �� �� ��

� ���� � �����.

�: �� ��� ��� ��� ��� � ���� �� ��� ��� ���

�. ��� ��� ���� � ���� ����� ��� � ���� ���

��. � �� ������� ���� ��� � ���� �� ����. �

��� ��� � �� ���� �� � � � �� ���� ����.

rule: ’link_cause_to_effect’:( event: _cause of_class ’EVENT’, action: ’search_for_effect’:( first_effect_event(_cause, _effect, 3600, 0),

� 4 � � �� �� 171

set_event_status(_effect, ’ACK’), link_effect_to_cause(_effect, _cause) ) ).

��: create_event_sequence, first_causal_event, first_related_event

172 IBM Tivoli Enterprise Console: � �� ���

first_instance ��� ���, �� � �� � ��� ��� ��� ���� ��(�� �)

���� �� � � �����.

��: first_instance(event: _event of_class class where attribute_conditions)

--��--

first_instance(event: _event of_class class where attribute_conditions,

_referenceEvent -time_before -time_after)

��: ��� ���, �� � �� � ��� ��� �� ���� �� � �

�����.

��:

_referenceEvent

� ��� �� �� �� �� ����� �

event:_event of_class class where attribute_conditions

��� ��� �����. �� ��� 70 ���� ���� ���� ���

���.

-time_after

�� ��� �� �.

-time_before

�� ��� �� �.

�: �� ����� �� ��� ���� �� �����.

1. �� �� ��� � universal_host event� �� ���� �� ��� �

�� �����.

v ��� CLOSED� ����.

v ���� ���� �� ���� �� probe_arg ��� NFS_No_Response

��� ���� �� server ��� �� �� ����.

v ��� ���� CRITICAL���.

v �� �� �� �� ���� ��� 20���.

2. ��� ��� �� ���� ��� ���� ���� ���� FATAL� ��

���.

rule: escalate: ( description: ’escalate host down events when causing NFS problems’, event: _event of_class ’NFS_No_Response’ where [ server: _server],

� 4 � � �� �� 173

action: ’increase_sev’: ( first_instance(event: _down_ev of_class ’universal_host’ where [status: outside [’CLOSED’], probe_arg: equals _server, severity: equals ’CRITICAL’], _event - 600 - 600 ), set_event_severity(_down_ev, ’FATAL’) ) ).

��: any_clear_target

174 IBM Tivoli Enterprise Console: � �� ���

first_related_event �� ���� ��� ����� �� �� ���� �� ��� ��� ����.

��: first_related_event(_referenceEvent, _related_event, _relation)

--��--

first_related_event(_referenceEvent, _related_event, _relation, time_before, time_after)

��: � �� �� ���� ��� ����� �� �� � �� � ���

� �� ��� ��� ����. ����� �� �� ���� ��� ����

���� ����� ��� �� �� ������ ���� ����� �� �� �

��� ����. ��� ���� � ����� _relation �� c ��� �

������. ��� ���� � ����� _relation �� e ��� ���

����. �� ��, ��� A, B, C � D� create_event_sequence �� �� �

��� ��� ��� ����� first_related_event �� �� ����� ���

C� ���� �����, ��� A� �� �� � �� c ��� ��

��� _relation �� ����, ��� �� ��� B� � �� c� ���

_relation�� ����, ��� D� � �� e� ��� _relation�� ����, �

�� �� �� �� �����.

� �� ��� ���� � ���� �� � ��� �� ���, ��� �

���� ���� �� �� � ���� �� � ���� ���. � �� �

�� �� ����� � ���� first_effect_event � �� ��

first_causal_event �� ���� ��� �����.

time_before � time_after �� ���� ���, ��� �� � �� �� �

� 2 (1 ��, 1 ��)�� �����. � �� �� �� ���� ���

� �� �� ��� �� ��� ��� ���.

��:

_referenceEvent

����� �� �� ��� ���� ��� � �� ����� �

_related_event

�� ���� �� ��� ����� �� �� ����� �. � �

� � ��� ���.

_relation

�� ���� �� ��� ���� ��. � �� � ��� ���. �

�� ��� ����.

c �� ���� �� � ���

e �� ����� �� � ���

� 4 � � �� �� 175

time_after

�� ���� ��� �� �. � �� ��� �� �� �� ���

���� � �����.

time_before

�� ���� ���� �� �. � �� ��� �� �� �� ��

� ���� � �����.

�: �� ��� ���� ��� ����� �� �� ���� �� �

�� ��� ����. ��� ��� ���� ��� ���� ����� ��

���� relation �� ��� �� �� � ��� �� � ���� ����

�. � �� ������� ���� ��� ���� �� ����. � ���

��� � �� ���� �� � � � �� ���� ����.

rule: ’link_effect_to_cause’:( event: _ev of_class ’EVENT’, action: ’search_for_cause_or_effect’:( first_related_event(_ev, _related,_relation, 3600,0), ( _relation == ’c’, set_event_status(_ev, ’ACK’), link_effect_to_cause(_ev, _related) ; set_event_status(_related, ’ACK’), link_effect_to_cause(_related, _ev) ) ) ).

��: create_event_sequence, first_causal_event, first_effect_event

176 IBM Tivoli Enterprise Console: � �� ���

forward_event ���� ��� ��� �����.

��: forward_event(_event)

��: � �� ���� ��� ��� �����.

� �� tec_forward.conf ��(rule_base_dir/TEC_RULES ���� �)�� �

�� ��� ��� ����. tec_forward.conf ��� ���� ���� ���� �

� ��� ��� ���� ServerLocation ��� �� �� ��� ���.

�: forward_event �� Tivoli ��� ����� Tivoli region �� ���

�� ��� ���� ��� ��� IP �� �� TCP/IP ��� ���� ��

� ���.

tec_forward.conf ���� TestMode ��� �� � ��� yes���. ��� �

��� ��� ���� ����. ���� ��� ��� ��� ���� ���

� TestMode ��� tec_forward.conf ���� ���� ��� ��� ��

�.

��:

_event � ��� �� ����� �

�: �� ��� ���� CRITICAL �� FATAL ���� tec_forward.conf

��� ��� ��� ��� �����.

rule: escalate: ( event: _evt of_class within [ ’EVENT’ ] where [severity: within [’CRITICAL’, ’FATAL’], reception_action: action0:( forward_event(_evt) ) ).

��: ��

� 4 � � �� �� 177

generate_event �� ���� ����.

��: generate_event(event_class, list_of_event_attributes)

��: � �� ���� ����� ��(�: ��� ���)��� �����

��� ��, ��� �� ��� ����.

��:

event_class

�� ���� �� ��� ���

list_of_event_attributes

�� ���� �� ��. ��� �� ��� ���� ��� ����

���.

[attribute1=value1, attribute2=value2,...]

�: �� ��� � �� ���� TradingDBDown ���� ���� ����.

action: ( generate_event(’TradingDBDown’, [source=’SNMP’, origin=_origin, hostname=_host, msg=’Trading DB host is down’] ) )

��: ��

178 IBM Tivoli Enterprise Console: � �� ���

get_attributes ��� �� �� ����.

��: get_attributes(_event, [ attribute_name=_attribute_value, ...] )

��: � �� ��� ��� �� ��� �� ��� ��� �������.

�� �� �� ���� �� ���.

��:

_attribute_value

�� ��� ���� ��

_event �� �� ��� ���. � ������.

attribute_name

�� � ��� ��

�: �� ��� ������ hostname, severity � status �� ��

��� �� �� _hostname, _severity � _status ��� �������.

get_attributes(_event,[hostname=_hostname, severity=_severity, status=_status ] )

��: ��

� 4 � � �� �� 179

get_config_param � �� �� ��� ����.

��: get_config_param(_name, _variable, default)

��: � �� $BINDIR/TME/TEC/.tec_config ��� ��� � �� �� ��

�� �� ��� �����.

_name �� ��� ���� ���, default �� _variable �� ����

�.

��:

_name �� ��� ��

_variable

�� ��� ��� �� ��

default

_name� �� ����� ��� ���� �� �� _variable� �� �

�: �� ��� _tec_rule_host ��� chair� �����. tec_rule_host ��� �

�� ���� ����, ��� not set ��� ����� ����. �� .tec_config

�� ��� �� �����.

#.tec_config settings #tec_rule_cache_size=10000 #tec_rule_cache_full_history=86400 #tec_rule_cache_non_closed_history=155520 #tec_rule_cache_clean_freq=3600 tec_rule_trace=YES tec_rule_trace_file=/tmp/rules.trace tec_rule_host=chair tec_server_handle=5

get_config_param(tec_rule_host,_tec_rule_host,’not set’)

��: ��

180 IBM Tivoli Enterprise Console: � �� ���

get_global_grp ��� ��� �� ��� ��� �� ����.

��: get_global_grp(_group,_key,_value)

��: � �� ��� ��� �� ��� ��� �� �� ������ ���

�. � �� ���� ��� � ���� ��� ��� ��� �� _value�

�������. _value � _key� � ��� ���.

��:

_group

��� �� �� �

_key ��� �� �. � ��� ���.

_value �� �. � ��� ���.

�: �� ��� Maintenance ��� �� �� ��� ��� ����.

get_global_grp(’Maintenance’, _key, _value),

��: get_globals, get_global_var

� 4 � � �� �� 181

get_global_var ��� ��� �� ����.

��: get_global_var(_group, _key,_value,_default)

��: � �� �� ������ ��� ��� ��� �� �� �� _value�

�����. ��� �� ��� _default� ���� _default� _value� �

�����. _value� � ��� ���.

��:

_default

� �� �� ��� �� �

_group

��� �� �� �

_key ��� �� �

_value �� �. � ��� ���.

�: �� �� �� ��� �� ����.

1. �� �� Maintenance ��� ��� �� �� ���� origin �

�� �� �� � �� ����. �� �� �� �� ���, �� off� ��

���.

2. ���� ���� ��� �� �� ��� ��� ��� � � �����.

3. � � ���, ���� ���� � ��� �����.

rule: check_maint_mode: ( event: _event of_class _event_class where [ origin: _origin ], reception_action: ( get_global_var(’Maintenance’, _origin, _maint_mode, ’off’), _maint_mode == ’on’, drop_received_event, commit_rule ) ).

��: get_globals, get_global_grp

182 IBM Tivoli Enterprise Console: � �� ���

get_globals �� ��� ��� ����.

��: get_globals(_group, _key,_value)

��: � �� �� �, � � ��� ��� ��� �� �� �����. �

�� � ��� ���. � �� ��� ��� � ���� ��� ��� ��

� ��� �� � �� �� �������.

��:

_group

�� �

_key �

_value �� �

�: �� ����� � ���� �����.

get_globals(_group,_key,_value)

��: get_global_grp, get_global_var

� 4 � � �� �� 183

get_gm_time ���� ��(GMT)� � � � ��� ����.

��: get_gm_time(_time_gm_struct)

��: � �� GMT� � � � ��� ����. _time_gm_struct� � ��

� ���.

��:

_time_gm_struct

�� ��� GMT ���� �����. ��� _time_epoch �� �� �

� �� �� �� ���� � get_time �� �� ��� ���

� ��� ����.

�: �� ����� � ��� GMT� �� �� ��� � � ���� ��

�� time_string ��� � � ���� �� �����.

get_gm_time(_time_gm_struct), convert_ascii_time(_time_gm_struct, _time_string), bo_set_slotval(_event, time_string, _time_string)

��: bo_set_slotval, convert_ascii_time, get_time, resolve_time

184 IBM Tivoli Enterprise Console: � �� ���

get_local_time � �� �� ��� ����.

��: get_local_time(_time_local_struct)

��: � �� � �� �� ��� ����. _time_local_struct� � ���

���.

��:

_time_local_struct

�� ��� �� ��� �����. ��� _time_epoch �� �� �

� �� �� �� ���� � get_time �� �� ��� ���

� ��� ����.

�: �� ����� � �� �� ��� �� ��� �� �� ��� �

� ���� ���� time_string ��� � � ���� �� �����.

get_local_time(_time_local_struct), convert_ascii_time(_time_local_struct, _time_string), bo_set_slotval(_event, time_string, _time_string)

��: bo_set_slotval, convert_ascii_time, get_time, resolve_time

� 4 � � �� �� 185

get_time ��� ���� 1970 1� 1� 00:00:00 ���� ��(GMT) �� ��

� ��� � � � ��� ����.

��: get_time(_time_epoch)

��: � �� ��� � � �� ��� � ��� ����. _time_epoch�

� ��� ���.

��:

_time_epoch

�� �� �� �����. ��� _time_local_struct �� �� �� ��

��� �� ���� � get_local_time �� �� ��� ����

��� ����.

�: �� ����� �� �� �� �� ���� time_epoch ��� �� ��

���� �� �����.

get_time(_time_epoch), bo_set_slotval(_event, time_epoch, _time_epoch)

��: bo_set_slotval

186 IBM Tivoli Enterprise Console: � �� ���

global_exists ��� ��� �� ��� � ���.

��: global_exists(_group, _key)

��: � �� � _key� ���� �� � _group�� ��� ��� � ���.

��� ���� �� �����.

��:

_group

� ��� �� �� �

_key � ��� �� �

�: �� ��� �� �� ���� origin ��� ��� Maintenance

��� ��� ��� ��� �� � ���.

global_exists(’Maintenance’,_origin)

��: ��

� 4 � � �� �� 187

increment_slot ��� �� ��� �� �� �����.

��: increment_slot(_event, _attribute_name, _by_value, _trigger)

��: � �� ��� �� ��� �� �� �����.

�: ����� �� �� � �� ��� ���� ����� ���� �� ��

�� �������.

��:

_attribute_name

�� ��

_by_value

�� �

_event �� ����� �

_trigger

� �� ��� ���� �� �� ��� ��� ��� �����. �

�� ‘YES’, yes, ‘NO’ �� no���.

�: �� ����� � ���� �����.

increment_slot(_event,host_down,1,no)

��: decrement_slot

188 IBM Tivoli Enterprise Console: � �� ���

init_count ��� ���� �����.

��: init_count(_key1, _key2, _value)

��: � �� _key1 � _key2 �� �� ���� ��� �����. ���

_value �� ��� �����. �� ��� 0�� �����.

� ��, �� ����� �� ���� �� � ����

check_and_increment_count �� � �����.

�:

1. ��� init_count �� �� � ���� ��� check_and_increment_count

�� ��� � �� �� �� �� � ��� ���� 0�� ��

���.

2. � ���� ��� � �� ��� ����� �� ��� ��� ��

�� ���.

3. ���� ��� ��� �� �� � ��� ����� �� ��� ��

�.

��� �� ��� � �� �� ���� � �����. _key1 � _key2� �

� �� ��� � ����� ��� � ���. �� ��, ��� ���

�.

v ��� ����� �� ���� �� �� �� ���� �� �� ��� �

�� ��� � ��� ���� �� ��� ���� event_class, hostname �

�� ���� ��� � ���(�: perf_alert,orange).

v ����� ���� �� ��� �� �� �� ���� �� �� ��� �

�� ���� � ��� ��� �� ��� ���� failure, component ��

� ���� ��� � ���(�: paper_jam,flr4rm23).

��� ��� ��� �� ��� �����.

��:

_key1 ��� �� 1� � ��. ����� ���.

_key2 ��� �� 2� � ��. ����� ���.

_value ��� ���� �. ����� ���.

�: �� ��� ��� ��� Printer_Jam� ��� �� ���� ���� �

� ��� �� ���. ��� ��� failure,component ��� ���� ����

�. Printer_Jam ���� hostname ���� ��� ���� �����.

� 4 � � �� �� 189

��� ��� �� ���� �� ���� check_and_increment_count �� �

� � ���� 0�� ���� 1� �� �����. ���� �� ��� ��

�� �� ����� �� �� ���� ���.

���� �� �� �� 5� �� � ���� ��� ���� �� ���

init_count �� ���� 0�� ������. �� � � � ����

check_and_increment_count � �� �� ���� �� � ����� Prolog

��� ELSE ��� � ����.

rule: printer_jam: ( event : _ev of_class ’Printer_Jam’ where [hostname: _hn within [’flr4rm23’, ’flr3rm12’, ’flr1rm11’, ’flr6rm9’ ], action: check_count: ( (check_and_increment_count(printer_jam,_hn,5,_count) ; % ELSE clause follows exec_program(_ev,’scripts/notify.sh’, ’Printer failure on %s’, [_hn], no), init_count(paper_jam,_hn,0) ) ) ).

��: check_and_increment_count

190 IBM Tivoli Enterprise Console: � �� ���

init_event_activity ��� � ���� ��� �� �� �� �����.

��: init_event_activity(_file, _event_ exclusions, _attribute_criteria, _threshold)

��: � �� ���� ��� ���� ��� �� ��� �� �����.

��� � ���� ��� ���� ���� �� �� ���. ���� ��

���� ���� ��� ��� �� ����� ��� ��� �� ����� �

� � ���.

� �� ��� �� �� �� TEC_Start ���� �� ��� ��� ���

� ���. ��� �� �� ��� ���� �� � � �����.

��:

_attribute_criteria

�� �� ���� � ��. �� �� ��(�: [source, hostname,

severity])�� ���.

�� ��� � �� �� �� ��� �(nest) ��� � ���. ��

��, [hostname, severity]� ��� ��� � ���. [hostname, severity]

� ��� ����, ��� ���� �� ��� ���� �� ����

�. class ���� ��� ��� ���� �� � ��� ��� � �

��. �� ��, [class, hostname] � ��� ��� ��� ���� �

� ��� ���� �� �����.

_event_exclusions

��� ����� �� ���� ��� ��. � ��(�:

[‘TEC_Heartbeat’, ‘TEC_Maintenance’])� �� �� ���� ���.

_file ���� ��� �� � �� ��

_threshold

�� �� ��� �� ���� ���� �� _attribute_criteria �� �

�:

1. �� ����� �� ���� �� �����.

_rep_freq is 20, init_event_activity( ’/tmp/event_activity’, % Report file [’TEC_Heartbeat’, % Do not report these events ’TEC_Maintenance’ ], [source, % Single attribute reporting

� 4 � � �� �� 191

hostname, severity, status, [hostname,severity], % Multiple attribute reporting [class,hostname] % Class reporting ], 5 % Do not report counts less %than this ),

2. ��� � ���� �� � ��� TEC_Tick ���� �� ���� �

��. �� ����� �� ���� �� �����.

rule: configure_event_activity: ( event: _event of_class ’TEC_Tick’ where [msg: _msg equals ’Event Activity Report’, duration: _reporting_frequency], reception_action: start_timer: ( set_timer(_event,_reporting_frequency,_msg), commit_rule ) ).

3. �� ����� ��� � ���� � �� �����.

192 IBM Tivoli Enterprise Console: � �� ���

��: print_event_activity

Event Activity For Server tkennedy From: Thu Mar 02 14:14:02 2000. To : Thu Mar 02 14:14:18 2000. Reporting Frequency: 0 Minutes. Total Events: 3332 Reporting Threshold: 5 ============================================================= Event Class Summary ============================================================= Count Class Name ------------------------------------------------------------- 849 TEC_Tick 848 TEC_DB 822 TEC_Notice 812 TEC_Error ============================================================= Slot Summary ============================================================= Count Slot Criteria ------------------------------------------------------------- 3332 status=OPEN 590 severity=MINOR 574 severity=WARNING 564 severity=CRITICAL 550 severity=UNKNOWN 544 severity=HARMLESS 510 severity=FATAL 12 hostname=midnight.austin.lab.tivoli.com 12 source=69.1.3.30 11 hostname=dhcp12-235.austin.lab.tivoli.com 11 source=69.1.12.235 11 hostname=stingray.austin.lab.tivoli.com 11 source=69.1.5.82 10 hostname=austin.lab.tivoli.com 10 source=69.1.1.6

� 4 � � �� �� 193

ip_node_unreachable ���� �� � �� ����� ��� ��� �����.

��: ip_node_unreachable(_ipaddress, _event)

��: � �� ��� ��� �� � �� IP ��� ������ ��� ��

� IP ��� �� �� ��� ���� �����. _ipaddress� ��� �

���� ����, ��� ���� ��� ���� ��� ��, _event ��

���� TEC_ITS_SUBNET_STATUS� �� ��� ��� �����.

���, � ���� link_effect_to_cause �� ���� �� ���� ����

TEC_ITS_SUBNET ���� ����� � �� � ���. ��� ��� �

�� �� ground(_event)� ���� _event �� ��� ���� ���� �

������. ���� ��, ��� ��� �����.

� �� ����� NetView ����� ���� � netview.rls � ��� ��

�� ���.

��:

_ipaddress

�� � �� IP ��

_event �� ����, � �� IP ��� ���� ���

TEC_ITS_SUBNET_STATUS ���� ��� ��� ���. ����

�� � ���, �� ���� ����.

194 IBM Tivoli Enterprise Console: � �� ���

is_clearing_event ���� create_clearing_event �� create_event_sequence �� � ��� �

��� ������ ��� ������.

��: is_clearing_event(_event)

��: � �� � �� � ��� ���� ��� ��� ����� � ���

��. ���� create_clearing_event create_event_sequence �� � ��� �

��� ����� ��� �� ��� ��� ���� is_clearing_event �� �

����.

��:

_event ��� ���� ��� ����� �

�: �� �� � ��� ���� ��� ���� ��� �����

�. ���� ��� �� �� �� ���� ��� �����. � �� � �

���� ���� ���� �� �� ���� ������.

rule: ’process_clearing_events’:( event: _ev of_class ’EVENT’, reception_action: ’check_for_clear’:( is_clearing_event(_ev), ...

��: create_clearing_event, create_event_sequence

� 4 � � �� �� 195

link_effect_to_cause � ���� � ���� �����.

��: link_effect_to_cause(_effect_event, _cause_event)

��: � ���� cause_date_reception � cause_event_handle ��� �� �

� ��� � ���� �� ��� ��� �����. � ����

date_reception �� �� cause_date_reception ��� ��� � ����

event_handle �� �� cause_event_handle ��� ����.

��:

_cause_event

� ���

_effect_event

� ���

�: �� ��� probe_arg �� ��� ���� � �, universal_oserv ����

universal_host ���� ���� � ��, universal_oserv ���� universal_host

���� �����. �� ���� �� ���� ��, universal_oserv ����

�� status ��� ACK� �����.

rule: link_oserv_to_host: ( event: _event of_class ’universal_oserv’ where [probe_arg: _probe_arg, severity: equals ’WARNING’ ], action: ’link_host’: ( first_instance(event: _host_ev of_class ’universal_host’ where [severity: within [’CRITICAL’,’FATAL’], probe_arg: equals _probe_arg, status: outside [’CLOSED’] ]), set_event_status(_event,’ACK’), link_effect_to_cause(_event, _host_ev) ) ).

��: unlink_from_cause

196 IBM Tivoli Enterprise Console: � �� ���

load_globals ��� ��� ���� �� ���� �����.

��: load_globals(_file)

��: � �� �� ��� ��� ���� �� ���� �����.

��:

_file �� �� ��� �� �� � �� ��

�: �� ����� � ���� �����.

load_globals(’/tmp/globalvars.txt’)

��: save_globals

� 4 � � �� �� 197

log_error � ��� ���� �� ���� ����.

��: log_error(format_string, variable_list, severity)

��: � �� ��� �� ����� �� ��� ��� ��� � ��

� ���� ���. IBM�� ���� �� � �� ��� � �� ��

� �� �� ���� ����� � ��� ���.

� �� �� ��� �� ���� �����.

v ��� ��

v ��� ��� TEC_Error ��� ��

log_error �� ��� �� �� �� ���� ������.

v tell_err �� Prolog �� ���� �� ������. � �� �� ����

�� ��� �����. ��� TEC_Start ����� ���� ���� ���

��� �� �� �� ����� ��, �� ��� ���� � ��� �

� ���. tell_err �� ��� ��� ����.

tell_err(’filename’)

v �� �� ������� �� �� �� � �� � �� ��� �� �

�� �����. �� ��� 233 ���� �set_log_error_source�� �����

�.

��:

_format

�� �� �� ��. �� �� ��� ����.

%c �

%d 10� ����� �� ��

%e �� ����� �� ��

%f 10� ����� �� ��

%g � ���� �� ��(10� �� �� ���).

%o � �� 0�� ���� 8� ����� �� ��

%s �

%u ��� �� 10� ����� �� ��

%x � �� 0x� ���� 16� ����� �� ��

��� �� % �� �� � �� �� �� ��� �� � ��

�.

198 IBM Tivoli Enterprise Console: � �� ���

- �� ��

0 ��� 0�� ���

n �� �� � � ��, n� ��� �� �����.

n.m ��� ��, n� ��� �� ���� m� ��� �� ��� �

����.

severity

�� TEC_Error ���� �� ���� �����.

variable_list

�� ���� ��� ��� ��. ��� ��� �� ���� �� ���

� ���.

�: �� ����� check_data �� �� �� �� ��� ��� ���

��� �(_data)� ���� my_predicate �� �� �� �����.

check_data �� ��� ����. ��� ��� ����.

1. �� ������ �� �� �� my_predicate �� ��� �����. �

�� set_log_error_source �� �����.

2. check_data �� � ��� trace_it �� �� ��� ���. � �� �

�� ��� ��� ����� set_detailed_debugging �� ��� �����

���. trace_it �� � ��� �� ��� ���.

3. check_data �� ���� log_error �� ���� Bad Data ����

my_predicate �� ID� � �� ��� �����. tell_err �� �� ��

� �� � ��� ���� �� ��� �������.

�� check_data �� ���� TEC_Error ���� CRITICAL ���� Bad

Data ��� � my_predicate �� ID� � �����. ��� � �� ID�

���� msg ��� �����.

my_predicate(_data):- set_log_error_source(my_predicate), ( trace_it(check_data), process_data(_data) ; log_error(’Bad Data %s’,[_data],’CRITICAL’) )

��: set_log_error_source

� 4 � � �� �� 199

place_change_request �� �� ��� �����.

��: place_change_request(_event, _attributename, _newattributevalue)

��: �� �� ��� ��� �� ���� �����. � ���� �� �� �

��, bo_set_slotval �� � ��� �� �� �� � ���� � �� ��

���� ���� �� �� � � ���.

��:

_attributename

�� ��

_event �� ��� �� ����� �

_newattributevalue

��� ���� �� �

�: �� ��� hostname ��� myhost ��� �� �� �����.

place_change_request(_event, hostname, myhost)

��: bo_set_slotval, re_mark_as_modified

200 IBM Tivoli Enterprise Console: � �� ���

print_cache ��� ��� ��� �����.

��: print_cache(file_name)

--��--

print_cache(file_name, event:_event of_class class where attribute_conditions)

��: � �� ��� ��� ��� �����. �� �� ��� �����.

v ��� �� ��: �� ��� �� ��

v ��� ��� �: ���� �� ��� ��

��:

event:_event of_class class where attribute_conditions

��� �� �� ���� ���� �� ��� ��� �����. ��

�� ��� ���� ��� �� �� �� _event � ��� ��� �

��� ����.

file_name

��� ��� �� �� � �� ��

�:

1. �� ��� ��� ��� �� ���� /tmp/cache ��� �����.

print_cache(’/tmp/cache/’)

2. �� ��� ��� ���� TEC_Start ���� �� ���� /tmp/cache �

�� �����.

rule: print_cache: ( event: _event of_class _class, reception_action: ( print_cache(’/tmp/cache’, event: _cached_event of_class ’TEC_Start’) ) ).

3. �� ��� ��� ���� �� ��� �� CLOSED �� ����

/tmp/cache ��� �����.

rule: print_cache: ( event: _event of_class _class, reception_action: ( print_cache(’/tmp/cache’, event: _cached_event of_class _cached_class where [status: equals ’CLOSED’]) ) ).

��: print_class_tree, print_event_activity

� 4 � � �� �� 201

print_class_tree ��� ��� �� �� ��� �� � ������ ��� ����� �����.

��: print_class_tree(_file, _class)

��: � �� ��� ���� ��� ���� �� ���� �� �����

��� ��� �� �� ��� �� � ������ ��� ����� �����.

�� ��� �� ��� ���� ��� �� ��� �� �� ����.

��:

_class ��� �� ���� �� ��� ���� ��

_file ��� ��� ��� �� �� � �� ��

�: �� ��� �� � ���� �� ��� ��� ���(���� � ���

��� EVENT���) /tmp/class_tree ��� ����� �����.

print_class_tree(’/tmp/class_tree’, ’EVENT’)

��: print_cache, print_event_activity

202 IBM Tivoli Enterprise Console: � �� ���

print_event_activity init_event_activity �� ��� ��� � ���� �����.

��: print_event_activity

��: � �� init_event_activity �� � ��� ���� ��� � ��

�� �����. ��� � �� � ��� �����.

���� ���� ��� set_timer �� _duration �� �����.

��: ��

�:

1. ��� � ���� �� � ��� ����� ��� � �� TEC_Tick

���� �� ���� ���. �� ����� �� ���� �� ���

��.

rule: configure_event_activity: ( event: _event of_class ’TEC_Tick’ where [msg: _msg equals ’Event Activity Report’, duration: _rep_freq], reception_action: start_timer: ( set_timer(_event,_rep_freq,_msg), commit_rule ) ).

2. �� ����� print_activity_report � ��� �����. �� ���� 191

���� �init_event_activity�� �����.

timer_rule: print_and_reset_event_activity: ( event: _event of_class _class where [ ], timer_info: equals ’Event Activity Report’, timer_duration: _rep_freq, action: print_and_reset_event_activity: ( print_event_activity, reset_event_activity, set_timer(_event,_rep_freq, ’Event Activity Report’) ) ).

��: init_event_activity

� 4 � � �� �� 203

re_after_match ��� �� � �� ���� � ��� ��� ��� �� ��� �� �

�� � ���� �����.

��: re_after_match(_name, _string, _result)

��: � �� re_create �� ��� ��� �� � �� ���� _string�

� ��� ��� ����. ��� ���� �� �����. �� �� ���

� _result� �����.

�� � � �� � ���� �� ��� Perl ��� ������.

��:

_name re_create �� ��� �� � �� ��

_result

�� �� �� ���

_string

��� �� � �

�: �� ����� �� ���� �� �����.

re_create(test,’a.*i’) % Create regular expression test. re_after_match(test,’chair’,_result) % Search ’chair’ using regular expression test. % Return the substring after the match in _result. % Succeeds, ’r’ returned in _result.

��: re_before_match, re_create

204 IBM Tivoli Enterprise Console: � �� ���

re_before_match ��� �� � �� ���� � ��� ��� ��� �� ��� �� ��

� � ���� �����.

��: re_before_match(_name, _string, _result)

��: � �� re_create �� ��� ��� �� � �� ���� _string�

� ��� ��� ����. ��� ���� �� �����. �� �� ���

� _result� �����.

�� � � �� � ���� �� ��� Perl ��� ������.

��:

_name re_create �� ��� �� � �� ��

_result

�� �� �� ���

_string

��� �� � �

�: �� ����� �� ���� �� �����.

re_create(test,’a.*r’) % Create regular expression test. re_before_match(test,’chair’,_result) % Search ’chair’ using regular expression test. % Return the substring before the match in _result. % Succeeds, ’ch’ returned in _result.

��: re_after_match, re_create

� 4 � � �� �� 205

re_create �� �� � � �� � �� �� � �� �����.

��: re_create(_name, _pattern)

��: � �� �� �� � � �� �� ��� � � ��� �� � �

� �����. �� � �� ���� ��� �� �����. ��� ��� �

� �� �� TEC_Start ���� �� ��� ��� ���� ���. ���

�� �� ��� ���� �� � � �����.

�� � � �� � ���� �� ��� Perl ��� ������.

��:

_name �� � �� �� ��� ��

_pattern

�� � �

�: �� ����� �� � �� ���� �� �� �� � � ���� �

��� �� �����.

re_create(test,’h.*i’) % Create regular expression test. re_search_string(test,’chair’) % Compare ’chair’ to regular expression test. % Succeeds, matches ’hai’.

��: ��

206 IBM Tivoli Enterprise Console: � �� ���

re_mark_as_modified ��� ������� ���� �� ��� �����.

��: re_mark_as_modified(_event, _)

��: � �� � ���� �� �� �� ���� ��� � � ��� �

������ ���� �� bo_set_slotval �� ��� �� �����.

��:

_ Prolog� �� ����� ���� ������ �� ��. anonymous �

���� ���.

_event �� ����� �. bo_set_slotval� _event �� �� ��� ��

�� �� ���.

�: �� ����� _oldevent� �� ��� ���� �� ���� ����

�� �����.

re_mark_as_modified(_oldevent, _)

��: bo_set_slotval, place_change_request

� 4 � � �� �� 207

re_match ��� �� � �� ���� � ��� ��� ��� ��� �����.

��: re_match(_name, _string, _index, _result)

��: � �� re_create �� ��� ��� �� � �� ���� _string�

� ��� ��� ����. ��� ���� �� �����. ���� ���

� _result� �����. ��� ��� � �� �� ��� ���� �

_index �� �����.

�� � � �� � ���� �� ��� Perl ��� ������.

��:

_index _result� �� ��� �. � 0� ���� �� ��� � ����,

� 1� ���� ��� � ��� ��� � ��� ����, � 2�

���� ��� ��� ��� � ��� ���� ����.

_name re_create �� ��� �� � �� ��

_result

_index ��� � ��� ���

_string

��� �� � �

�: �� ����� �� ���� �� �����.

re_create(test,’a.*r’) % Create regular expression test. re_match(test,’chair’,0,_result) % Search ’chair’ using regular expression test. % Return the entire result in _result. % Succeeds, ’air’ returned in _result.

��: re_create

208 IBM Tivoli Enterprise Console: � �� ���

re_search_string ��� �� � �� ���� � ��� ��� ����.

��: re_search_string(_name, _string)

��: � �� re_create �� ��� ��� �� � �� ���� _string�

� ��� ��� ����. ��� ���� �� �����.

�� � � �� � ���� �� ��� Perl ��� ������.

��:

_name re_create �� ��� �� � �� ��

_string

��� �� � �

�: �� ����� �� ���� �� �����.

re_create(test,’h.*i’) % Create regular expression test. re_search_string(test,’chair’) % Search ’chair’ using regular expression test. % Succeeds, matches ’hai’.

��: re_create

� 4 � � �� �� 209

re_send_event_conf ���� �� ��� ��� ����.

��: re_send_event_conf(_conf_file, _event)

��: � �� �� ��� ��� �� ��� ��� ���� ����. �� �

�� ��� � ���� TEC_RULES ������ � ���. �� �� �

�� .conf ��� ��� �� �����. �� ��, �� �� ��� host.conf

��, _conf_file �� �� host �� ������. � �� ��� �� �� �

�� ��� ��� �� �� �� ���� ���� �� ��� � ��� ��

���. �� �� 50�� �� �� ��� �����.

� �� �� ��� � ��� �����. ���� �� ��� ��

� � ��� ��, �� ��� ConnectionMode� �� connection_oriented� �

���� �����. � �� ���� ��� ��� ��� ��� � ���

���� ��� ���.

��, �� ��� ��� ��� ���� �� �� ��� ��� ��� ����

���� ���, �� ��� �� ��� ��� ��� ��� ���� �� �

� ��� �� � ��� ��� ���(�: BufEvtPath=/etc/tivoli/orange.cache).

�� ����� re_send_event_conf �� � ���� �� ��� ��� ��

���. �� �� ��� IBM Tivoli Enterprise Console ��� ���� ����

�.

ServerLocation=orange.tivoli.com TestMode=no BufEvtPath=/etc/Tivoli/orange.cache # ConnectionMode=connection_oriented

�: �� ��� � ��� ���� ���� ��, �� ��� � ��� ���

� �� ���. �� wrb ��� -imptgtdata ��� ���� �� �

���. wrb ��� �� �� ��� IBM Tivoli Enterprise Console ��

� ��� ���� ������.

��:

_conf_file

�� ��� �� ��� ���� �� ��

_event ��� ���

�: �� ��� ���� host.conf �� ��� ��� �� ��� ��

� ����.

re_send_event_conf(’host’,_event)

��: forward_event

210 IBM Tivoli Enterprise Console: � �� ���

re_split_event_id server_path ��� ��� ��� �� ���.

��: re_split_event_id(_path_element, _host, _server_handle, _date_reception,

_event_handle)

��: � �� ����, server_path ������ �� ��� �� �� �

� �� � �� �� ��� ��� ��� �� (��)���. server_path

��� ���� ����� ��� ��� ��� �� ��� ���� ��� ��

���. ��� ��� ��� ��� ��� �� ��� ���. � ��� ��

��� 10 ���� ���� ��� �� ��� ��� ID� ���� �� ���.

server_path ��� �� �� ��� IBM Tivoli Enterprise Console ��� ���

� ������.

��:

_date_reception

���� ���� �� ��� � ��� �����. � �� ���� �

�� ����� � date_reception ������ ������.

_event_handle

���� ���� ��� � ��� �����. � �� ���� ���

����� � event_handle ������ ������.

_host ��� hostname� � ��� �����. � �� ��� � ����

$BINDIR/TME/TEC/.tec_config ���� tec_rule_host �� ������

����.

_path_element

�� server_path ��� �� ��. ��� ��� ���� �� �

�� �����.

_server_handle

��� ��� � ��� �����. � �� ��� � ����

$BINDIR/TME/TEC/.tec_config ���� tec_server_handle �� �����

� ����.

�: �� ��� server_path ��� ��� ��� � ���� �� �� �

��.

bo_get_slotval(_event,server_path,_server_path), % Get the list for the server_path attribute. member(_item,_server_path), % Get an element of the list. % Because _item is free, the list will be traversed % and each element will be returned in succession.

� 4 � � �� �� 211

re_split_event_id(_item,_host,_server_handle, _date_reception,_event_handle) % Parse each element into variables.

��: bo_get_slotval, member

212 IBM Tivoli Enterprise Console: � �� ���

re_substitute ��� �� � �� ���� � ��� ��� ��� ��� ���� � �

� ���� �����.

��: re_substitute(_name, _string, _substitute, _result)

��: � �� re_create �� ��� ��� �� � �� ���� _string�

� ��� ��� ����. ��� ���� �� �����. _substitute� ��

��� ���� � � � _result� �����.

�� � � �� � ���� �� ��� Perl ��� ������.

��:

_name re_create �� ��� �� � �� ��

_result

��� ��� �� � �

_string

��� �� � �

_substitute

��� �� �

�: �� ����� �� ���� �� �����.

re_create(test,’a.*w’) % Create regular expression test. re_substitute(test,’hawk’,’oo’,_result) % Search ’hawk’ using regular expression test. % Return the new string in _result. % Succeeds, ’hook’ returned in _result.

��: re_create, re_substitute_global

� 4 � � �� �� 213

re_substitute_global ��� �� � �� ���� � ��� �� ��� ��� �� ��� �

��� � � � ���� �����.

��: re_substitute_global(_name, _string, _substitute, _result)

��: � �� re_create �� ��� ��� �� � �� ���� _string�

� �� ��� ����. ��� �� ��� ��� ���� �� �����.

_substitute� �� �� �� ��� ���� � � � _result� �����.

�� � � �� � ���� �� ��� Perl ��� ������.

��:

_name re_create �� ��� �� � �� ��

_result

��� ��� �� � �

_string

��� �� � �

_substitute

��� �� �

�: �� ����� �� ���� �� �����.

re_create(test,’a.*w’) % Create regular expression test. re_substitute_global(test,’hawkhawkhawk’,’oo’,_result) % Search ’hawk’ using regular expression test. % Return the new string in _result. % Succeeds, ’hookhookhook’ returned in _result.

��: re_create, re_substitute

214 IBM Tivoli Enterprise Console: � �� ���

redo_analysis ���� �� �� �����.

��: redo_analysis(_event)

��: ���� ���� ��� ��� ��� ���� � �� �� ��

�. � �� ��� ���� �� � ��� �� �� � ��� �� ��

���.

�: redo_analysis �� ���� � �� �� �� �� ���. �� ��,

��� A� ���� ��� B� �� ��� ���� � �� �

� � ��� �� �� �� � ���.

��:

_event ���� �� � ��� � �����.

�: �� ��� ��� ��� INSTALLATION_FAILED ���� ��� ��

� ��, �� ���� �� �� ��� � ���.

rule: disk_full_check_install_failed: ( description: ’look for installationfailed events for this host’, event: _event of_class ’DISK_FULL’ where [status: equals ’OPEN’, hostname: _hostname ], action: ( all_instances(event: _install_ev of_class ’INSTALLATION_FAILED’ where [target_host: equals _hostname], _event -600 -600 ), redo_analysis(_install_ev) ) ).

��: ��

� 4 � � �� �� 215

remove_bslashes ��� ���� ���� ��� �����. ���� �� � � ��

� �� ��� �� � ��� ��� ���� � ���� ��� ��

�.

��: remove_bslashes(_path1, _path2)

��: � �� _path1 �� ���� ��� ���� � ��� _path2

�� �����.

��:

_path1

�� ��� ��

_path2

��� ��� ��

�: �� ��� ��� ���� ���� ��� �����.

% Assign value. _path="\\tivoli\\data\\repository’, % Convert back slashes. % _new_path is unified with /tivoli/data/repository. remove_bslashes(_path,_new_path)

��: ��

216 IBM Tivoli Enterprise Console: � �� ���

reset_event_activity �� ��� �� �� �� �� 0�� ������.

��: reset_event_activity

��: � �� �� ��� �� �� �� �� 0�� ������. ��� �

print_event_activity �� �� �� � ��� �����.

��: ��

�: �� ����� � ��� �����.

timer_rule: reset_event_activity: ( event: _event of_class _class where [ ], timer_info: equals ’Event Activity Report’, timer_duration: _rep_freq, action: reset_activity: ( print_event_activity, reset_event_activity, set_timer(_event,_rep_freq,’Event Activity Report’) ) ).

��: print_event_activity

� 4 � � �� �� 217

reset_global_grp ��� �� �� �� ��� ��� �� ������.

��: reset_global_grp(_group,_value)

��: � �� ��� �� �� �� ��� ��� �� �� ���� ����

�. � �� ���� ��� �, ��� ��� ��� ��� �� ����, �

� _value� �����.

��:

_group

��� �� �� �

_value ��� �� � �

�: �� ��� Maintenance ��� �� ��� ��� off� ������.

reset_global_grp(’Maintenance’, ’off’),

��: set_global_var

218 IBM Tivoli Enterprise Console: � �� ���

resolve_time �� ��� ��� ����.

��: resolve_time(_time_structure, _seconds, _minutes, _hours, _day_of_month,

_month, _year, _day_of_week, _day_of_year, _daylight_saving)

��: � �� _time_structure �� �� ���� �� ����� ���

��� �� �� �� ���� �������. _time_structure� resolve_time

� �� ������ ���. �� �� � ��� ���. �� ����

��(GMT)���.

��:

_day_of_month

1 - 31 ��� ��� �������.

_day_of_week

0 - 6 ��� ��� �������.

_day_of_year

0 - 364 ��� ��� �������.

_daylight_saving

DST_ ���� <sys/time.h>� ��� �� �� ��� �������.

� �� � ��� ���� �� �� �� ��� ���� � ��

� ���. ��� � �� �� ���� �� �� ��� �� �

� �����. �� ����� Solaris ������� �� �����.

#define DST_NONE 0 /* not on dst */ #define DST_USA 1 /* USA style dst */ #define DST_AUST 2 /* Australian style dst */ #define DST_WET 3 /* Western European dst */ #define DST_MET 4 /* Middle European dst */ #define DST_EET 5 /* Eastern European dst */ #define DST_CAN 6 /* Canada */ #define DST_GB 7 /* Great Britain and Eire */ #define DST_RUM 8 /* Rumania */ #define DST_TUR 9 /* Turkey */ #define DST_AUSTALT 10 /* Australian style with shift in 1986 */

_hours

0 - 23 ��� ��� �������.

_minutes

0 - 59 ��� ��� �������.

_month

0 - 11 ��� ��� �������..

� 4 � � �� �� 219

_seconds

0 - 59 ��� ��� �������.

_time_structure

�� ��� �����. ��� _time_epoch �� �� �� �� ��

�� ���� � get_time �� �� ��� ���� ��� ��

��.

_year 00 - 99 ��� ��� �������.

�: �� ����� � �� �� ������ ��� �� �� �� ��

��� ��� ���� month ��� _month �� ��� ���� �� �

����.

get_local_time(_time_local_struct), resolve_time(_time_local_struct, _seconds, _minutes, _hours, _day_of_month, _month, _year, _day_of_week, _day_of_year, _daylight_savings), bo_set_slotval(_event, month, _month)

��: bo_set_slotval, get_local_time

220 IBM Tivoli Enterprise Console: � �� ���

save_globals �� ��� ��� ������ ��� �����.

��: save_globals(_file, _group)

��: � �� �� ��� ��� ������ ��� �����.

��:

_file ��� �� �� � �� ��

_group

��� �� �� �

�: �� ����� Maintenance ��� �� ��� ��� ��� ���� �

� �����.

save_globals(’/tmp/globalvars.txt’, ’Maintenance’)

��: load_globals

� 4 � � �� �� 221

search_cache create_cache_search_criteria �� ��� ��� �� �� ��� ��� �

�� �����.

��: search_cache(search_name, _referenceEvent, _maxEvents, _foundEvent)

--��--

search_cache(search_name, _referenceEvent, _timeBefore, _timeAfter, _maxEvents,

_foundEvent)

��: � �� ��� ��� ��� �����. ��� ��� �� ����

create_cache_search_criteria �� � �����.

�� �� ��� _timeBefore � _timeAfter �� �� �� ���� ���

�.

� �� ��� ��� ���� �� � � �����.

��� ��� ���� ��� �� � get_attributes �� �� � ���.

��:

_foundEvent

���� ����� �

_maxEvents

� �� ���� �� �� ��� �

_referenceEvent

� ��� �� ����� �

search_name

���� �� � �� ��. � �� � ��� � ��

create_cache_search_criteria �� �����.

-timeAfter

�� ��� �� �

-timeBefore

�� ��� �� �

�: �� ��� db_critical_search �� ���� �� ���� 20 �� � �

�� ���� ���� ����. �� ���� ���� 5��� ����� ��

�����.

222 IBM Tivoli Enterprise Console: � �� ���

search_cache(’db_critical_search’, _refevent, 600, 600, 5, _found_event)

��: create_cache_search_criteria

� 4 � � �� �� 223

set_detailed_debugging �� �� � �� ��� � �� ��� �����.

��: set_detailed_debugging(on)

--��--

set_detailed_debugging(off)

��: � �� trace_it �� � � ��� �� ��� � �� �� �

�� ��� ���� �� ���� �� ���. set_detailed_debugging �� �

� ���� �� � ���.

��:

off � �� ��� ���� ��� �����.

on � �� ��� ����� �����.

�: �� ����� check_data �� �� �� ��� ��� ��� ��

� �(_data)� ���� my_predicate �� �� �� �����. check_data

�� ��� ����. ��� ��� ����.

1. � �� ��� ��� ���� �� set_detailed_debugging �� ��� �

��.

2. �� ������ �� �� �� my_predicate �� ��� �����. �

�� set_log_error_source �� �����.

3. check_data �� � ��� trace_it �� �� ��� ���.

4. check_data �� ����, log_error �� ���� Bad Data ����

my_predicate �� ID� � �� ��� �����. tell_err �� �� ��

� �� � ��� ���� �� ��� �������.

�� check_data �� ����, TEC_Error ���� CRITICAL ���� Bad

Data ��� � my_predicate �� ID� � �����. ��� � �� ID�

���� msg ��� �����.

�� ���� ���� �� ��� � �� ��� �����.

set_detailed_debugging(on), my_predicate(_data):- set_log_error_source(my_predicate), ( trace_it(check_data), process_data(_data) ; log_error(’Bad Data %s’,[_data],’CRITICAL’) )

224 IBM Tivoli Enterprise Console: � �� ���

��: ��

� 4 � � �� �� 225

set_event_administrator ���� �� ��� �����.

��: set_event_administrator(_event, new_administrator)

��: � �� ��� ���� �� administrator ��� �� �� �����.

�: � �� �� �� �� �� �� ��� ���� �� ��� �� ��

� �����. �� �� �����, set_event_administrator � ��

place_change_request �� �����.

��:

_event ��� �� ����� �

new_administrator

���� � ��� �����.

�: �� ����� � ���� �����.

set_event_administrator(_event, bjones)

��: change_event_administrator, place_change_request

226 IBM Tivoli Enterprise Console: � �� ���

set_event_message ���� msg ��� �����.

��: set_event_message(_event, _format, [_value])

��: �� ��� C ����� ��� sprintf() �� �����.

�: � �� �� �� �� �� �� ��� ���� �� ��� �� ��

� �����. �� �� �����, set_event_message � ��

place_change_request �� �����.

��:

_event �� �� msg ��� �� ����� �

_format

msg �� �� �� �� ��. �� �� ��� ����.

%c �

%d 10� ����� �� ��

%e �� ����� �� ��

%f 10� ����� �� ��

%g � ���� �� ��(10� �� �� ���)

%o � �� 0�� ���� 8� ����� �� ��

%s �

%u ��� �� 10� ����� �� ��

%x � �� 0x� ���� 16� ����� �� ��

��� �� % �� �� � �� �� �� ��� �� � ��

�.

- �� ��

0 ��� 0�� ���

n �� �� � � ��, n� ��� �� �����.

n.m ��� ��, n� ��� �� ���� m� ��� �� ��� �

����.

_value msg ��� �� ��� ���. � �� �� �����.

�: �� ����� �� ��� ��� �����.

_integer is 123, _real is 12.3, _string = ’Hello, World’,

� 4 � � �� �� 227

% Assign values. set_event_message(_event, ’%s’, [_string]), % msg attribute assigned ’Hello, World’. set_event_message(_event, ’%20s’, [_string]), % msg attribute assigned ’ Hello, World’. set_event_message(_event, ’%-20s’, [_string]), % msg attribute assigned ’Hello, World ’. set_event_message(_event, ’Integer in decimal notation: %d’, [_integer]), % msg attribute assigned ’Integer in decimal % notation: 123’. set_event_message(_event, ’Integer in decimal notation with field width: %10d’, [_integer]), % msg attribute assigned ’Integer in decimal % notation with field width: 123’ set_event_message(_event, ’Integer in decimal notation with leading zeros: %010d’, [_integer]), % msg attribute assigned ’Integer in decimal % notation with leading zeros: 0000000123’. set_event_message(_event, ’Integer in octal notation: %o’, [_integer]), % msg attribute assigned ’Integer in octal % notation: 173’. set_event_message(_event, ’Integer in hexadecimal notation: %x’, [_integer]), % msg attribute assigned ’Integer in hexadecimal % notation: 7b’ set_event_message(_event, ’Real in decimal notation: %f’, [_real]), % msg attribute assigned ’Real in decimal % notation: 12.300000’. set_event_message(_event, ’Real in decimal notation with field width: %3.2f’, [_real]), % msg attribute assigned ’Real in decimal % notation with field width: 12.30’. set_event_message(_event, ’Real in real notation: %f’, [_real]), % msg attribute assigned ’Real in real notation: % 12.300000’. set_event_message(_event, ’Real in exponential notation: %e’, [_real]), % msg attribute assigned ’Real in exponential % notation: 1.230000e+01’.

228 IBM Tivoli Enterprise Console: � �� ���

set_event_message(_event, ’Real in its shortest form: %g’, [_real]) % msg attribute assigned ’Real in its shortest form: 12.3’.

��: place_change_request

� 4 � � �� �� 229

set_event_severity ���� ���� �����.

��: set_event_severity(_event, new_severity)

��: � �� ��� ���� ���� �����.

�: � �� �� �� �� �� �� ��� ���� �� ��� �� ��

� �����. �� �� ����� set_event_severity � ��

place_change_request �� �����.

��:

_event ���� ��� ����� �

new_severity

� ��� ���

�: �� ����� � ���� �����.

set_event_severity(_event, ’CRITICAL’)

��: change_event_severity, place_change_request

230 IBM Tivoli Enterprise Console: � �� ���

set_event_status ���� ��� �����.

��: set_event_status(_event, new_status)

��: � �� ��� ���� �� ��� �����.

����:

1. � �� �� �� �� �� �� ��� ���� �� ���� ��� �

�� �� �� � �����. �� �� ����� set_event_status � �

� place_change_request �� �����.

2. status ��� � �� �� CLOSED ��� ������, duration ��� �

�� ���� �� ���� ����. �� 0�� ����. �� ��� 9 ��

�� �duration�� ������.

��:

_event ��� ��� ����� �

new_status

status ���� �� � �. status ��� �� �� �� 9 ���� �

��� ���.

�:

1. CLOSED ��� �� � ����.

2. new_status �� �� ACK�� OPEN ���� ��� ��� ��

��.

�: �� ����� ���� status ��� ACK� ���� �� �

����.

set_event_status(_event, ’ACK’)

��: change_event_status, place_change_request

� 4 � � �� �� 231

set_global_var ��� ��� �� �����.

��: set_global_var(_group, _key,_value)

��: � �� �� ���� ��� ��� ��� �� �����. ��� ��

�� ����� [ ] ���� ������.

��:

_group

��� �� �� �

_key ��� �� �

_value �� �

�: �� ����� �� ��� ��� �����.

set_global_var(’My group key’, _key, ’My value’)

set_global_var(’My group key’, _key, [’a’, ’b’, ’c’])

set_global_var(’Maintenance’, _origin, ’on’)

��: reset_global_grp

232 IBM Tivoli Enterprise Console: � �� ���

set_log_error_source log_error �� �� �� �� ������ �� �� �� �� ID� ��

���.

��: set_log_error_source(‘source_location’)

��: � �� �� �� ������� �� �� ��� �� ����

� �� �� � �� � �� ��� �� ��� �����. �� �� � ��

� �� �� �� ��� ID(�: � ��)� ������.

��:

source_location

��� � � ��� ���� �

�: �� ����� check_data �� �� �� �� ��� ��� ���

��� �(_data)� ���� my_predicate �� �� �� �����.

check_data �� ��� ����. ��� ��� ����.

1. �� ������ �� �� �� my_predicate �� ��� �����. �

�� set_log_error_source �� �����.

2. check_data �� � ��� trace_it �� �� ��� ���. � �� �

�� ��� ��� �����, set_detailed_debugging �� ��� ����

� ���. trace_it �� � ��� �� �����.

3. check_data �� ����, log_error �� ���� Bad Data ����

my_predicate �� ID� � �� ��� �����. tell_err �� �� ��

� �� � ��� ���� �� ��� �������.

�� check_data �� ����, TEC_Error ���� CRITICAL ���� Bad

Data ��� � my_predicate �� ID� � �����. ��� � �� ID�

���� msg ��� �����.

my_predicate(_data):- set_log_error_source(my_predicate), ( trace_it(check_data), process_data(_data) ; log_error(’Bad Data %s’,[_data],’CRITICAL’) ) )

��: log_error

� 4 � � �� �� 233

set_timer ���� ��� �����.

��: set_timer(_event, timer_duration, timer_info)

��: � �� ��� ���� ��� �����. ��� �� � � ��

� � ��� ��� ��� ��� ���� �� �� �� �����. ���

�, ��� �� ��� ����� �� � ��� ���� �����.

� �� ���� �� � � �� ��� ���� 1000���.

TEC_Tick ��� ���� �� ��� ��� ���. �, ��� ���� ��

��� ����. ��� ���� �� ���� ��� ��� ���� � �

� � ���.

��:

_event ��� ��� ����� �

timer_duration

��� �� ��( �). ��� �� ��� ��� ����� ���

� ���.

timer_info

�� ��. � �� ��, � �� ���� ��� � � ���.

��� �� ��� ��� ���� �� ��� � ���.

�: �� ��� �� �� ��� � ��� �� �� ��� �� �

����. �� �� ��� � ���� �� ��� �� ��� ���

�. �� �� ��� ��� � ���� ���, �� ��� � ����

�� ��� �����, �� ��� � ��� �� �� � ��� ���

��.

rule: ( event: _event of_class ’TEC_Start’ where [ ], reception_action: ( first_instance(event:_ev of_class ’TEC_Tick’ where []), set_timer(_event, 600, ’Event Activity Report’) ) ).

timer_rule: reset_print_activity: ( event: _event of_class _class where [ ], timer_info: equals ’Event Activity Report’, timer_duration: _rep_freq, action: reset_print_activity: ( print_event_activity,

234 IBM Tivoli Enterprise Console: � �� ���

reset_event_activity, set_timer(_event,_rep_freq,’Event Activity Report’ ) ).

��: ��

� 4 � � �� �� 235

trace_it �� �� � ��� �� ��� ���.

��: trace_it(predicate_name)

��: � �� �� �� �� �� ��� �����.

�: ��� ��� � �� �� �� ��� �� ��� �� � � ��

���� ����.

��:

predicate_name

�� �� ��

�: �� ����� check_data �� �� �� �� ��� ��� ���

��� �(_data)� ���� my_predicate �� �� �� �����.

check_data �� ��� ����. ��� ��� ����.

1. �� ������ �� �� �� my_predicate �� ��� �����. �

�� set_log_error_source �� �����.

2. check_data �� ��� trace_it �� �� ��� ���. � �� ���

��� ��� �����, set_detailed_debugging �� ��� ����� �

��. trace_it �� � ��� �� �����.

3. check_data �� ����, log_error �� ���� Bad Data ����

my_predicate �� ID� � �� ��� �����. tell_err �� �� ��

� �� � ��� ���� �� ��� �������.

�� check_data �� ����, TEC_Error ���� CRITICAL ���� Bad

Data ��� � my_predicate �� ID� � �����. ��� � �� ID�

���� msg ��� �����.

my_predicate(_data):- set_log_error_source(my_predicate), ( trace_it(check_data), process_data(_data) ; log_error(’Bad Data %s’,[_data],’CRITICAL’) ) )

��: set_detailed_debugging

236 IBM Tivoli Enterprise Console: � �� ���

unlink_from_cause � ������ � ���� ��� �����.

��: unlink_from_cause(_effect_event)

��: � �� ��� �� ��� ����� � ����

cause_date_reception � cause_event_handle ��� �� 0�� �����.

��:

_effect_event

�� �� ���

�: �� ����� � ���� �����.

unlink_from_cause(_oserv_down_event)

��: link_effect_to_cause

� 4 � � �� �� 237

update_event_activity print_event_activity_report �� ���� �� ��� ��� �����.

��: update_event_activity(_event)

��: � �� ������ ��� ���� �� ���� �� �� ����

� �����. ��� � �� ��� ����� ���� ��� ����.

��:

_event � ��� �� ����� �

�: �� ����� � ��� �����.

rule: update_event_activity: ( event: _event of_class _class where [ ], reception_action: update_activity: ( % recorded(event_activity,active), % Line above used with im.rls (intermediate mgr. rules) update_event_activity(_event) ) ).

��: print_event_activity

238 IBM Tivoli Enterprise Console: � �� ���

� 5 � �� �

� ���� �� � � �� ���� ���� IBM Tivoli Enterprise Console �

� ����� �� �� � �� ����� �����. ���� � ���

� �����. �� ���� ���� � � ���� ���� �� ���

� � �� �� ����. �� ��� � 1 � �� �� ���� 3 ���� �

�����.

� �� ��� ��� �� �, BAROC �� � ��� �� ���

$BINDIR/TME/TEC/samples/correlation ���� ��� �� ����� �� �

���.

� �� ���� ��� ��� ��� ��� �� �����.

��� � �� ��

������� �� ���� ���� ��, ��� �� � ��� ���� �

� �� �� � ������� �� ���� ��� �� ����� ���

���� ���, ���� ��� ���� ���� ���� ���� ����. �

���� �� ����� �� �� ���� ��� ��� ��� ���� �

���. �� ��, �� ����� ���� ���� �� ��� � �� �

� APC UPS(Uninterruptible Power Supply)� ���� ��� �����.

© Copyright IBM Corp. 2003 239

������ ��� ��� ���� �� �� ���� UPS(��� �� �

� ��)� upsOnBattery ���� ��� �� �����. upsOnBattery ���

� ���� �� ���� ���� ��� ���� �� ����.

��� ����, lowBattery ���� ��� UPS �� ��� ���� ��

�����. �� �� ��� �� �� ��� � � upsDischarged ���

�� �����. upsDischarged ���� ��� ��� ���� ��� ���

UPS(��� �� �� ��) ��� ��� ��� �����.

�: ���� ��� �� � ���� ��� ���� �� �� ��� ��

� ��� ��� ����. �� �� ���� ���� �� ����� �

��� �� � � ���� ���� �� ����. �� ���� ��

���� ���� �� ���� ��� ��� ��� ��� ���� ���.

�� ��, ��� A� B� ����, B� C�, ��� C� D� �����, �

� ���� ��� ��� ��� ���� ���. � ��� A� D� �

��, � �� ��� �����. A�� B, A�� C, A�� D, B�� C, B

�� D �� � ��� �� ��� ����. �� ��� ���� ��

� ���� ��� ��� �����.

powerRestored, returnFromLowBattery � dischargeCleared ���� ��� ���

���. ��� ��� � �� ���� �� ��� �� ��� ��!�� �

���. ����� ��� ���� �� ���� � ���� �����. �� �

�, powerRestored ���� upsOnBattery ���� ����. �� ���� ��

�� ���� ��� ���� �� �� ����.

IBM Tivoli Enterprise Console ��� ������� ��� ��� ���� �

� ���� ��� ��� �� ��� � �� ���� ������. �� � �

���� � �� �� ��� �����.

240 IBM Tivoli Enterprise Console: � �� ���

�� � �� � �� �

��� ��� �� � ��� �� � ���� ��� �����. �� � �

�� ��� ��� �����.

v ����� �� ����� �� �� �� �� �� �� ���� � �

��� �����.

v ���� ��� ��� ��� ��� ��� ���� ����.

� ��� �� �� �� ���

�� ������ � ��� ��� ��� �����. Compaq Insight Manager �

� ���� �� ���� � cpqTape3PhyDrvStatusChange ������.

cpqTapePhyDrvCondition �� Degraded, Failed � OK �� ���� ��� �

����. ��� ���� OK �� ���. �� ��(�: Distributed Monitoring)

� SNMP ��� ��� ��� ��� ����� �� ���� �� �� �

��� �����.

� ��� � ���

�� ������ � ��� ��� �� ��� �����. � ��� ��� �

�, 240 ���� � ���� �� ��� ���� ��� ����. ��� ��

�� �� ��� ��� ���� �� � ��, ��� ���� ��� ��� �

���. �� ��, ��� A� ��� ���� �� ��� B, C � D� �� �

���.

Cisco ��� ���(�� ��� ��)� ��� � ��� ���� �� �� ��

�� ����. Compaq Insight ���� ���(��� ��� ��)� ��

� � ��� ���� �� �� ����� cpqDa3PhyDrvStatus ��� ��

�� �����.

� 5 � �� �� 241

�� �� ��

���� ���� ��� ���� ���� � ���� ���� ��� �� �

� ��� �� � ���.

�� ���

� ���� ���� �� ���� �����. ��� �� ���� ����

�� ����(�: ���, ���, ��� �)� ���� �� ���� �� �

��� ���� �� ��� ���.

���� �� � ��� ���(�: � ��), � � ���� �� ���

� �� � ���� ��� �� ��� � � ���� �� ��� � �

��� �� ��� �� ��� �� ���. � ���� ���� �

���� �� � ���� ���� ���� �� � ���� ��� ��

�� ��� ����� ���� ��� ���. ��� ��� ��� � ��

�� �� ���� ��, ��� ��� �� � ��� ���� ���.

240 ���� ����� upsBatteryOn ���� lowBattery � upsDischarged �

��� �� � ������. upsOnBattery � lowBattery ���� �

upsDischarged ���� �� � ������.

upsBatteryOn ���� ��� �� ����� �� ������. ���

�� ������ � � ���� �����. �� �� ���� � ��

�� �����.

�� ���

� ���� �� �� ���� �����. 240 ���� ����� upsDischarged

���� lowBattery � upsOnBattery ���� �� � ������.

242 IBM Tivoli Enterprise Console: � �� ���

� ���� ��� � ���� �� �� ���� �� �� ���. �

� ��, ���� ��� � � �� ������ �� ���� �� �

���� �� � ���. �� ���� � ���� �� � �� ��� �

�� � ��� ���� ���.

���� �� � �� ��(�: � ��), � ���� �� ��� �� ��

�� ��� � � ���� �� �� � ���. � ���� ���

� � ���� � ���� ���� �� ����� ��, ��� ���

� ��� ����� ���� ��� ���. � ���� ��� ��� ��

��, ��� ��� � ��� ���� ���.

240 ���� UPS(��� �� �� ��) ��� ����, upsDischarged ���

� �� ��� �� ������ upsOnBattery ���� �� ��� ���

�� ���. upsOnBattery ���� �� � ��� �� ������ lowBattery

���� �� �� � �� ���. � ��� �� �� �� � ���,

upsDischarged ���� �� � ��� ���� ���. ( ��� ���

� ��� �� �����.)

�� ���

��� ���� �� ��� ���� ��� ��� ���� �� ����. 240

���� ����� powerRestored ���� upsOnBattery ���� �� ��� �

����, returnFromLowBattery ���� lowBattery ���� �� ��� ���

���.

��� ���� ����, ����� �� ��� ��� ���� �� ���� �

�� ���� �� ���� �� ��� ��� ��� �� ���. ��� ��

�� �� ��� ���� �� �� �� �� ������ ����� ��

�� �� �� ����.

� �� ���, ��� ���� ���� ��� ��� �� ��� � ��

�. � ��� ���� ��� ��� �� ���� ��� �� �� ���

� � � � ���. �� �� ����� �� ���� �� �� ���

���� �� � ���� ��� ���� �� ��� ��� � � ��

� (�� ���� ), ��� ���� �� �� �� �� ��� � ���.

��� ��, ��� ���� ���� ��� ��� �� ���� ����. �

� � ��� �� �� �� ���� ��� ��� �� ��� ����

����.

�� �� �� ��� ��

�� � ��� ��� � �� ��� ��� ���� ���� � �� ��

� � �� � ��� ��� �� � � � �� ���. � ���� ���

� 5 � �� �� 243

����� ��, ��� �� ������� �� �� �� �� ����� �

��(��� ���� ����) �����. � ��� �� ��� �� � � �

�� �� ������.

v � ��� ��

v � ��� ��

v ��� ��� ��

�� ��� ��

�� ��� � ���� �� ��� ��� �� �����.

1. � ��� �� � �����: �� � �� ��� ��� � ���� �

��� �� �� �����, � ���� ����, ����� ������.

�� � �� � �� ���� ���, ��� ���� ���� ����

� ���� � �� �� ��� � ���� ��� ������.

2. � � � ��� �: � � �� ��� ��� ���� ��� �����

�� �����, ��� ��� ���� ���� ��� ���� �� ��

� ��� �����. ��� ���� ���� ���� �� ��� ����

�� ���� ����� ������.

�: ��� ����, ��� ���� ���� ��� ��� �� ���� �

���. �� � ��� �� �� �� ���� ��� ��� ��

��� ���� ����.

3. � ��� �: � �� ��� ���� ��� ���� �� � ���, �

��� �� ����� � � ��� � ���� �����. � �

��� ��� � ���� ���� ��� ��(���� ��)� ��� �, �

�� ������.

4. �� � � ��� � ��: � ��� ��, � ���� ����

�� �� ���. ��� ���� �� ���� ��� ��� ����,

����� ����� �����.

�� ��� ��

�� ��� � ���� �� �� ��� �� �����.

1. � ��� �� � �����: � � �� ��� ���� 1�� ��

��.

2. � � � ��� �: � � �� ��� ���� 2�� ����.

3. � �� ��� �: ��� ���� � ���� ��� � ��� �

� �����. ���, �� ��� � ���� ���� ��� �����.

� � ���� �� ��� ��� ���, ��� � ���� ����

��� ��(���� ��)� ��� � ��� ������.

244 IBM Tivoli Enterprise Console: � �� ���

4. � ��� �: ��� ��� � ���� ���� �� � ���, � �

��� � � ���� �����(�� ��� �� ). � ��� �� �

���� � � ��� � ���� �����. ��� � ���� ��

� � ���� ���� ��� ��(���� ��)� ��� � ��� ��

����.

5. �� � � ��� � ��: � � 244 ���� �� ��� ���� 4

�� ����.

�� ��� ��

��� ��� ���� �� ��� �� �����.

�� ��� ��� �: ��� ��� ���� �� ��� ��� �����.

��� ��� ��� ���� �� ������. ��� ���� �� �� �

�� ��� �� ��� �� ��� �����. ��� ���� ��� ��� �

��� �� ��� �� �� ��� � �, ��� �� ��� ���� ���

���� � ��� �� � ���.

��� �� � �� ��

IBM Tivoli Enterprise Console �� 3.7� ���� �� � �� �� �� �

�� ! � � ���� ���.

v � �� �� �� ��� ��, � ��� ��� ��� �� ��� �� �

���� ��. �� ��, ��� �� �� ���.

– ��� ��� ��� �� ��� ��� �� �� ��. � �� ��� �

�� ��� � � ��� �� ���� �����.

– � ���� ����� � ��� ���� �� ��� ��� ��� ��

��� ��� �� ��� ��� ��� �� ��� ���� �

v ��� �� �� ���� �� � �� ��� �� �� ��. ���

��� �� � � � ���.

– ��� ��� �� ��� ������ �� ��� ����� �� �� �

����.

– ��� �� ��� � ��� �� ��� ���� ��� ��� ��� � �

� ����.

� ��� ! � �, �� �� ��� ���� �� ��� ���� ��

�� �������. ��� �� �� ��� ���� �� ��� ��� ���

�, ��� �� �� � �� �� ����. �� �� ���� ��

� ���� ���� ��� ��� �� ����. ��� �� �� �

�� ��� �� ����� ���, ��� �� ��� �� �� �(��� �

� ��� �)� �����.

� 5 � �� �� 245

�� �� �� � ��� �����.

1. � ��� �� ���� �� ��� �� ��� ������. � ��

TEC_Start ���� ��� ���� �� ��� �� ���� ��, �

�� �� �� �� �����.

2. ��� ��� �� ���� ���� ������ �� ��� ��� ��� �

� ��� ���� �� ������.

��� � � �

��� �� ��� �� � ��� ! � ���.

v ��� ��� ��� ��� ��� �� ���� create_event_sequence �

create_clearing_event �� ��� ��� ���� �� ����.

v � �� ���� ��� ��� ��� ���� �� �� �� � � ���

���� �����. �� ��, � ���� � Compaq Insight Managersms�

� �� ���� ��� �� � �� �����.

v �� �� ��� �� ��� �� ��� �����.

– ��� ���� �� ��� ���� ���� ��� ���� �����

�, ��� � �� � � ���.

– ��� ��� ���� 243 ���� ��� �� �� �� �� ��

�� ���� ��� ���� �� ��� � � ���.

v � �� TEC_Start ���� ��� ���� �� ��� �� ���� �

�� �� �� �� �����.

� �� ���� ��� �� ��� ���� �� �� � ��� 143 ���

� �create_event_sequence� � 137 ���� �create_clearing_event�� �����

�.

��� � �� ��

�� �� �� ��� �� �� �� ��� �����. � ��� �� ���

�� ���� �� ��� �� ���� �� �� �� ��� �� �� ��

� ���. � �� ��� �� � �� �� �� ���� ���� ��

�� ����.

���� �� � �� � �� �(�: first_causal_event �), ���� �

� ����� �� �� ��� �� �� �� ��� ����. �� ��

� ��� ��� �� �����. �� ��� ���, ��� ���� ��

�� ��� ���� �� ��� ��� ����. � ��� ���� ����

���� �� ����� �� �� ��� �� ��� ���� �� ���

� ��, ���� ���� ��� � �� ��� �� �� ���� ��

�� �� ��� � ���.

246 IBM Tivoli Enterprise Console: � �� ���

��� ���� �� ��� �� � �����. ��� ���� ��� �� �

� ���� ��(create_event_sequence �� ����), �� ���� �� �

� ��� ����� �� ��� ���� �� ��� �����.

��� ���� create_clearing_event �� ������(��� ���� ����

�� create_event_sequence �� ���� ��), ��� ���� �� ��� �

�� �� ��� ��� � ���. ��� ���� ��� ���� ���� �

�� ��� ��� �� any_clear_target �� all_clear_targets �� ����

����. ��� ������, ��� ���� �� ��� �� ���� ���

�� �� �� � ���. �� ���� ���� �� ���� �� � �� �

� ��� ���� ��� � �� ��� �� � ���. �� ���, ��

� ���� ��� ���� �� �� ��� �� ��� ��, �� ���

� �� �� ��� ��� �� ��� �� �� ��� ���.

�� ��� � �� ����� � ��� ��� ��� ���� �� ��� �

�� ���� �� �� �� any_clearing_event �� � ������, �

�� ���� �� ��� �� �� ��� �� �� ��� � ���. ��

� � � �� ���� ��� ���� �� �� �� ��� ��� ����

��� � ��� ���� �� � �� �� ��� ����. �� �� ��

� �, ��� � �� ���� �� �� �� �� �� ���. �� �

� �� � ���.

��� � �� ���� �� ��� ��

��� ���� ��� ���� �� ��� �� ��� �� ��� �� �

�� ��� ! � ���.

v ��� ��� ��� ��� ��� �� ���� create_event_sequence �

create_clearing_event �� ��� ��� ���� ����.

v ��� �� � �� �� ��� �����. ��� �� �����

�� �� ���� ���, �� ��� �� �� ���� ��� ��� � �

�� 2 (1 ��, 1 ��)� �����. ��� �� �� ��� �� �

� ���� ��� �� ��� ��� ���.

v � �� TEC_Start ���� ��� �� ���� ��� �� �� ��

�����.

�� ��� ��� ���� ����� �� ��� �� �� �� �� �

�� ���.

� ��

all_clear_targets ��� ��� ���� ��� ��� � �� ����

�����.

� 5 � �� �� 247

� ��

any_clear_target ��� ��� ���� ��� ��� � �� ��

�� �����.

any_clearing_event ���� ��� ��� � �� ���� �����.

first_causal_event � ���� ��� � � ���� �� ��� �

�� ����.

first_effect_event � ���� ��� � ���� �� ��� ���

����.

first_related_event �� ���� ��� ����� �� �� ���� ��

��� ��� ����.

is_clearing_event ��� ���� create_clearing_event ��

create_event_sequence �� ��� ���� �����

� ������.

� ��

� �� � ��� ��� ��� ��� � �� �� ��� �����. � ��

��� ��� �� �� �� �� ����� 88 ����� ���� � ��

�� �� � �� �� �� ������.

��� � � �

�� �� TEC_Start ���� �����. (� �� ���� �� ���.)

TEC_Start ���� ��� ��� �� � ����. � �� � �� � ��

� ��� �� �� ��� ���� � ��� �� ���� �����.

rule: ’create_event_sequences’: ( event: ev of_class ’TEC_Start’, reception_action: ’create_sequences’:( create_event_sequence( [’upsOnBattery’, ’lowBattery’, ’upsDischarged’, ’universal_host’], [’hostname’, [’status’,’outside’,[’CLOSED’]] [ clears(’powerRestored’,[ ], [’upsOnBattery’],[ ]), clears(’returnFromLowBattery’,[ ], [’lowBattery’],[ ]), clears(’dischargeCleared’,[ ],[’upsDischarged’],[ ]), clears(’universal_host’, [ [’severity’, equals,’HARMLESS’] ] [’universal_host’], [ ]), attr_condition(’universal_host’, [’severity’,equals,’FATAL’]), attr_exception(’hostname’,’universal_host’, ’probe_arg’) ]

248 IBM Tivoli Enterprise Console: � �� ���

), create_event_sequence( [’cpqTape3PhyDrvStatusChange’], [’hostname’, [’status’,’outside’,[’CLOSED’]]] [ attr_sequence( ’cpqTape3PhyDrvStatusChange’, ’cpqTapePhyDrvCondition’=[’Degraded’,’Failed’]), clears( ’cpqTape3PhyDrvStatusChange’, [ [’cpqTapePhyDrvCondition’,equals,’OK’] ], [’cpqTape3PhyDrvStatusChange’], [ ]) ] ),

create_clearing_event( ’CiscoLinkUp’, [ ], [’CiscoLinkDown’],[’origin’],no), create_clearing_event( ’cpqDa3PhyDrvStatusChange’, [ [’cpqDaPhyDrvStatus’,equals,’OK’] ], [’cpqDa3PhyDrvStatusChange’], [’hostname’, [’cpqDaPhyDrvStatus’,not_equals,’OK’] ], no), commit_set ) ).

��� �� �

� �� ��� �� 248 ���� ���� �� �� ����� �� ��� ��

���� ���, �� �� ����� ��� �� �� ���� �����.

process_problem_events �: process_problem_events �� �� ��� ��

�(��� ���� ��)� �����. � �� ��� ��� � ���� ���

�� �� �� ���� �����.(����� �� ������� ���� ��

��� �� ����� ��� � ���.) � ��� ��� ����.

1. check_for_clear ��� ���� ���� ��� ���� ��� � ���. �

�� ����� ����� �� �� �����. ��� ���� ���, ��

� �� �� ��� ��� ��� ��� ���� �� �����. ��� �

�� ��� ���� ���� �� ���� �� ����, �� ��

� �� ���� �� ����� ��� �� ���� ����� �����.

�: ��� ��� ��� �� ��� ��� ��� ��� ���� �� ��

� �� �� �� �� �� �� �����. ��� �� ���� �

��� � ��� ���� ��� ��� ����� �� ��� ��� �

� � � �� �� ���� � ��� ��� ���.

� 5 � �� �� 249

2. duplicate_detect ��� � �� �� ��� � ���� �� ��� ���

����. �� ���� repeat_count ��� ���� ���� �

��� ��� �����.

3. check_for_prior_cause ��� �� � �� ��� ��� ��� � � �

��� �� ��� ��� ����. ��� � ���� ��� �

��� ���� � ���� ��� ���� ��� ����, ��� ���

��� ���� ��� �����. � ��� �� ��� ��� ��� ���

� ��� ����� �� �����.

4. check_for_effect ��� �� � �� �� ��� �� � ���� ��

��� ��� ����.( �� � ���� ��� ��� ��� ��� �

��, ��� ��� ��� ����� ����� �� �� ���� ���

�.) � ���� ���� ��� � ����� ���� ����

��� ������ ���� ��� ��� ��� ����, ��� ����

�.

5. open_trouble_ticket ��� �� �� ���� ���� ��� � ����

�. � ��� ����, ���� ���� �� ��� �� �

���. ���, ��� ��� ���� ���� ����. � ���

� scripts/create_trouble_ticket.sh�� ��� ����� ����� �

� ��� ���.

��� � �� �� ��� � ����.

v check_for_prior_cause � check_for_effect ��� �� � � � ��

� ���� ��� ��� ���� � ����� �� ���� ���� �

� ���� ���� �� ���� ��� ��� ���� ��� ���� ��

�� �����. �, �� � ���� � ���� �����.

v �� � ���� � ��� ��� �� ���� ��� ��� ��� �

�� �� ��� �� �����. ��� � �� ��� ���� ���

�. ��� � �����.

rule: ’process_problem_events’:( event: _ev of_class ’EVENT’, reception_action: ’check_for_clear’:( ( is_clearing_event(_ev), commit_action ; ( any_clearing_event(_ev, _clr, 3600, 0), set_event_status(_ev, ’CLOSED’), change_event_administrator( _ev, ’Event Processing Rule’) ;

250 IBM Tivoli Enterprise Console: � �� ���

commit_set ) ) ), reception_action: ’duplicate_detect’( first_duplicate( _ev,event: _dup_ev where [ status: outside [’CLOSED’]], _ev -3600 -0), add_to_repeat_count(_dup_ev, 1), drop_received_event, commit_set ),

reception_action: ’check_for_prior_cause’:( prior_causal_event(_ev, _cause, 3600, 0), link_effect_to_cause(_ev, _cause), set_event_severity(_ev, ’ACK’), exec_program(_ev, ’scripts/update_trouble_ticket.sh’, ’%ld’, [_cause], no), commit_set ), reception_action: ’check_for_effect’:( first_effect_event(_ev, _effect, 3600, 0), link_effect_to_cause(_effect, _ev), set_event_severity(_effect, ’ACK’), exec_program(_ev, ’scripts/update_trouble_ticket.sh’, ’%ld’, [_effect], no), commit_set ), reception_action: ’open_trouble_ticket’:( exec_program(_ev, ’scripts/create_trouble_ticket.sh’, ’%ld’, [_ev], no), exec_program(_ev, ’scripts/notify_admin.sh’, ’admin_group’, [], no), commit_set ) ).

process_clearing_event �: process_clearing_event �� ��� �� ��� �

��� �����. � �� �� � �� �� ����� ��� � ����

process_problem_events �� �� ���.

���� ���� ��� ���(�, ��� ���) ��, process_problem_events

�� commit_set � ��� �� �� process_clearing_event �� ����

����.

���� ���� ��� �����, process_problem_events ��� check_for_clear

��� ��� �� �� �� ����� �� � �� ��� �����. �

��� ���� � �� �� �����.

� 5 � �� �� 251

� �� ��� ��� � ���� ����� �� �� ���� ����.(�

���� �� ������� ���� ����� �� ����� ��� � �

��.)

� ��� � ��� ���� �� � �� �� ��� ���� �� � �� �

� ��� ���� �� ��� ��� ����. ��� ���� ��� ����

CLOSED� ���� �� ��� �� ���� �� ���� �� ���� �

��� ��� ����.

rule: ’process_clearing_event’: ( event: _clr_ev of_class ’EVENT’, reception_action: ’clear_all_targets’( all_clear_targets(_clr_ev, _target, 3600, 0), set_event_status(_target, ’CLOSED’), change_event_administrator(_target, ’Clearing Event Rule’)), reception_action: ’exit’ ( commit_set ) ).

�� ��: �� ���� �� �� �� ���. � �� ��� �� ���

��� �� �� �� ����. � �� � �� ��� ���� �� �

��� �����.

process_clearing_event �� ��� ���� ��� �����. ��� ��

� ����� 251 ���� �process_clearing_event ��� �� ��� �����.

���� ��� ���� ���, � �� �����.

process_problem_events �� process_clearing_event �� ���� �� ���

�����. ��� ��� ���� ����� � ��� ���� � �� ��

�� ����� �� � ��� 249 ���� �process_problem_events ��� �

� ��� �����. �� first_causal_event � first_effect_event � ���

first_related_event �� �����. ��� ��� ��� �� � � �� �

����� � �����.

�: � �� ���� �� �����.

rule: ’process_clearing_event’: ( event: _clr_ev of_class ’EVENT’, reception_action: ’clear_all_targets’( is_clearing_event(_ev), ( all_clear_targets(_clr_ev, _target, 3600, 0), set_event_status(_target, ’CLOSED’), change_event_administrator(_target,

252 IBM Tivoli Enterprise Console: � �� ���

’Clearing Event Rule’) ; commit_set ) ) ). rule: ’process_problem_events’:( event: _ev of_class ’EVENT’, reception_action: ’duplicate_detect’( first_duplicate(_ev, event: _dup_ev where [status:outside [’CLOSED’]], _ev -3600 -0), add_to_repeat_count(_dup_ev, 1), drop_received_event, commit_set ),

reception_action: ’check_for_related’:( first_related_event(_ev, _related, _type, 3600, 0), ( _type == ’c’, set_event_status(_ev, ’ACK’), link_effect_to_cause(_ev, _related) ; set_event_status(_related, ’ACK’), link_effect_to_cause(_related, _ev) ), exec_program(_ev, ’scripts/update_trouble_ticket.sh’, ’%ld’, [_related], no), commit_set ), reception_action: ’open_trouble_ticket’:( exec_program(_ev, ’scripts/create_trouble_ticket.sh’, ’’, [], no), exec_program(_ev, ’scripts/notify_admin.sh’, ’admin_group’, [], no), commit_set ) ).

� 5 � �� �� 253

254 IBM Tivoli Enterprise Console: � �� ���

� 6 � � ���, �� � ����

IBM Tivoli Enterprise Console ��� �� ���, ��� � � ��� ��

��� �� �����.

v ������ ���� ���� �� ����� �� � ���

v �� ��� �� �� �� � � ���� �

� ���

��� ���� �� ��� � ���.

v wpostemsg, postemsg, wpostzmsg � postzmsg ��

v tec_agent_demo ���

v SendEvents ���

���� ��� ��

wpostemsg � postemsg ��� ���� �� ��� � ���. � ��� �

�� �� ��� ���� �����. wpostemsg ��� TME ������ �

��� ������� ��� ���� �� Tivoli Management Framework �

�� �����. postemsg ��� TME ������ ���� ������� �

�� ���� �� Tivoli Management Framework ��� ���� ����.

�� ��� �� �� ��� Tivoli Enterprise Console ���� ������.

tec_agent_demo ���� ��� ��

tec_agent_demo ���� ��� ��� �� ��� ��� ���� ����.

��� ��� ��� � � �� ���� ���. �� ���� ��� ��

�� ��� �� ���� ���� ������ � ���� �� ��� ��

�� ���. �� �� ��� ���� ����� �� ��� ���� ��

�� ���� �� �� �� ��� ����� �� � ���. �����

���� ��� � ��� ��� �� ����� ���� ���.

tec_agent_demo �� ��� � �� ���

tec_agent_demo ���� �� ���� �� �� ��� � �� �� ��

� ����. �� ��� ��� events_list� ���. �� ����� �� ��

� ��� �����.

© Copyright IBM Corp. 2003 255

TEC_Start NT_NAV_start NT_NAV_stop NT_Perf_Alert TEC_Stop

��� ���� ��� ����� �� ��� ��� �� ���. �� ��

� ��� ��� �� ��� �� �� ���� � � ���. �� �

��� ��, �� ��� � � ��� ��� ��(�: /test/TEC_Start)� �

�� ���.

256 ���� ����� NT_Perf_Alert ��� ��� ��� �����. �� �

�� ��� ��� ����� � � �� ��� ����� �� �� ���

� �� ���. ��� ��� ��� �����.

v ���� �� ��� � �� �� ��� �� � ���. ��� ���

���� � �� ��� ��� �� ��� ��� �����.

v ��� ��� ��� � �� �� ��� ���(;)���.

v �� � �� �� ����� ��� ��� ��� �� � ���.

v � � �� ��� �� ��(#) � ��� ��� � ���.

v ��� ��� ��� END ���� ���� ���.

NT_Performance_Alert; hostname=mfoster; origin=146.84.39.103; category=0; eventType=Information;sid=N/A;sub_source=PerfMon; id=2000; msg=’\\MFOSTER ; Object: Processor ; Counter: % Processor Time ; Instance: 0 ; Parent: ; Value: 13.586 ; Trigger: > 1.000’; date=’Apr 29 14:36:34 2000’; sub_origin=mfoster;computer=\\MFOSTER; END

��� ��� ���� � �� �� ��� 257 ���� ��� ��� ���

�� ��� �� ���� ������.

tec_agent_demo �� ��

���� ���� ��� ������.

1. bash �� UNIX �����, Tivoli ��� ��� �(�� ��, setup_env.sh

��� ��� �) �� ��� ������.

export TEC_BIN_DIR=$BINDIR/TME/TEC

2. �� ��� � � ���� ����� �� ��� ������.

$TEC_BIN_DIR/tec_agent_demo -data /control_file_dir

control_file_dir� �� ��� � ������. �� ��� ��� events_list

� ���. ���� �� � � � ���� �����.

256 IBM Tivoli Enterprise Console: � �� ���

3. � ���� ����� Enter� �����. ���� ��� �� ��� ���

�����. �� ��� � � �� ���� ���� �� ����� ���

� ����� Ctrl+c� �����.

SendEvents ���� ��� ��

SendEvents ���� �� ����� ��� �� ��� ��� ��� ��

�� ����. ���� �� ��� ���� �����. ��� ��� ���� �

� ��� � ���.

v x�� ��� ���� ����.

v �� ����� �� �� ���� ���� ����.

SendEvents ���� 258 ���� ��� ��� events_list � time_list ���

�� �� ��� ��� �����. ��� ��� ��� ����� ��

� ��� ����� ��� �� ���� ��� ������. �� ���� �

� ���� �� ���� ��� �� � ���.

SendEvents ���� ���� ��� ��� �� ����� ���� ���.

���� ����� ��� ������.

1. Tivoli ��� ������(�� ��, setup_env.sh ��� ������) �

����.

2. bash �� UNIX �����, �� ��� ������. �� � �� ��

�����.

$BINDIR/TME/TEC/contrib/SendEvents.pl \ -d directory -t time

-d directory

��� �(events_list �� � time_list ��)� � ���. � �

� �����.

-t time

���� ��� �� ��( �). � �� � ����. ��� ��

�� ���, ���� ����� �� �� ��� ���� ����

�.

�� �� ����� ��� �� �

tec_agent_demo �� SendEvents ���� � ���� �� �� ���� �

��� �� �� � ��� ���� �� ����. � ��� ��� �

���� �� ���� ���� �� �� � � ���.

�� ��� ����� ���� �� ���� ����� ��� ������.

� 6 � � ���, �� � ���� 257

1. Tivoli ��� ������(�� ��, setup_env.sh ��� ������) �

����.

2. bash �� UNIX �����, �� ��� ������. directory �� �

�� �(��� ��� ��), events_list �� � time_list ��� ���

� ���� �����.

wtdumprl | $BINDIR/TME/TEC/contrib/ParseEvents.pl \ -d directory

��� ��� �� ��� �� ��� ��� ����. � ��� ��, �

� � ��� -d /test3 �� � �������.

��� ��� ��� ��� ��� �� � ���. �� ��, event0001

��� event0001 �� ���. ��� ParseEvents.pl� �� ����

� ����, �� ��� ����� �����. �, event0001 ��� event0002

��� ����� ��� ��� ����.

� ���� ��� ��� ��� ���, tec_agent_demo ���� � �

��� �� ��� ���, �� � � � ���. �� SendEvents �

��� � ��� ��� � ��� �� � ���.

258 IBM Tivoli Enterprise Console: � �� ���

� ��

�� �����, wsetesvrcfg -t �� �� �� ���� �� ���� �� ��

��� ��� ���(�� ��� IBM Tivoli Enterprise Console �� � ��

� ��� ��).

�� ��, ��� �� � � � ���� �������. ��� wrb -comprules

-trace ����, � �� � ��� ��� �� ���� � ������� ��

� ��� ��� �� �� � ��� � �� � ���� ��� � ���.

���� ����, � ���� ������. �� �� ��� ����� ���

��� �� �� ����� ��, ��� �� ���� �� ��� � ���

� ��� �����.

�� ��� � �� ��� �� ��� ����. � �� ��� ��� �

��� �� ��� � ���. �� ��� �� � ��� ��� �� ��

�� �� ��� �����. � �� ��� /tmp/rules.trace���. tail -f ��

� ���� ��� � �� ��� �� � �����.

�: � ���� ���� ��� �� ���� �� �� �� ����� ��

� �� ��� ��� ���.

�� �

�� ��� ��� � ��� �� �����.

�� �

wrb -comprules -trace �� �� � ��� � ���� ��� � � �

� ��� � �� ��� �� ��� ��� � � ��� �� �� �

� �����.

� ��

�� ���� � ��� ���� �� � ��� �����. �� � �

� � �� � ��� ������.

� �� ���� �� ���� �� � ��� �����. �� ��� �� �

� ������.

� �� ��

� ��� �����, � ��� �� ���� ������. �� � �� � �

� � ��� ������. �� ����� � ��� ��� �� ��� ��

�� �����.

directive: trace % Start trace. rule: rule1: ( ... ). % End rule1.

� 6 � � ���, �� � ���� 259

rule: rule2: ( ... ). % End rule2. rule: rule3: ( ... ). % End rule3. % End rule set. % End trace.

� ��

�� �� �����, �� �� ���� ������. �� ��� �� �� ��

����. �� ����� �� �� ��� �� ��� �� �� �����.

rule: test_rule: ( directive: trace, event: _evt of_class within [ ’NT_NAV’ ] where [ ], reception_action: action0:( drop_received_event ) ).

�� �

��� �� �� ��� �� ��� �����.

� �� ���� � �. ���� ���� ��� ��� �� �

� �����.

�� �

��� ��� �� ��� ���� � �

�� � ��� ���� � �

� �� �

� �� �� ���� � �, �� �� �

Prolog �

� �� ��� Prolog� ��� �� ���� � �. Prolog � ��

� � � ��� �����. �(nest) Prolog �� ���� ���

�(� �� �����, � ��� �� �� set_detailed_debugging

(on) ���� ����.)

� �� ��

�� �� � ���� �� �����. ��� �� ��� �� my_first_set �

��� ���� ������.

rule: my_first_rule: ( description: ’Simplerule’,

260 IBM Tivoli Enterprise Console: � �� ���

event: _ev of_class ’HIGH_CPU_USAGE’ where [usage: _usage, hostname: equals ’my_server’], action: auto_ack: ( set_event_status(_ev, ’ACK’), set_event_administrator(_ev, ’john’) ), action: page_administrator: ( exec_program(_ev, send_cpu_usage_to_pager, ’john my_server %d’, _usage], ’NO’ ) ) ).

� ��� �� ��

�� �� �� my_first_set � ��� ������ �����.

[117]=> rule set my_first_set

�: ��� �� �� ��� �� � �� � ��� �����.

�� �� �� � my_first_rule� ������ �����.

[118] -> rule my_first_rule event : 0x2c0b88 of_class HIGH_CPU_USAGE

�: ���� ���� �� ���� �� ��� ��� ���� ��� ��

�.

�� �� �� � ��� ��� �� ��� � �� �����. �� �� �

� ���� �� ��� �� �����.

[119] call condition [120] call usage: _125 [121] exit usage: 95 [122] call hostname: _126 [123] exit hostname: my_server [124] call hostname: my_server equals my_server [125] exit hostname: my_server equals my_server [126] exit condition

120 - 123�� ��(usage � hostname)� �� � �� ���� ��, 124

� 125�� hostname� �� �� �� �� � ���� �(my_server)� ��

� �� �����.

��� ��� ��� ��� �� ��� �� �����. �� ��� ��� ��

�(_)� ����. ��� �� ��� ��� ���� ���, �� �� � �

�� �����.

� 6 � � ���, �� � ���� 261

�� �� �� HIGH_CPU_USAGE ���� my_server� �� �� ��� ��

�(another_host)� ������ �����. � ���� ��� ��� ��� ��

��� ���� ����.

[119] call condition [120] call usage: _125 [121] exit usage: 95 [122] call hostname: _126 [123] exit hostname: another_host [124] call hostname: another_host equals my_server [125] fail hostname: another_host equals my_server [126] fail condition

��� � �, � ��� �� �� ���� ���� ��, ��� � ��� �

� �� ��� � �� �� ��� ����.

�: � ��� ��� ����� �����. ��� �� � � �� �

� ����, �� �� ��� �� ��� � �� � �� �� ��

� �����.

� �� ��

��� ���� ��� ��� ��� �� ��� ����, � ��� ���� �

����. ��� �� �� ���� �����.

v ��� ���� � � ��� �����.

v � �� �� ��� ��� ���� � � ��� �����.

��� ��(auto_ack � page_administrator)� �� �� �� ��� ���

��. auto_ack ��� �(set_event_status � set_event_administrator)�

���. page_administrator ��� exec_program �� ���.

[127] call action auto_ack [128] call set_event_status(0x2c0b88, ACK) [129] exit set_event_status(0x2c0b88, ACK) [130] call set_event_administrator(0x2c0b88, john) [131] exit set_event_administrator(0x2c0b88, john) [132] exit action auto_ack [133] call action page_administrator [134] call exec_program(0x2c0b88, send_cpu_usage_to_pager, ’john my_server %d’,[95],NO) [135] exit exec_program(0x2c0b88, send_cpu_usage_to_pager, ’john my_server %d’,[95],NO) [136] exit action page_administrator

�: ��� � ����� send_cpu_usage_to_pager ���� �� ��� ��

��� �� ��� �� ����. � ����� exec_program� ��, �

�� �� ���� ��� �� ��� �� ���� ���� ���

� �� � ���.

262 IBM Tivoli Enterprise Console: � �� ���

��� ��� �� ��, ��� ��� ��� ��� �� ��� ����� ��

���. ��� � �� �� ��� �� �� �� �����. (_126 ��

my_server �� ��� �� � 134� ����.)

��� �� �� �� �� ����, ��� �� �� ��� ���� ��

� �� �� �� ���� �� ��� ���� ����. �� �� ��� �

� � ��, �� �� �� ��� ���� � ����.

�� � �� ��� �� ��

���� �� � �� �� �� �� ��� ��� ��� ��� ��

�� �� ��� ��� ����, �� ��� �� ����. ����

�� ��� �� �� ���, ���� �� � �� ��� ����.

��� ����, �� ��� ��� ����� ���� ���, �� �� �

�� �� �� ��� �� ���� ���� ����, �� � �� ��

��� �����.

�� ��� ���� ��� �� � �����.

action: ( all_instances(event: _nfs_ev of_class ’NFS_SERVER_NOT_RESPONDING’ where [server: equals ’Pascal’]), set_event_status (nfs_ev, ’CLOSED’) )

Pascal ��� �� �� NFS_SERVER_NOT_RESPONDING ���� ���

� ��� ��� �� ������.

139 - 144 �� all_instances �� �� ��� �� ���� �� �� ��

� ���.

[139] call reception_action action_1 [140] call all_instances(event : _366 of_class NFS_SERVER_NOT_RESPONDING where [server:equals Pascal],0x2c0b88-600-600) [141] exit all_instances(event : 0x2c0ae0 of_class NFS_SERVER_NOT_RESPONDING where [server:equals Pascal],0x2c0b88-600-600) [142] call set_event_status(0x2c0ae0, CLOSED) [143] exit set_event_status(0x2c0ae0, CLOSED) [144] exit reception_action action_1

145 - 150�� all_instances �� �� ��� �� ���� �� �� ���

���.

[145] redo reception_action action_1 [146] redo all_instances [147] exit all_instances(event : 0x2eabf0 of_class NFS_SERVER_NOT_RESPONDING where [server:equals \

� 6 � � ���, �� � ���� 263

Pascal],0x2c0b88-600-600) [148] call set_event_status(0x2c0ae0, CLOSED) [149] exit set_event_status(0x2cae0, CLOSED) [150] exit reception_action action_1

151 - 154 �� all_instances �� �� � �� �� ���� ���� �� �

��� �� ��� ���.

[151] redo reception_action action_1 [152] redo all_instances [153] fail all_instances(event : _366 of_class NFS_SERVER_NOT_RESPONDING where [server:equals Pascal],0x2c0b88-600-600) [154] fail reception_action action_1

� �����

������ � �� ��� �� ���� ����. �� � ���, � ��

�� �� �� ����� � ���. ���� ����� ��� �� �

� �� ��� ���.

v �� ��� ��� ���� ���� � �� ��� ��� �( �)

v �� �� ��� ��� �

v ��� �� ��� �� ���� ��� ��� �( �)

v � ��� �� � �� �� �� ���� ���

�: � ���� �� �� ��� �� ���� �� �� �� ����� �

���� �� ��� ���� ���.

�� ����� ��� �� ������ ���� ���� ��� �����.

============================================ Timing Summary -------------------------------------------- test_rls: Time for last Event: 7.000000000000001e-02 Event Count: 2 Total Time: 4.799999999999998e-01 Events per second: 4.166666666666669e+00 -------------------------------------------- -------------------------------------------- ============================================

�� ��������, � ���� ����� �� ��� ���� ���.

��� wrb -comprules -profile ���� ����� �� � �� �� �� �

�� ���� ����� ��� � ���.

� ���� ����� �� ��� ����� �� ��� ��� ���� �

���� ������ ������. ���� ���� ��� ��� �� �

$DBDIR/tec/profile ��� �����. ���� ���� �� �� ��� ��

264 IBM Tivoli Enterprise Console: � �� ���

�� ��� ��� ��� ���� �� � �� ��� ���� ���, ��

� �� � ���, ����� ��� � ����.

��� �

�� ��� ��� � ����� �� �����.

�� �

wrb -comprules -profile ��� �� ����� �� ��� �� � �

�� �� �� �� ��������.

� ��

�� � ��� � ��� ���� ���� � ��� ���� �� �

��� ��������.

� �� ��� �� ��� ���� ���� �� ���� �� �� ���

�����.

� �� ����

�� � ��� ��������, � ���� �� � ��� ���� ����

��. �� ����� � ���� ������ �� ��� �� �� ����

�.

directive: profile % Start profiling. rule: rule1: ( ... ). % End rule1. rule: rule2: ( ... ). % End rule2. rule: rule3: ( ... ). % End rule3. % End rule set. % End profiling.

� ����

�� �� ��������, �� ��� �� ��� ���� ���� �� ���

���. �� �� ������ ����, profile_off ���� �� ��� ���

���. �� ����� �� �� �� ������ �� ��� �� �� �

����.

rule: test_rule: ( directive: profile, event: _evt of_class within [ ’NT_NAV’ ] where [ ],

� 6 � � ���, �� � ���� 265

reception_action: action0:( drop_received_event ) ).

��� �� �� ��

�� �� �� �� ��� �� � �� ���� ���, ��� ����

��� �� �� �� � ���. � ����� ���� ��� ���� �

� �� �� ���. �� �� ���� ����� ���� �� ��

�� ��� �� �� ���.

��� ���� ��� ���� QUEUED ��� �� ��� �����. ���

���� ��� ����, �� ��� ��� ��� PROCESSED� �����. �

�� �� ���� ����� �� ����� .tec_config �� ��� ���

���.

tec_benchmark_report_period=report_period tec_benchmark_sample_period=sample_period

��� report_period� ���� ��� �� ���� ����, sample_period

� ��� �� � ���� ���� �� �� ���� �����. ��� ���

�� ��� �, ��� ��� �� �� �������.

��� ���� ��� �� ��� ���� ��, tec_reception �� ���

�� ����. �� ����� ��� �(�� �� ��)� �����.

=================================================== Event Throughput Statistics =================================================== Reporting Interval is 2 seconds Sample Interval is 60 seconds Actual Period 8 seconds Events Received: 592 Event Arrival Rate: 74.000000 events/second Events Processed: 700 Event Processing Rate: 87.500000 events/second ------------------------------------------------ Total Events Waiting: 0 Total Events Received: 6604 Total Events Processed: 5666 Processing Backlog: 938

266 IBM Tivoli Enterprise Console: � �� ���

�� ��� �����. �� ���� �� ��� �����.

v �� ��� ��� �� � �� ��

v �� �� �� � �� ��

v ��� ��� � � ���

v ��� ��� � � ���(���� � ��� �� ���)

�� ���� ��, �� � �� ���� �� � �� ���� �

� ��� ��� �� ��� ��� �� �� �����(��� ���� ���

���� ���� ��).

� 6 � � ���, �� � ���� 267

268 IBM Tivoli Enterprise Console: � �� ���

� 7 � ��� � ��� � �

IBM Tivoli Enterprise Console �� � �� �� Prolog �� �� ����

�����. IBM Tivoli Enterprise Console � ��� � ��, Prolog �� � �

�� �� ��� �� ����� ��� ���� �� �� � �� �

� GUI �����.

�:

1. � ��� � ��� ��� � ��� �� �� � � ��, �� � �����

�� �� ���� ����.

2. wrb -crtrb ���� ��� � ���� � � ����� � � ��� �

�� ��� EventServer���. � ��� ���� � ���� ��� � ��

� � ��� � ��� ���� ��� �� wrb -imptgtrule ��� ����

EventServer � ��� �� �� � ��� ���� ���� ���.

3. � ��� ��� ���� ��� � �� ��� ���� � ��� � ���

�.

4. � ��� ��� � �� ��� ��� ����� � ���.

5. upgrade_gui.sh ��� ���� �� 3.6.2 �� ��� � ��� ��� ��

�� 3.7 �� ��� � ����� �� ���� � ���� �� � ��

�. ��� �� � ��� ����� �� � �� �� ��� �� � �

��� ���. � ���� �� �����, �� � �� � ��� �� �

��, ��� ���� ��� ���. upgrade_gui.sh ��� �� �� �

�� IBM Tivoli Enterprise Console �� � ��� ���� ������.

� �� ��

� ��� � � �� �� Prolog� �� ��� ���� ����. � ��� �

��� ���� �� �� �� � �� � � ��� �� ��� ����

��� ���� ��� �� �����. � �� GUI� ���� ��� ��

�� ��� �� �� � ���. �� ��, � ��� �� � ��� �

����. � �� �� �� � �� �� Prolog ��� ���� ����.

� ��� ���� ��� �� ���� �� ��� ���� ���� ��

���. �� ��, ���� ��� � 60 �� �� ��� ��� �� �

���. � ��� ����, � �� ��� ���� � ��� ����, �

� � ��� �� ��� �� � ���.

© Copyright IBM Corp. 2003 269

��� ��� ��� � �� ����

GUI � ��� UTF-8 ���� ��� ���� ���, � ����� UTF-8 �

��� ���� ���� ����. �� �� ���� �� � ��� �� �

�� �� ��, �� ��� �� �� ���� � ��� �� � ��

�. �� ��, � ���� ����� �� so-v ���� � �� ��� UTF-8 �

��� ������. wiconv ��� �� �� ��� Tivoli Management Framework

���� ������. � � BAROC �� ����� ��� UTF-8 ���� �

� ��� 37 ���� ��� ��� � ��� � 52 ���� ��� ���

BAROC ���� ������.

� �� ��

� ���� ���� � ��� ���� �� � ���� � � ��� ����

�, �� ��� ��� ����� ������. ��� ��"� �� ��� ��

���� ���� �����.

270 IBM Tivoli Enterprise Console: � �� ���

�� ��� �� �

1 272 ���� �� �� ���

2 27 ���� �� � ��� ���

3 273 ���� ��� � ��� ���

4 273 ���� �� � �� ���

5 291 ���� �� �� ���

6 275 ���� �� �� ���

7 275 ���� �� � ���

8

9

A

B

� 7 � ��� � ��� � �� 271

�� ��� �� �

C 285 ���� ��� � ���

D

E

F

G 275 ���� �� � ���, 285 ���� ��� � ���

H 291 ���� �� �� ���

I 292 ���� �� ��� ����

J 294 ���� ���� �� � � ����

� ��� �� �� ���� � ���� ��� �� � ���� ��� ��� �

� ���� �� ��� � ���� ����� ���.

� ���� BAROC �� ��� ��� ��� ��, � ���� ����� �

�� �� ��� ��� ��� ����� �� ���.

�: � ��� �� ��� ���, �� � �� �� ��� �� ��� ��

�� �����. � ��� ���, �� � �� �� ��� �� ��� �

�� �� �����. Tivoli ����� ���� �� �� ����� Tivoli

Management Framework �� ���� ������.

�� ��� � �� ��� ��� ��� � �� �� �� � �� ���.

�� ���� Tivoli ��

� �� �� ��� �� senior

� �� �

� ��� ����� Tivoli ����� ��� �� ����� ��� ��� �

� �����. � ��� ������� �� � ����. ��� �� ����

�� ��� �����.

� ��� �����, ��� �� � ���� � ���� � �� �� ���

���. � ���� ��� � ���(���� ���)� ��� � ���� �

� ������. � � ���� �� � ����. ��� � ���� ���

��� � ������. ��� � ���� �� ��� ��� � ����� �

����.

272 IBM Tivoli Enterprise Console: � �� ���

�� � ��� ��

�� � ���� �����, �� � ���� � ���� � ��� � ��

��. �� �� �����.

� � ���� �� ���� � ��� ��� ���� �����. � ��� �

��� ������, �� �� ��� �� ����. �� � � �� ��� �

��� ��� � ���.

� � �� �

� � ��� ����� �� ��� ������. � ��� �� �� ��� 17

���� �� �� � � ��� ������.

� 7 � ��� � ��� � �� 273

1. T/EC � ��� ��� � �� -> � � ��� � �� new_set�� � � �

� ��� T/EC � ��� �� ������.

2. �� ��� � ��� ��� ���� new_set� �������.

3. � � ��� ��� ���� Enter� �����.

new_set ��� � � �� ���� ���� ��� � �� ��� ��� �

� �� ����.

�: �� � ��� � ��� ��� ����� ����� ��� ����� �

�� ��� ��� ���.

274 IBM Tivoli Enterprise Console: � �� ���

� �� ��

�� �� �� � �� ��� � �� ���� �� � �� ���� �� �

� ���� �� � ��� �� � ���.

� ��� �����, TEC � ��� ��� � �� -> � �� ��� � ��

� �� �� ������. �� �� �� � �����.

� � �

� �� �� ���� ����� � ���� ��� ����, ��� ����

�� ���� ��� ��� �� �� ����.

� �� � ��� ��� ���� �����. ���, ��� �� ���

�� � ��� ���� � ���. �� ��, �� ���� login ��

su �� ��� ���� �� ���� �� ����� � ���.

Logfile_Login � �����, Logfile_Su � �����, ��� Logfile_Passwd�

�� �� ��� ���� ���. �� ��� ������ ���, �

��� �� ��� ��� � �� �� ���� �� ���� ���. ��

�� �� �� ���(��� ��� Logfile_Login � Logfile_Su �� ����

�� ��)� �� ���� ��� fire_on_non_leaf ���� �� � �

��(�� ��� 80 ���� �fire_on_non_leaf�� ������).

�: � �� ��� ��� � ��(� �� ��)� ���� �� ��� �

����.

� �� �� ��� ����.

v ��

v ��� ���

v ��

v ��

� 7 � ��� � ��� � �� 275

� �� ����� �� ��� ������.

1. � �� ��� � -> � � -> ��� � �� � �: New Simple Rule �

� ������.

2. �� ��� ��� �� �� ��� ��� �� ������. � ��� �

� �� ��� �� ���� � �����.

3. ��� ���� ����� �� ��� ������. ��� ���� 41 ��

�� � 2 � ���� ��� ��� ���� ���.

a. � � ��� ��� ���� � ��� � �� ������.

276 IBM Tivoli Enterprise Console: � �� ���

b. �� ��� ���� ���� � ����.

v �� �� ��� ��� ���� ��� ��� ���� � �� �

� ��� �� � � � ��� ���� � � ��� ��� ��

�� �����.

v ��� ��� � ��� ���, �� � �� ��� � ��

� �� �� �� ��� ��� �����.

�� ��, ����� �������, su ��� ��� �� ���� �

� �� ���� �� ������. � su� ����, su�

�� �� ���� � ���. ���� Logfile_Su, Root_Login_Success,

Su_Success, Root_Login_Success_From � Su_Failure� ���. �

� ��� ���� ���� ����.

c. ��� ���� � � ��� ��� ���� �� �� ��� ���

���� �����, ��� ���� � �� ��� ��� �� ��

���.

d. ��� � ����� ����� ��� � � �� ������. ��

� ��� �� ��� �����.

�� �� � �� ��� �����.

� 7 � ��� � ��� � �� 277

4. ��� ����� �� ��� ������. �� ��� 73 ���� ��� �

��� ���� ���.

��� ����, ��� ��� ���� �� �� ��� �� �� ����

� �� �� �� ���� ��� �� � ���.

�� ��, Host_Down ��� ���� ���� hostname ��� �� ��

� �� ��� ��� ��� ��� � Host_Down ���� ��� �

�� ��� ����.

��� ��� ��� � ���� �� BAROC ��� ���.

a. �� ��� ���� ��� ��� ����� �� � �� �� �

� ������.

b. �� �� �� ��� ���� ���� �� ��� � ����.

c. �� ���� �� �� ��� � ����.

in list �� ��� �� ���� ���.

none �� ����.

not in list

��� �� ���� �� ���.

d. � �� ��� ��� �� ������. �� �� � ��� ���� �

���� ��� �� �� Enter �� �����. not in list� �� in

list ��� ���� �� ��� �� ��� � ���.

e. ��� ��, �� � �� ��� �� ��� �� ��� �����. ��

� �� �� ��� �����. �� ��� � �� ���� ��� ��

��� ���� �� ����.

278 IBM Tivoli Enterprise Console: � �� ���

f. ��� �����, �� �� �� ���� �� ��� � �� ���

�����. � � ��� �� �� ���� ����.

g. �� ��� �� �� ������, �� �� �� ��� ���� ��

��� � ����. �� �� �����. ����� �� �� ���

����.

h. �� ��� ��� ��� ��, ��� � ��� � � �� ����

��. �� �� � �� ��� �����.

5. ��� ������. ��� ���� � ��� �� � ���� ��� ��

� �����. ��� ����� �� ��� ������.

a. � � ��� ��� � � �� ��� ������.

� 7 � ��� � ��� � �� 279

� ��� �� ��� �� ��� ����.

� �� ��

�� �� ��� �� ���� �����.

�� ��� �� ��� �� � ��� ��� �����.

�: ��� ���� �� �� ��� ��� ��� ���.

b. ��� ��� ��� � � ���� �� ���� �� �� ���

���. �� ��� �����, � ��� � �� �� ��� ����

���� �� � ����. � ��� ��� ����.

�� �� ��

���� ��� � ���� � ���� ��� �

���� ��� � ���� ��� � N

���� �� � �� �� ����� �� ��� � ��� Change_Severity ���� ����

���� ��� ��� ��� �

���� �� � �� �� ����� �� ��� � ��� Change_Severity ���� ����

���� ��� ��� ��� �

���� ���� � �� �� ����� �� ��� � ��� ���� ���� �

���� ���� � ���� ���� � N

���� �� ��� � �� �� ����� �� ��� � ��� ���� �� ��� �

�� ��� �� � ��� ��� �� ��� ���� � �

c. �� ��� ����, � �� ��� �� �� ��� �����. � ��

��� � �� � � �� ��� ����.

280 IBM Tivoli Enterprise Console: � �� ���

d. �� ��� ���� �� ��� �� �� ������. � �� ���

��� �����. �� ��, ���� �� � �� ����� ���

��, �� ��� ���� ��� �� ��� �� �� ��� ���

� �� � � ���.

��� ����, �� �� ���� ��� �� � �� ��� ���

��. � ��� ��� �� ��� ����.

e. � ��� �� �� ���� �� ��� � ����. � ��� ��

�� ���� ���.

�� ��

��� �� ��� ��� �� � �� �����. ���� � � ��, ��, ��, ��, �� � ���� � �

���.

�� �� �� ��� �� � �� �����. ��� OPEN, RESPONSE, ACK � CLOSED� � � �

��.

��� �� ����� msg ��� �� �� ���� �� ��� ��� �����. �� �� ���� ��

��� ��� �� � ���.

��� �� ���� �� ��� ��� ����. � ���� TEC_RULES ������ � tec_forward.conf

��� ServerLocation ��� ���� � ���. tec_forward.conf ��� �� �� ��� 177

���� �forward_event�� �� ��� ������.

� ��� � �� �� CLOSED� �� �� ��� �� ��� ��� � ���� �� � ���. ��,

�� � ���� repeat_count ��� �� ���� �� ��� ���� �����.

� 7 � ��� � ��� � �� 281

�� ��

��� �� ��� ��� ������� ��� ���� ����� ���. � ��� � �� �� ��� �

�� ��� � �� �����.

��� � ��� ����� ��� ��� ��� ����� ��� � �, �� ��� �

����� � ����. �� ��, ��� ���� �� ���� ����� ��� �� ��

���. ��� � ��� �� ��� �����.

� ���, ���� ��� ��� �� ���� �����.

� ��� ����� ��� ������ �� ��� ���� �����.

282 IBM Tivoli Enterprise Console: � �� ���

�� ��

�� �� �� �� �� ����� ����� ���. � ��� � �� �� ��� ��� ���

� �� �����.

��� � ���, ��� ��� �� ��� ���� �� ����� ���� ��� �� �

� �� �� ��� ������. � � ��� $BINDIR/TME/TEC���. ��� ��� ���

�� ���� �����.

f. � ��� ����, � ��� ��� �� �� ��� �����. ��

�� ��� ���� � �� ��� � ����. ��� � � �

���. �� � ��� ��� ���� �� ��� �����.

� 7 � ��� � ��� � �� 283

g. �� �� ���� ����� ���� �� � ��� � � �� �

� ������.

h. �� � ��� ��� �� � � ������. ��� � �

(�: msg � �� �� �� �)� � ����� ���� ��� ���

�� ������. �� � ��� ��� ���� ����, � ���

��� � � ��� � ����� �����. ���� �� ��� �

���� wruntask ��� �� �� ����. ��� � ��� � �

�� ��� ��� �� ���� �����. wruntask ��� ��

�� ��� Tivoli Management Framework ���� ������.

�: ���� ����� � �� �� ��� �� � � � �� ��

� �� � � ���� ���(�, �� � ��� ��� ���

� �), � � -h event_server_hostname -l TaskLibraryName�

�����. �� � � ���� ���� ��, �� �� ���

�� ��� ���.

284 IBM Tivoli Enterprise Console: � �� ���

i. ��� �� �� �� � ��� ��� �� ��� �����. �� ��

�� ����� � � �� �����.

j. ��� � � �� �� ���� � � �� �����.

�� � �

�� �� ���� �� ��� ��� �� � ��� �� � ���.

�� �� ��� ��� ���� �� ���� �����. �� ���� �

� � ��(� ���� � �� ���� ��� �� ���� �)� ��

� ��� �� ���� ���. �� ��, Host_Down ���� NFS �� ��

� �� ���, NFS_Server_No_Response ���� ��� ������ ��

��� ���. � ��� ����, � �� � ���� ���� �� �

� � ���.

�: � �� ��� ��� � ��(� �� ��)� ���� �� ��� �

����.

�� � �� �� � �� ���� ���.

� 7 � ��� � ��� � �� 285

v ��

v ��� ���

v ��

�� �� ����� �� ��� ������.

1. � �� ���� � -> � � -> �� � �� �� �: New Compund Rule

�� ������.

�� ��� ��� �� �� �� ��� ������. � ��� �� ��

��� �� ���� � �����.

2. ��� ���� ����� �� ��� ������. ��� ���� 41 ��

�� � 2 � ���� ��� ��� ���� ���.

286 IBM Tivoli Enterprise Console: � �� ���

a. ��� ���� � ��� � �� ���� ���� ���� ���

� � ����. � ���, � ���� �� ��� ���� �� �

�� ���� � � ��� ��� ��� ���.

b. � � ��� ��� ��� ���� �� ��� ���� � ��, ��

�� �� ���� � �� ��� ��� �� � �� �� ���

���� ������. �� ���� ��� ��� �����.

c. � �� �� �� ��� ���� � ���, �� �� ��� ��

� ���� � ����. �� ��� �� � � � ��� ��� �

��� ������.

d. ��� � ����� ����� �� � �� ������. � ��� �

��� ��� ���� � � ��� ���� �����. �� �

� � �� ��� �����.

3. ��� ��� �� ��� ���� ��� ������.

�� ��� ���� ���� �� �� ��� ��� ��� ����.

� ���� �� � �� � ���� �� � ��� is-caused-by ��

� 7 � ��� � ��� � �� 287

is-canceled-by �� �� ��� ������. � ���� �� � ��

� ���� �� � ���, causes �� cancels ��� ������.

� ��� ���� ����� ��� �� ��� ��� ��� ���� �

� ��� �����. �� ��, NFS_No_Response ����

Host_Unreachable ���� �� ����. � Host_Unreachable ����

Host_Up ���� �� �� �����. Host_Up ���� ��� �,

NFS_No_Response ��� Host_Unreachable ��� ���� �� CLOSED

� �����. � ��� ���� �� �� ����� �� ��� ����

�, ���� ��� ����� �� ��� ���� ���� ��� ����

��.

���� �� �� ��� �����, �� ���� cancels(�� is canceled

by) ��� ��� �� � ���. ��� � ���� ���� ��� �

����.

a. ��� ����� ��� � �� �� �� ������.

b. Correlation Type ���� �� �� ��� � ����.

�� ��

causes ��� ���� � ���� ��� � ���� �����. � ���(�� ����

Host_Unreachable ���)���� �� �(date_reception � event_handle)� � ���(���

� NFS_No_Response)� cause_date_reception � cause_event_handle ��� �����. � � �

�(� ��� �� � ���)� ��� ��� ���, �� ��� �����.

288 IBM Tivoli Enterprise Console: � �� ���

�� ��

is caused by ��� ��� � ���� ���� � ���� �����. � ������� �� �

(date_reception � event_handle)� � ���� cause_date_reception � cause_event_handle ��

� �����. � ���� ��� � ���� ��� �����. � ���� ��� �� �

� ����� �� � ���� ��� ����.

cancels ��� � ���� ��� ���� � ���� �������.

is canceled by ���� � ���� ��� ��� � ���� �������.

c. 5� � �� �� �����. � �� �����, � �� � �� �

�� ��� � Enter �� �����. ��� �� �� �� ��� ��

�� ���� ��� ���� �� ��� ������.

�: �� �� ���� ��� ��� �� ���� � � � ��

��� ���� �, �� �� �� �� ��� �� ���.

�� ��, �� ��� ��� �� �� Host_Unreachable ����

�� ��� �� Host_Up ���� �� ������. Host_Up �

��� �� ���� � � ��� �� ��� ���� �� �

� ���� �� �� �� � ���.

d. �� �� �� �� �� ������. �� �� ���

��� ���� ��� ���� ��� ��� �� �� �����

� �� �����.

e. ��� � ��� ������ �� ���� �� �� ��� � �

� ��� �� �� ��� ������. ���� �� ��� ���� �

� ��� � �� � �����.

f. ���� � ��� ������ �� ���� �� �� ��� �

�� ��� �� �� ��� ������. ���� �� ��� ����

�� ��� � �� � �����.

� 7 � ��� � ��� � �� 289

g. ��� � ����� ���� �� �� ���� �� ��� �� �

�����.

h. ��� ��� � �� e, f � g�� ������.

i. ��� � ����� ���� ��� �� � �� ������. ��

�� � �� ��� �����.

j. ��� � ����� ���� � �� ��� ������. � �� ��

� �����.

290 IBM Tivoli Enterprise Console: � �� ���

� �� ��

� ��� ����� �� ��� ������.

1. � �� ��� � �� -> ��� � �� � ���� �� TEC � ��� �

� ������.

2. � ��� -> ��� � �� � �� ��� ������. � ���� ��

�, � ��� ���� ��� �� ����.

3. � ��� -> ��� � �� � �� ������.

4. �� � � ��� ���� ��� �� � ��� ��� ������.

� 7 � ��� � ��� � �� 291

� ��� ���

� ��� ���� � ���� ��� ��, � �� ��� ��� ��� �

� ��� � ���� ����� ���. � ���� ������ �� ��� �

�����.

1. ��� �� � ��� ���, ��� � ��� � ���� ���� � �

� � ��� ��� �� ������.

� �� ��� � �� ��� �����. �� ��� 259 ���� �� ���

� ������.

292 IBM Tivoli Enterprise Console: � �� ���

2. ���� �����. ��� ��� �� �����.

3. ��� � ��� �� � ��� �� ������.

� 7 � ��� � ��� � �� 293

4. ��� � ���� ��� ��� ����� ���, �� � ��� � ��

�� ��� � �� � ��� �� �� ������.

5. � ��� �� � ���� � ����.

6. �� � ��� �����.

��� �� � � ��

� ���� ����� ��� �� � ����� BAROC ��� ����� ��

� ��� ���� ����� �� ���. ��� ��� ���� �� ��,

�� ��� ������.

1. Tivoli ����� ��� �� ��� � ���� ��� � ����.

2. ��� ��� ������ � ���� �� � Tivoli ����� ��� �

� ��� � ���� ��� � ����.

294 IBM Tivoli Enterprise Console: � �� ���

� �� �

� �� policy�� �� ���� �� � ��� �� �� ���� � �� �

� �����.

��� � policy �

���

��� ���� ��� ���� SAP R/3 ��� �� ��� ��� ��

�� 15 ��, ��� ���� � �� �� ��� �� ��� ���. ��

��� ���� ���, ��� ���� �� �� 2 ��� ��� ���. ��

� � �� ���� ������� ��� �� ��� �� � � �

�� ���� ���. ��� R/3 ���� ���� ����� � Tivoli AMS

Module for R/3� ���� ���.

�� � � policy�� ��� ����.

���� R/3 ������ ���� �� ���� ��

(SAP instance=PRD), �� ���� 15 ��� ���� ���

�� 2� ����, �� ���� � �� �� ���� ���

�� 2� �����.

��

��� � �: ���� �� ��� �� �� �� ���. ��� �� �

� ���� ��� �� ���� �� ���� �����. (�� ��, ���� �

�� ��� IP ��� $origin, ���� ��� $hostname ��� �����.) IBM

Tivoli Enterprise Console �� � ��� ������ IBM�� ���� ����

���� �� � � �� ��� �� �����.

�� �� ��� ���� ���� ����� ����� ��� � � �� �

� �� �� � ���, �� �� �� ��� �����. ��� �� ��

���.

$EVENT_CLASS

��� ���� �����.

$SLOTS

��� �� ��� ��

���� ��� ��� ��� � �� � ���� ���� ��, ��� ��

� �� �����.

$EVENT_CLASS=Sentry2_0_diskusedpct $SLOTS=origin sub_origin source sub_source...

� 7 � ��� � ��� � �� 295

� ��: � �� ���� �� � ��� �� �� �� � ���. policy

�� �� �� ��� ����.

���� R/3 ������ ���� �� ���� ��

(SAP instance = PRD), �� ���� 15 ��� ���� ���

�� 2� �����.

��� �� � ��� ���� R/3 ��� �� � ���.

v ���� ��� ��� IP �� �� ��� ��� � �� �� ���� �

�� �� ��� ��� �

v AMS Module for R/3� ��� ID� ���� ���� sub_source ��� �

��� ��� ��

� ������ ��� ��� �� ���� Distributed Monitoring � R/3 �

�� ������. Distributed Monitoring ���� � ��� ���

Sentry2_0_Base��� ���� R/3 ��� ��� ���� � ��� ���

SAP_Alert��� �����. � ��� ���� � ��� �� ��� �

���.

296 IBM Tivoli Enterprise Console: � �� ���

� �� ��� ��� � ��� �� ����. � �� �� ��� �� �

� ��� � �� ��� ��� �� � ���.

policy� � �� �� ���� ���� 15 � ���� � ��� ���

����. � �� ��� ����� � �� �� �� ��� �������

� � ���. �� �� �� ���� � ��� ������.

policy� � �� �� ��� �� ��� �����.

Event Class: [Sentry2_0_Base, SAP_Alert] Conditions: sub_source in [PRD] status not in [CLOSED] severity in [CRITICAL, FATAL] Actions: 15 minutes after event is received send e-mail

� 7 � ��� � ��� � �� 297

��� ��� ����� ���� ��� �� ��� �� �� � � ��, �

�� ��� ��� ��� CLOSED� �� �� ��� ����.

policy� �� �� �� ��� � ���.

�� ���� 1�� ��� ���� ���, �� 2�

�����.

Event Class: [Sentry2_0_Base, SAP_Alert] Conditions: status outside [CLOSED] severity in [WARNING] Actions: 60 minutes after event is received e-mail administrator

298 IBM Tivoli Enterprise Console: � �� ���

Escalation_policy�� �� � ��� � �� ���.

UNIX ������� ��� � �� ���

���

UNIX ����� �� ��� ��� ��� ��� � ��� �� �� �

� �� ���� ����� ���. ��� ��� ���� ��� �� ����

su ��� � �� ��� ����� �� �� ��� � �� ����.

��� ��� �� �� ID� ���� �� ��� ��� �� � ���

�. ��� �� ��� ��� � � �� ����� � ���. �

�� ��� 10� 6� �� ��� � �� �� ��� �� �� ��

�� �� � ��� ���� � ���.

�� � � policy�� ��� ����.

� 7 � ��� � ��� � �� 299

���� �� Su_Failure ���� �� �� �����. �� �����

Su_Failure ���� 10 �� 6� �� �� �� � �� ���� ����. ��

���� 6� �� �� ���� ���� �� ��� ���, �� ��� �,

�� ���� � ��� ����.

��

� �� ��: UNIX �� �� ���� ��� �� ���� ��� �

� � � �� ���� ���� /usr/adm/sulog �� ��� ������ ���

�����. � ���, ���� ��� �� ID� ���� ���� �� ��

� ��� ���� �� ��� WARNING� ���� Su_Failure ���� ��

��.

� ���, Su_Failure ���� �� ���� �� � ���. ��� ��� �

���� TEC_CLASSES ������� tecad_logfile.baroc ��� ���� �

��� � ���� WARNING�� HARMLESS� ��� ���.

���� �� BAROC ��� �� �, ���� � ��(dup_detect ��(facet)�

YES� ��� ���)� ��� ��� ������. � ��� ��� �� �

�� �� � � �����.

� �: � ���� WARNING�� HARMLESS� �����, ��� �

� policy� ��� �� �� �� � � ����. � � policy�

�� �� ��� �� � ���.

���� �� Su_Failure ���� �� �� �����.

��� � policy� � �� �� �� �� ����.

Event Class: [Su_Failure] Conditions: Actions: When event is received Set Status to [CLOSED]

� �� ���� �� ���� ��� �� ��� �� CLOSED� �����.

� � ��� � � CLOSED ���� ���� ��� �����, ���

� ���� �� �� ����.

policy�� �� �� ��� ����.

�� ����� Su_Failure ���� 10 �� 6� �� �� �� � �� ��

�� ����. �� ���� 6� �� �� ���� ���� �� ��� ���...

policy� � �� � ���, �� �� ��� ��� ������.

300 IBM Tivoli Enterprise Console: � �� ���

Event Class: [Su_Failure] Conditions: Actions: When event is... received Set Status to [CLOSED] When event occurs 5 times within 10 minutes Set Severity to [WARNING]

� ��� dup_detect �� ���� 10� �� ��� 5�� ���� WARNING

�� ���� �����. � ��� �� ���� ��� ���� �� ���,

�� ��� �� �� ID, �� ��� �� �� ID � ��� ���

�� ID� ���. � ��� �����, 5�� �� ��� �� �� � �

��� ���.

policy�� ��� �� ���� �� ����� �� ���� ��� ���

�� ���� ��� � ���.

�� ��� �, �� ���� � ��� ����.

�� �� ��� �� ��� policy� � �� � ���. � ��� ��� OPEN

�� ���� ��� � � ���� ���� � ��� ���� ���� �

��� �� � ��� ��� �� �� �� � ���. ���� �� �

�� �� � ���� ��� � ���.

Event Class: [Su_Failure] Conditions:

� 7 � ��� � ��� � �� 301

Actions: When event is received Set Status to [CLOSED] When event occurs 5 times within 10 minutes Set Severity to [WARNING] When severity is upgraded Set Status to [OPEN] e-mail administrator

�� ��� �� ��� policy� � ���.

�� ��� ���� � policy� �� �� �� ����� �� ��� �

� �� ��� ��� ��� �� � ���. �� ��, �� ����

�� ��� � �� ID�� �� ��� ����, �� �� ��� �� �

���.

Event Class: [Su_Failure] Conditions: hostname in [dataserv1, dataserv2] to_user in [root] Actions: When event is received Set Status to [CLOSED] When event occurs 5 times within 10 minutes Set Severity to [WARNING] When severity is upgraded Set Status to [OPEN] e-mail administrator

302 IBM Tivoli Enterprise Console: � �� ���

� ��� �� ��� ��

���

�� ��� �� ���� ����� � � ����� ���� ���.

�� �� ���� �� �� ���� � ��� �� ��� �

�� ���� �� �� ����. ��, �� ��� �� �� ���� ���

� ����. ��� ��, ��� ������ ���� ��� ���� �

�� �� ��� �� �����.

��� ��� ��� �� � ����� � ����� ����� ���� �

� ���� � � policy�� ���.

� � �� � �����

�� ��� ���� ���. � ���� ����, �� � ����

�� ���� ��� ���. � � ����

���� �� ��� ����, ���� � � ���� ��

�� �� 5 � �� �� ���� ���.

��

�� ��� �� ��: � policy� � �� �� ��� ���� ��

� ���� ���� ���� ����. ����, �� �� �# ��� �

���� ������. ��� policy� ��� �� ���� �� � ���.

� 7 � ��� � ��� � �� 303

��� �

�� 10MB�� ��

�� 20MB�� ��

���� ��� 30MB�� ��

�� ���� ��� ��� ��� ��� ��� ���� � � ��� �

�� ��� ��� �� ������. � ���� ��� �� ����� IBM

Tivoli Enterprise Console ���� ���� ��� ��� ��� ���.

� �: �� � ���� ���� �� � � policy� � �� �� ��

� ���. policy� �� �� ��� ����.

� � �� � ����� �� ��� ���� ���.

� ���� ����, �� � ���� �� ���� ��� ���.

��� � ���� �� ��� �� ��� ��� �� ��� �����. �

��� ���� ���� ���� ���� ��� �� ������. �� ��

��� �� ���� � ���(�: host_down ���� host_up ���� �� �

�� � �). � �� � ����� �� �� �� ���� �� ���� �

� ��, �� � ���� ���� �� � ���� �� �����. � �

�� ���� ��� Sentry2_0_Base���. � ������ ���� �� ��

��� ���� � ��� ����� ���� � ���� ��� �� �� �

� � ���� ���� �����.

���� �� ��� ��, ���� ���� �� ���� ��� ���

���. �� ���� �� �� ��� ��� �� � � �� �

��. �� � � ��� ��� �� ���.

[Sentry2_0_Base] is canceled by [Sentry2_0_Base] within a 1440 minute period if: [Sentry2_0_Base].status equals [Sentry2_0_Base].status

�� �� 24���� ���� ��, ��� �� �� � � ���. ���

� �� ���, �� � �� ���� ���� ���� �� ���� �� �

��� �� ���� �� ��� �� ����� � �� ���. ��� ��,

���� ���� �� ���� �� ��� �� �� �����. �� � �

��, ����(open) ���� � �� ��� ��� �� ���� ����

����. ���

is-canceled-by ��� ���� ��� �� �� ���� �� ����.

� ���� ���� �� ��� ���� �� ���� ��� ���� �� �

� �� �� � ���. � � ���� ���� ���� �� ���

��� �� �� � �� ���.

304 IBM Tivoli Enterprise Console: � �� ���

�� ��

origin ��� ��� IP ��

sub_origin ��� ��� ��

source SENTRY

sub_source � ���� ����� �� policy region

collection � ���� ����� ��

monitor �� ���� ��

probe_arg ��� ���� ��� �

�� �� ��� � �� ��� �� ��� �����. � ���� causes �

� is-caused-by ��� ���� is-cancelled-by �����. ��, �� �� ���

� ��� ��� ��� ���.

� 7 � ��� � ��� � �� 305

� �� ��� ����, ��� �� �� ��� � �� �� �����.

� �� �� � � ���� ���� ��� ���, �� 24�� �� ���

�� ��� ���� �� �� ���� ����. �� � �� �� ���

����� ���.

policy�� �� �� ��� ����.

� � ���� ���� ��

��� ����, ���� � � ���� �� �� ��

5 �� �� �� ���� ���.

��� � �� ���� � �� ���. ���� ���� 5 �� ��

��� ���(Sentry2_0_Base)�� ���� � �� ���� �����. ���

�� �� ��� � �� �� �����.

306 IBM Tivoli Enterprise Console: � �� ���

� ����� �� ��� � ��� �� �� ���.

�� ��� ��

���

��� � ��� NetView ������� �� ���� ����. � �� ��

�� ��� � ��� ����� ����, �� ���� �� ��� ��

���� ��� � ���� ���� ���� ���. ���� � �

���� �� � � ���� ���� ��� �� ��� �� ����

�� �����.

� 7 � ��� � ��� � �� 307

� policy�� ��� ����.

���� � � ���� �� �����

�� � �� �� � � ���. ���� � ��

�� � � ��� � ��, ����� � ��� ���

���� �� ����.

��

��� ���� ���� �� ��� ��� ���� ��� ��� ��� �

� �����. �� � � ��� ���� � � ��� � �� � �

�� ��� ��� � � �� ��� �� � � ���. ��� � �

� �� �� ����� �����.

� ��� �� �� ��� ����.

[TEC_ITS_NODE_STATUS] causes [TEC_ITS_INTERFACE_STATUS] within a 10 minute period if: [TEC_ITS_NODE_STATUS].nodestatus equals[TEC_ITS_INTERFACE_STATUS].ifstatus [TEC_ITS_NODE_STATUS].hostname equals [TEC_ITS_INTERFACE_STATUS].hostname

� ���� �� ��� ���� ���� ���� ��� ���� �� 10

�� ���� ���� �� � �� � � � ��� �����. �� ��

� � ���� ����� �� ��� ��� �� � ���� ��� ��

� �����.

308 IBM Tivoli Enterprise Console: � �� ���

� 2 � ����� �� ����� ��� ��

© Copyright IBM Corp. 2003 309

310 IBM Tivoli Enterprise Console: � �� ���

� 8 � �� �� ��� �� � �

�� �� ��� Tivoli Enterprise Console ����� �� ����� ���� �

�� � �� ��� ��� � �� �����. �� �� ��� ���� ���

��� ���� �� ���� ���, �� ���� ��� �� ���� ���

�� ���� �� ���� ��� ��� ���� �� � ���. � ��

��� �� ���� ���� ��� ��� ����� ��� ���, �� ��

��� �� ������� ���� ����� ��� ��� ��� �� ��

� � ���.

�� �� ��� �� ���� �� � ���� �� �����. ��� �� ��

��� ��� ���� ���� Prolog �� � ���� ��� ���� ��� �

� ���. �� �� �� �� ���� ���� ���.

� 1. Prolog� �� �� � ��� ���

Prolog � �� �� �� ��

��� ���� �� ����� �� ����� ��

�� ������ ���� ���� � � � ������ �� � ������ �

��� ���� � �

Prolog �� � ��� ��� �� �� Java ���� � � �� � XML� ��� ��

��

�� ��� ���� ��� ��� � ���

�� � �

��� ��� �� �� �� �� �� �

��� ��� ���� ���� ��� � ���� �!

�� �� �

��� �� �� � ��� �� �����. ��� DTD ��, tecsce.dtd� ���

XML ��� ���� ��� �� �����. � XML ��� ���

$BINDIR/TME/TEC/default_sm/tecroot.xml���. �� XML � ��� IBM Tivoli

Enterprise Console TME �� CD� /EIFSDK/samples/state_correlation ���

� ���.

��� �� �� ��� ���� �����. �� ��� �� ���� ��

��� �� ��� ���� �����. �� ��, ��, �� � �� ��(�:

� �� � �� ���)�� �����.

5�� �� �� � ���� �, ���, �, resetOnMatch � ��� ��

�� � �� ��� ���� ���. � �� ��� �� ���� ���

�����. ��� � ���� ��� ���.

© Copyright IBM Corp. 2003 311

�� �� �� �� �� ��� ���� ��� ���� ��� ��, ��� �

� �� � ���� ����. ��� �� ��� � � ���.

v �� �� ��� ���� ����� �

v � �� ��� ���� ��

v ��(�: ��� ��)

6�� � ��� �, ��, ��, ���, � �� �� � ������. � �

� ���� �� ���� ���� ���� ���. � ��� ��, �

�� � ���� ��� ���� �� ��� ��� �����(��� ��� �

��, ���� ������ ���).

� �� ���� ���� �� � ���� �����.

�� �� ���� �� ���� �����.

� �� ��� �� � ���� ��� � �� ���� ����� ���

�����.

��� ���� �� � � ���� ��� �����.

�� �� �� �� � �� ���� �� ��� ���� ��� ����

��� �����.

�� � ���

�� �� �� � �� ���� �� ��� ���� �� ��� ��

�� ��� �����.

�: ���� ��� ��� ��� �� �� ��� ���� ��� �� ��

�. �� ��, �� �� �� �(�: ��� �)� �� �� � � ��

�. �� ��, ��� ��� ����� ��� ��� ���� �� �� �

� � ��� ����� ���� �����. ��� ����, ��� �� �

��� � �� ���� ��� �� ��� �� ��� �� ���.

��

� ������ �� Boolean ��� 0 �� �� �� � �� ���.

� �� �� ��� ���� �� � ���.

� 2. � �� � ��

� �� ��

�� � Equality

�� ���� � Addition

��� �� &hostname

�� � foobar

�� ��� 337 ���� � 9 � ��� �� ���� ������.

312 IBM Tivoli Enterprise Console: � �� ���

��

�� ���� ���� �� ��� � � ���. ��� Java ���� �

�� �� �� ���� ���� �� �� ��� �� �������(

�� ��� 327 ���� ��� �� �� ��� ��). �� ��� �� � ��

� ��� ���, TECSummary, �� � SendTECEvent���. ��� ���

singleInstance�� �� � � Boolean ��� �����. � ��� false��

�� � ���� ��� ���� ����. ��� ��� � ���� ����

�� �� �� �����. �� � ����. ��� true ����, ���

� ���� ���� �� ���� �� � ��� �����.

�: � �� � �� �� � ��� �� �� ��� �� �� ���.

�� ��� 327 ���� ��� �� �� ���� ������.

���

��� ��� �� ��� � ���� ����� ����. ��� ���� ��

�� ����. � ���� �� ����. �� XML ����� ��� ��� �

� ��� �����(XML � ��� �� �� ��� 337 ���� � 9 � ��

� �� ��� ��).

<rule id="root.match_discard_tec_notice"> <eventType>TEC_Notice</eventType> <match> <predicate> <![CDATA[ # always succeeds true ]]> </predicate> </match> <triggerActions> <action function="Discard" singleInstance="true"/> </triggerActions> </rule>

TECSummary TECSummary ��� ���� ��� ��� ���� � �� ��� ��� �

����. ��� �� ��� ��� �� � ���. �� ���� ����

� ���� � �� ���� �� repeat_count ��� ��, �� ��� ���

��� ������.(��� ���� repeat_count ��� � �� �� ���

�� repeat_count �� ���� ��� �� �����.)

repeat_count ��� ���� � ��, TECSummary ��� �� ���� msg �

� �� � ��� �� �� ���. ���� �� XML �� ��� � �

msg ����� �����.

�� ��, �� ���� ����� ��� ����.

� 8 � �� �� ��� �� � �� 313

EVENT;repeat_count=3;msg=event1; EVENT;repeat_count=5;msg=event2; EVENT;msg=event3;

�� ���� �� repeat_count� ���.

repeat_count = 3 + 5 + 1 = 9

�� ���� repeat_count � msg ��� TECSummary ��� �����. �

� �� �� �� �� �� ��� ��� �� �����.

�� XML��� TECSummary ��� ���� �� �����.

<rule id="root.duplicate_tec_db"> <eventType>TEC_DB</eventType> <duplicate timeInterval="10000"> <cloneable attributeSet="sql_code"/> <predicate> <![CDATA[ # If we reach this point then # the sql_code is already duplicated # because it is used as a cloneable # parameter. true ]]> </predicate> </duplicate> <triggerActions> <action function="TECSummary" singleInstance="false"> <parameters> SET:msg=root.duplicate_tec_db.summary </parameters> </action> </triggerActions> </rule>

�� ��� ���� �� �� ���� � �����. �� ��� ����, ��

�� � ���� ���� �� � �� �� � �� � ���. ��

�� �� ���� �� �� � �� ���� ����� ����� �� �

� � �� ���� �� �� �� �� ���� ����� ��� �� �

���. �� ��� ����� ���� �� ��� �����. �� ��, �

� ��� rule2�� �� ���� �����.

<action function="Forward" > <parameters> <![CDATA[ RULES:rule2 ]]> </parameters> </action>

�� ��� ���� � ��� �� � ���� �� �� ���. ���

��� ��� �� �� �� ��� ��� ������.

314 IBM Tivoli Enterprise Console: � �� ���

<action function="Forward" > <parameters> <![CDATA[ RULES:rule2, rule3, rule4 ]]> </parameters> </action>

�� ��� �� ��� �� ���� ���� �� ���, RULE ����

directAccess="false" ��� ���� �� ��� � ���. � ��� ��

�� ��, �� �� �� ���� � ���� �� � ��, � �� ��

�� ��� ���� �� � ���.

��� ��� ���� ���� � ��, �� ��� � �� �� ���� ��

�� �����( � ��).

�: �� ��� ���� �� � ���� ��, �� ��� � �� �� �

��� ��� ����.

�� XML ����� �� ��� ���� �� �� ���� �� �����.

� ����, �� �� �� �� ��� �� ��� ���� �����.

<?xml version="1.0"?> <!DOCTYPE rules SYSTEM "rule.dtd"> <rules predicateLib="ZCE"> <predicateLib name="ZCE" class="com.tivoli.zce.predicates.zce.parser.ZCEPredicateBuilder"> <parameter> <field>defaultType</field> <value>String</value> </parameter> </predicateLib> <!-- #########################################--> <!-- Rule: threshold_1--> <!-- #########################################--> <rule id="threshold_1" > <threshold thresholdCount="100" timeInterval="1000" timeIntervalMode="fixedWindow" triggerMode="allEvents" > <predicate> <![CDATA[ &hostname == "test_1" ]]> </predicate> </threshold> <action function="Forward" > <parameters> <![CDATA[ RULES: collector ]]> </parameters> </action> </rule > <!-- #########################################--> <!-- Rule: threshold_2--> <!-- #########################################-->

� 8 � �� �� ��� �� � �� 315

<rule id="threshold_2" > <threshold thresholdCount="100" timeInterval="2000" timeIntervalMode="fixedWindow" triggerMode="allEvents" > <predicate> <![CDATA[ &hostname == "test_2" ]]> </predicate> </threshold> <action function="Forward" > <parameters> <![CDATA[ RULES: collector ]]> </parameters> </action> </rule > <!-- #########################################--> <!-- Rule: collector--> <!-- #########################################--> <rule id="collector" directAccess="false"> <collector timeInterval="10000" > <predicate> <![CDATA[ true ]]> </predicate> </collector> <action function="Summary" /> </rule> </rules>

SendTECEvent SendTECEvent ��� �� �� ��� ��� ���� ������ �� ��

� �� ��� �� ���� � �����(�� ��� 331 ���� ���� �

�� ��).

�� XML �� �� �� ��, EventModificationSample� ���� ����

TEC_Notice ���� ���� ���������. �� ��, SendTECEvent ��

� ���� ��� ���� ���� ������ �� �����.

<rule id="sce_sample.tec_notice_escalate_severity"> <eventType>TEC_Notice</eventType> <match> <predicate> <![CDATA[ # always succeeds true ]]> </predicate> </match> <triggerActions> <action function="EventModificationSample" singleInstance="true"/> <action function="SendTecEvent" singleInstance="true"/> </triggerActions> </rule>

�� �� �� ��

��� �� �� � �����.

316 IBM Tivoli Enterprise Console: � �� ���

id � �� ID� �����. � ID� ���� � �� �� ��� ���

���. � �� ���� �����. �� ��, ID� test.threshold

�� �� �� �� ID� test.threshold.1� �� � ����.

eventType

� �� ���� ��� ���� �����. ��� �� �� ��� ��

�� ���� �� eventType ��� � � ���. �� ���� �

��� ���� �����. �� eventType ��� �� �� ����

�� �� ��� ���� �����. �� �� �� � � ���,

��� eventType ��� ���� ��� ��� ���� �� � ���

������.

�: �� �� ��� ��� ���� ���� BAROC ��� �����

����, �� �� ��� �� ���� � ����. �� �

�� ���� �� � �� ��� ���� �� ��� eventType �

�� � ���. ��� ���� ������ �� ���� �

���.

�� �

�� �� ������. ��� ���� ���� �� �� �� � ���� �

����. �� �� ��� �� � �� ���. �� true� ��� ��

���� � �� ��� �����. ��� �� � �����.

<!-- Discard all heartbeat events for my host that have msg="please match me". --> <rule id="test.match" > <eventType>TEC_Heartbeat</eventType> <match> <predicate> <![CDATA[ &msg == "please match me" && &hostname == "hostname1" ]]> </predicate> </match> <triggerActions> <action function="Discard" singleInstance="true"/> </triggerActions> </rule>

� �

� �� �� �� �� � � ���� ��� ����. �� �� ����

�.

� 8 � �� �� ��� �� � �� 317

v �� ��� �� ���� �� ��� �� �� ��. ��� ���

timeInterval ��� ���� ��� �����. �� ���� � �� ��

�� �� �����, ��� ���� ��� ������.

v �� ��� ��� ���� �

�� 1��� � �� �� ��� �����.

�� 1�� �� 1� � �����. �� 1� ���� ��� ���� ���

� � � ����. �� �� ��� �� ���� ���� ��� ����

�. �� 2� �� ��� �� � ��� �� ��� ������. ��� �

� � �����.

<!-- Show me only the first error number 10 for my host that happens each 10 seconds. --> <rule id="test.duplicate" > <eventType>TEC_Error</eventType> <duplicate timeInterval="10000"> <predicate>

<![CDATA[ &msg == "internal error on my adapter" && &hostname == "hostname1" && &errno = 10 ]]> </predicate> </duplicate> </rule>

� �

��� �� �� �� �� � ���� n �� ����. ���� �� � �

�� ��� ��� ���� ����. ��� ��� �� ����� �����.

v triggerMode ��� ��� �� �� �� ��:

firstEvent

�� � �� ��� �� ���� ����.

lastEvent

�� � �� ��� ���(n��) ���� ����.

S1 S2

1

2

�� 1. � �� �� ��

318 IBM Tivoli Enterprise Console: � �� ���

allEvents

1�� n��� �� ���� ���, �� � �����.

forwardEvents

���� ��� n�� ��� �� ���� ����.

v ���� ��� �� �� ��. ��� ��� timeInterval ��� ��

�� ��� �����.

v �� ��� ���� �� ���� ��� ���� �� �� ��.

timeIntervalMode=fixedWindow | slideWindow �� ��� ��� �����.

� �� fixedWindow���.

v thresholdCount ��� ��� ���� ���� �

v 1�� n���� ���� ���� � ���� �� �

�� 2 � 320 ���� �� 3��� timeIntervalMode=fixedWindow� ��� ��

� �� �� �����.

�� 2��� firstEvent, lastEvent � allEvents ��� �� �� ��� ����

�. �� 1� �� ��� �� ���� �� �(�� �� ��) ���

�. �� 2� ���� �� ���� �� �� � ����. �� ��� �

��, �� 3� ��� �� ��� ������. �� 4� ���� ��� �

�� ��� ������. SN ��� ����, ����� �� �� ���,

��� ��� �� �� n ���� �����.

S1 S2 S3 SNS

1

3

3

3

4

2 22(N-1)

�� 2. � ��� �� �� ��

� 8 � �� �� ��� �� � �� 319

forwardEvents ��(�� 3)���, ���� ��� � �� ��� �� ��� �

�� �� �� ���� �� ���� ����.

�� � �� ��(timeIntervalMode=fixedWindow)� ���� ��, ���� �

� ���� �� � ��� ���� �� ��� �� � �� �����. �

��� �����, � �� � �� �� n�� �� ���� ��� ���. �

�� �� � �� �� ���� ���� ���, �� ����� ���� �� �

� ���� � �� �� �����.

� � �� ��(timeIntervalMode=slideWindow)� ���� ����, � �� �

��� �� � ��� ��� ���� ���� �� �� �� �����. �

��, �� �� � �� �� n�� �� ���� ���� ���� �����.

t� �� ��� �� �� �� � �� ���� ��� �� �� � ��

�.

v �� �� ��, �� ���� ��� � t �� n�� ���� ���� �

��� �����.

v � �� ��, � ���� ��� � t �� n�� ���� ���� ���

� �����.

��� � �� �� � ��� �� � �����.

<!-- I’m only interested when at least 5 Node_Down events for hosts in my local subnet happen within 1 minute. --> <rule id="test.threshold"> <eventType>Node_Down</eventType> <threshold thresholdCount="5" timeInterval="60000" timeIntervalMode="slideWindow" triggerMode="allEvents"> <predicate> <![CDATA[ (&msg == "node down") &&

S1 S2 S3 SNS

1

3

3

3

3

2 22(N-1)

2

�� 3. forwardEvents� ��� ��� �� �� ��

320 IBM Tivoli Enterprise Console: � �� ���

(isMemberOf(&hostname, [ 192.168./16 ])) ]]> </predicate> </threshold> </rule>

��� �� � ��� � �� ��� �� �� �� � ���. aggregate

�� ��� ���� � �� ������. � ��� ���� �� �� ��

� ���. ��� �� true �� false �� ��, 337 ���� � 9 � ��

� �� ���� �� � �� ���� ��� �� ������. �� ��

� ��� �� �� �� thresholdCount � ��� �� �����. �� �

�� ��� ���� thresholdCount �� ����, 0� 1 ��� � ���

���� �� ��� ����. �� ��� ���� � �� ��� ����

�.

<rule id="test.aggregate_threshold"> <eventType>Temperature_Variation</eventType> <threshold thresholdCount="100" timeInterval="2000" triggerMode="allEvents" timeIntervalMode="fixedWindow" > <aggregate> <![CDATA[ &relative_percentage * 100 ]]> </aggregate> <predicate>true</predicate> </threshold> </rule>

��� �

�� �� ��� �� � ��� �� ���� ���� �����. �� �

�� �� � ���� ��� ���� ��� ��� ����. �� ��� �

� �� �����.

v �� ���� ���� �� �� ��. ��� ��� timeInterval ��� �

��� ��� �����.

v ��� �� ��� ��� ���� �� �

322 ���� �� 4��� �� �� �� ��� �����.

� 8 � �� �� ��� �� � �� 321

�� 4�� S1� � �����. �� 1� ���� ��� ���� ����

� � ����. � ���� ���� �� �����. ��� ��� ���

� �����. ��� ��� ��, �� ���� ���� �� ���� �

����(�� 2). �� 3� �� ��� �� � ���, �� ��� ����

��. �� ��� �� ���� �����. ��� �� � �����.

<!-- Collects 10 seconds of Server_Down events for my database. --> <rule id="test.collector"> <eventType>Server_Down</eventType> <collector timeInterval="10000" > <predicate> <![CDATA[ &servername == "my_database" ]]> </predicate> </collector> </rule>

� �

� �� ��� �� �� �� �� ��� ��� ���� ��� �� ��

�� �����. ��� ��� �� ��� ���� ���� ��(�� ���

� ��) �� ���� �����. ���� ��� ��� ����� �� �

��� ���� ����.

� ��� �� ����� �����.

v �� ���� ��� ��� �� � � ��� ��� ��� ��� �

�� ���� Boolean �(randomOrder). randomOrder� yes�� ���� ��

� ��� �� � ���.

v �� ��(� �� �� �� �� ��� ����)

v �� ���� ���� �� �. �� �� ��� ���� ����, �

� �� ���� �� �� �� ���� �� �����.

v �� �� ���� ���� �� ��� �

S1 S2

1

3

2

�� 4. �� �� �� ��

322 IBM Tivoli Enterprise Console: � �� ���

�� 5� ��� ���� ��� ��� ��(randomOrder=no) � �� ��

��� �����.

�� 5�� S1� � �����. �� ���� ��� � �� 1� ����. �

�� ��� ���� ���� ��� �����. �� 2� ���� ���� �

�� ��� �� �� �� � ����. ���� �� 3� ���� �

��� ���� �� �� �� � ����. S4 ��� ����, �� �

� ���� ���� � �� S1(�� 5) ��� ������. �� 4� ��

��� �� � ���, �� ���� ���� �� �� � ��� ���

���.

324 ���� �� 6��� �� ���� randomOrder=yes ��� �� � �

�� � �� �� ��� �����.

S11

S4

2

34

4

S2 S3

5

�� 5. � �� �� ��(randomOrder=no)

� 8 � �� �� ��� �� � �� 323

�� 6� ��� 323 ���� �� 5� ����. ��� � ���� �� ���

S5� ��, � ��� ��� ��� �� ��� ������.

�� � ��� �

�� � ��� �� ��� �� �� �� �� ��� ��� ���� �� ���

�� ���� �����. ��� ��� �� ��� ���� ���� ��

(�� ��� � ��), �� ���� ���� ����. ���� ��� ��

� ����� �� ���� �����.

� ��� �� ����� �����.

v �� ���� ��� ��� �� � � ��� ��� ��� ��� �

�� ���� Boolean �(randomOrder). randomOrder� yes�� ���� ��

� ��� �� � ���.

v �� ��(� �� �� �� �� ��� ����)

v �� ���� ���� �� �. �� �� ��� ���� ����, �

� �� ���� �� �� �� ���� �� �� �����.

v �� ���� ��� ��� � �� �� ���� ���� �� ���

S1

S8

1

5

S3

S7

S6S2

S5

S10

S4 S9

S112

3

2

3

3

1

1

3

3

2

2

2

1

1

�� 6. � �� �� ��(randomOrder=yes)

324 IBM Tivoli Enterprise Console: � �� ���

�� 7��� �� ���� randomOrder=no ��� ��� �� �� � ��

� �� �� ��� �����.

�� 7�� S1� � �����. �� ���� ��� � �� 1� ����. �

�� ��� ���� ���� ��� �����. �� 2� ���� ���� �

�� ��� �� �� �� � ����. ���� �� 3� ���� �

��� ���� �� �� �� � ����. S4 ��� ����, ��

� �� S1(�� 5) ��� ������. �� 4� �� ��� �� � ��

�, �� �� ���� ��� �� � ��� ������ ���.

326 ���� �� 8��� �� ���� randomOrder=yes ��� �� � �

�� �� � ��� �� �� ��� �����.

S11

S4

2

34

4

S2 S3

5

�� 7. �� � ��� �� �� ��(randomOrder=no)

� 8 � �� �� ��� �� � �� 325

�� 8� ��� 325 ���� �� 7� ����. ��� � ���� �� ���

S5�, � ��� ��� ��� �� ���� ���� �� �� ��� ���

���.

�� ��� ��

clonable ��� ���� �� �� �� �� � ���. �� ���� �

� �� ��� �� ����, �� ��� �� �� ���� �����. �

�� �� �� �� �� ���� �� ��� ��� ���� � �����.

�� ��, ��� �� ��� ���� �� ���� �� ��� �� ��� ��

�� �� �� � ���� �����(�� �� �� �� ����� ��). �

�� � ��� ��� �� �� ���� �� ��� �� � � � �

� �� � ���.

�� ����� ��� ���� �� ������ � �� ��� �����(

�� ��, �� ��).

<!-- This is a little variant to our previous threshold example. This rule only triggers if 5 Node_Down events for the SAME host arrive within 1 minute. --> <rule id="test.cloneable_threshold"> <eventType>Node_Down</eventType>

S1

S8

1

5

S3

S7

S6S2

S5

S10

S4 S9

S112

3

2

3

3

1

1

3

3

2

2

2

1

1

�� 8. �� � ��� �� �� ��(randomOrder=yes)

326 IBM Tivoli Enterprise Console: � �� ���

<threshold thresholdCount="5" timeInterval="60000" triggerMode="allEvents"> <cloneable attributeSet="hostname"/> <predicate> <![CDATA[ (&msg == "node down") ]]> </predicate> </threshold> </rule>

Cloneable ��� �� ��� ��� ��� ��� �����. ��� ����

�� ��� �� �� �� �� �� ���� � ���. �� ��, �

� XML ��� �� ��� �����.

<cloneable attributeSet="hostname"/>

�: �(null) �� �� �� ��� �� ��� ���� ����. �, �� ���

� ��� �� ��� �� ���� ���� �� ���� ����.

��� �� �� �

� ��(���, TECSummary, �� � SendTECEvent) ��, Java ��� ���

� � ��� �� �� ��� �� �� �� ���. �� �� ���

����, ��� ��� ���� ���� �� ��� �� � ���.

� ��� Java ���� � ���. �� �� ��� ��� �, �� ��� ��

��� ���� �� ��� �� �� ���� ���� �����. ��� ��

��� ��� ��, � ��� � ���� ���� � ��� ��� �� �

� �� � ���� �����. ��� ���� ���, �� �� ���� �

��� � �� ��� ���� �����(�� �� �� ����� ���� �

�� � ��� � �� ��� �� � ��).

��� ���

�� �� ��� ���� ���� Java ����� ����. ���� ����

�� ���� ���� �� �� �(�� ��� �� ��� ��), ��

�� �� �� ���� � Java ����� �����. com.tivoli.zce.engine.

Event ���� ��� � ����� �� �� ��� �����. ���� �

� ���, �� �� ��� ����� ��� �� ���� ���� ����

�����. �� ���� �� �� ��� ���� ���� � ������ �

��� �� ���� ���� ��� �� �� ���� �� �������. ��

���� ����� �� ���� ��� ���� �� ���� ������ ��

�����.

�: �� �� ��� ���� �� ���� ����� ���� �� ��� ��

��� BufferEvents ���� BufEvtPath ����� � ������ ���

� 8 � �� �� ��� �� � �� 327

�� �� ���� ���� ��� ����� ����. ��� ��� ��

� �� �� ��� IBM Tivoli Enterprise Console �� ���� ���

���.

�� ��� Java Event ������ ��� �� �� ��� � � ��

���.

v ��� ����� ���� ���� � ��� � � � � . ��

� � � � � ���� �� ��� ��� �� � ���.

v �� �� ��� ��� ��� ��� ��� �� ���. �� � ���

�� ���� ��� ���� ���, � � � ����� ����� �

� ��� ���� ����.

�� ��, �� �� � � ��� �� �� ��� �� ��� ����� ��

���. � �� ���� ��� ���, ��� �� � �� �� � ��� ���

� � ���. �� ��� �� �, ���� ������ �����(���

� ��� �� ��).

������ ��� ��� ���� � ��� ��� ��� �� ��� ��� �

�� ���� ���. � ��� ��� �� �� ���� �� ���, �

��� �� ���� ���� �� �� �� ���� ��� ���. ��� �

�� ��� ���� ����� �����. �� �� �� ��� ��� �� �

� ��� �� SendTECEvent� ���� ����. �� �� �� �� ���

� �� �� ���. �� ��� 331 ���� ���� ���� ������.

���� �� ��� ���� ������ ��� �, ���� ������ �

��� �� �� ���� � ���� ���� ��� ����. �� � ��

�� ������ ��� � ���� �� ���� ����. �� �� �� �

�� ���� ���� ����, ��� �� ������ ���� ����� �

� ���. �� ��� 332 ���� ���� ����� ������.

�� ��

��� Java ���� � ��, �� �� ��� �� � �� com.tivoli.zce.

actions.libs ���� � ���. � ���� ��� ����� � �� �

� �� � �� ��� ��� ��� ���. �� ���� ��� �����

�� � �� ���� com.tivoli.zce.actions.DefaultActionHandler ���� �

�� ���. ��� �� � �� ���� � � ���.

v processEvent(). � ���� ��� � �� �� ��� �� ���, �� �

���� � Event ����� �����. ��� � ���� ���� �

�� � ���� �����.

v processEvents(). � ���� processEvent() ���� ����, �� ��

�� � � � EventList ����� �� ����� �����. �

328 IBM Tivoli Enterprise Console: � �� ���

��� �� ��� ���� ��� � � � ���, ���� � �

� ���. processEvents() ���� ��� �� � �� ��� ��

processEvent() ���� � � ���.

v doParse(). � ���� �� ���� ������ �� �� �� ��

��� �� ����. doParse() ���� ��� ��� XML �� ���

����� �� ���. ��� ����� �� �� ���� �� ���

� �� �����.(��� ���� �� ��, ����� �� �� ���

� ��� � �� ������.)

��� ���� �� �(processEvent() ��� �� processEvents() ���

� �), ��� �� ���� ��� �� ��� ����� ���� �

� ���(�� ��� 330 ���� ����� �� �� ��). �����

���� ��� ���� ����, ��� �� �� �� ���� �� ��

�. �� �� ��� ��� ���, � ��� � �� ��� �� ����

�� �� ���� ��� ��� �� � ���. �� ���� � ����

forward() �����, �� �� �� ���� ��� ���(�� ��� 331

���� ���� ��� ��).

330 ���� �� 9��� �� ���� �� ��� �����.

� 8 � �� �� ��� �� � �� 329

���� � �

��� ����(com.tivoli.zce.engine.Event� ���)�� �� ���� ��� �

�-� � ��� � ��� �� ��� �� ���. Event ���� ��� ��

�� �� � � ���� �����. ��� �� ���� ���.

hasAttribute()

hasAttribute() ���� � � � ����� ����, ���� �

�� ��� ��� �� �� ��� ���� Boolean �� ����

�. �� ��, event.hasAttribute("HOSTNAME")� event� HOSTNAME

��� �� true� �����(�� ��� ���� ��� ��).

getString()

getString() ���� � � � ����� ����, ��� ��� �

� �� � � � �����. �� ��, event.getString

("SEVERITY")� event� � SEVERITY �� �� �����.

�: Event ���� �� ��� �� ��� �� �� ��� ���� �

���. ��� �� Tivoli Enterprise Console ��� ��� �

package com.tivoli.zce.action.libs; import com.tivoli.zce.IRule; import com.tivoli.zce.ParserException; import com.tivoli.zce.CorrelatorException; import com.tivoli.zce.engine.EventList; import com.tivoli.zce.engine.Event; import com.tivoli.zce.actions.DefaultActionHandler; public class MyAction extends DefaultActionHandler implements ITecEventAttributes { public void processEvents(EventList eventList) throws Exception { // code to process multiple events forward(eventList); } public void processEvent(Event event) throws Exception { // code to process single event forward(event); } public Object doParse(IRule rule, String params) throws ParserException { // method to parse parameters after instantiation } }

�� 9. ��� ��

330 IBM Tivoli Enterprise Console: � �� ���

� ���� ���, Tivoli Enterprise Console ��� �� �� ��

� � getString()� ��� ���.

putItem()

putItem() ���� ����� � � � �� �����. � ����

��� � � � ��� �� �� �� ����� . �� �� ,

event.putItem("ORIGIN","SCE")� ORIGIN �� �� ″SCE″ � � �

����. ��� �� �� ��� ���� ��� � ��� �����. �

� �� �� �� �� �� � ��, ��� ��� ���� ��

� �� �� �(nest)� ������ �����.

�: �� �� ��� ��� ���� ���� BAROC ��� �����

���, putItem ���� ��� �� ��� ��� ��� ���

� ����. ��� ��� ���� �� ��� � ���� ��

��, � ���� ���� ���� ��� ��� ���� ���� �

� ���. �� �� ��� ���� ��, ��� �� ���

����� � �� ��� ��� ���� ��� ��� �� �

��.

��� ��� �� �� ���� �� ��, ITecEventAttributes ����� �

��� ���� ���� �� � �� ��� ���� ��� �����. �

� ���� � ����� � �� ��, � �� ��� ��� ���� �

� ��� �� � ���.

��� �

� ��� Java ����� � � ���� � �� �����. � ��� ��� �,

�� �� ��� �� ��� ��� �� ���� ���� ������ ��� �

� ���� �� �� �����. � ��� �� ��� ��� �� ���� ��

�� ��, �� �� ���� ����� ��� �� ��� ���� ��

��. ��� �� �� ��� ��� ����� ����� ���� ��� �

��. �� ��� ��� ���� ��� ���.

v �� ��� ���� ��� ��, ����� ��� �� �� ���� �� �

� ��� ���� ��� ���. ���� ��� �� ��� �� ���

���� �� � ���.

v ��� ���� ��� ��, ���� �� ��� ���� �� ���� ��

� ���.

��� ��� ��� �� � � �� �� ���.

v TecEventUtil.updateTecEvent() ���� ���� actionHandler.forward()

� ��� �� ��� ���� ����� �� � ���. � ���� �

���� �� ��� ���� �, �� ��� � ��� �� ��� ��

� 8 � �� �� ��� �� � �� 331

�� �����(�� ���� � ���� ��� ��� �). �� �

�� myEvent� �� ��� ���� �� ���� �����.

updateTecEvent(myEvent,myEvent); forward(myEvent);

v TecEventUtil.forwardTecEvent() ���� ���� ��� ��� ���� �

��� �� ��� ���� �� � ���. actionHandler.forward() �

�� �� � ���� ���� ���� �� � ��� ����, ����

� ���� ���� �� �� � � ��� ���� �� ��� �

�� � ���� ������. ���� ���� ��� ��� � �� �

�� ��� ��� �� �� ����, forward() ���� �� ���� ��

��(�� ��)���. forwardTecEvent() ���� � �� ���� �, �

�� ���� �� ���, �� ��� � ��� ��� �� ���� �

����. �� ��� myEvent� ���� ���� �� ��� ���� ���

��.

TecEventUtil.forwardTecEvent(this,myEvent,myEvent);

v �� ��� ��� � SendTECEvent ��� � ���. � ���

TecEventUtil.forwardTecEvent() ���� ���� ���� �� ���� �

� � ����, �� ��� �� ����� ��� ���� ���� ���.

�: SendTECEvent� �� �� ��� �� ���� ����� � ���� �

��� ��� �����. ��� � ���� ���� �� ��� ���

�� ���� ���� ���� �� ���� ��� ���. � ����

�� ���� �� ���� ��� ����.

��� ���

�� �� �� ��� �� ���� �� ��� ���� ����� ����

�� � ���. ���� �� ���� � �� ���� �� �� ��� ���

��� ��� ���� ����.

��� ���� ��� �� ������ �� ���, �� �� ������ �

��� � � ���� ����� ��� ��� ���� ��� � ���. ��

����� ���� ����, � ��� �� ��� ��� ����� ���

� PHandler.removeEvent_termAction() ���� ������.

�� ��� ��

� �� ����� �� �� �� �� �� �� ���� �����.

��� �� ��

� ��� ���� �� ���� ���� ���������. ���� �����

�� ��� ��� ��� ��� �, ��� � SEVERITY �� �� ����.

332 IBM Tivoli Enterprise Console: � �� ���

SEVERITY� WARNING, MINOR �� CRITICAL�� ��� �� �� ���

��� �����. SEVERITY� FATAL ���� ���� ����.

SEVERITY �� �� ��� �, ��� ��� ���� ���� �� ��� �

��� �����.

� ��� ����� ���� �� ���, doParse() ���� �� ��� �

� � ���� � ���.

// Actions must be part of the com.tivoli.zce.actions.libs package package com.tivoli.zce.actions.libs; // State correlation imports import com.tivoli.zce.IRule; import com.tivoli.zce.ParserException; import com.tivoli.zce.CorrelatorException; import com.tivoli.zce.engine.EventList; import com.tivoli.zce.engine.Event; import com.tivoli.zce.actions.DefaultActionHandler; import com.tivoli.zce.actions.TecEventUtil; public class EventModificationSample extends DefaultActionHandler implements ITecEventAttributes { /****************************************************************************** * Processes a list of events by parsing the list and calling processEvent() * for each ******************************************************************************/ public void processEvents(EventList eventList) throws Exception { if (eventList != null) { try { for (int i = 0; i < eventList.size(); i++) { processEvent( eventList.eventAt( i)); } } catch (Exception x) { x.printStackTrace(); } } } /****************************************************************************** * Processes a single event. If the value of the SEVERITY attribute is lower * than FATAL, it is incremented to the next level. The SEVERITY_LIST array is * defined by the ITecEventAttributes interface and contains the six standard * severity values: UNKNOWN, HARMLESS, WARNING, MINOR, CRITICAL, and FATAL. ******************************************************************************/ public void processEvent(Event event) throws Exception { String severity = null; if (event!= null) { if (event.hasAttribute( SEVERITY)) { severity = event.getString( SEVERITY); int i = 0; while (i < SEVERITY_LIST.length && !(severity.equals( SEVERITY_LIST[ i]))) { i++; } if (i < SEVERITY_LIST.length - 1) {

� 8 � �� �� ��� �� � �� 333

severity = SEVERITY_LIST[ i + 1]; } } else { severity = SEVERITY_LIST[ 0]; } } event.putItem( SEVERITY, severity); // Update the event snapshot and forward to the next action TecEventUtil.forwardTecEvent(this,event,event); } /****************************************************************************** * Parses parameters for the action (none in this case) ******************************************************************************/ public Object doParse(IRule rule, String paramSz) throws ParserException { return null; } }

��� ��� � � ��

� ��� �� ���� �� ��� ����, ���� � ���� ��� �� �

��� � ���� �����. ���� ����� �� ��� ��� ��� ��

� �, ��� HOSTNAME �� �� ����(���� ��� � ��). �� �

�, � TEC_Notice ���� ���� � ���� HOSTNAME ��� �� ��

�� �� �� �� �� �(�� � �)�� �����. ��� � ���� �

��� �� ��� �����.

��� �� ���� � ���� ���� �� ����� �� ���� ���

�. �� ���� �� ��� ���� �� ��� � �� ���� �� ����

�.

// Actions must be part of the com.tivoli.zce.actions.libs package. package com.tivoli.zce.actions.libs; // State correlation imports import com.tivoli.zce.IRule; import com.tivoli.zce.ParserException; import com.tivoli.zce.CorrelatorException; import com.tivoli.zce.engine.EventList; import com.tivoli.zce.engine.Event; import com.tivoli.zce.actions.DefaultActionHandler; import com.tivoli.zce.persistence.PHandler; import com.tivoli.zce.actions.TecEventUtil; public class CreateNewEventSample extends DefaultActionHandler implements ITecEventAttributes { // A default host name to use if the event does not contain one private final String DEFAULT_HOSTNAME = "’no host’"; /****************************************************************************** * Processes a list of events by parsing the list and calling processEvent() * for each ******************************************************************************/

334 IBM Tivoli Enterprise Console: � �� ���

public void processEvents(EventList eventList) throws Exception { if (eventList != null) { try { for (int i = 0; i < eventList.size(); i++) { processEvent( eventList.eventAt( i)); } } catch (Exception x) { x.printStackTrace(); } } } /****************************************************************************** * Processes a single event. A new event is generated using the value of the * HOSTNAME attribute of the original event. The original event is then * discarded, and the new event is forwarded to the next action. The HOSTNAME, * MSG, and ORIGIN constants are defined by the ITecEventAttributes interface. ******************************************************************************/ public void processEvent(Event event) throws Exception { Event newEvent = new Event(); String hostname = DEFAULT_HOSTNAME; if (event!= null) { if (event.hasAttribute( HOSTNAME)) { hostname = event.getString( HOSTNAME); } } // create new event and set HOSTNAME attribute equal to HOSTNAME of // original event, or to default value newEvent.type = "TEC_Notice"; newEvent.putItem( HOSTNAME, hostname); newEvent.putItem( MSG, "’Generated by State Correlation’"); newEvent.putItem( ORIGIN, "SCE"); // Update the snapshot and forward the new event to the next action TecEventUtil.forwardTecEvent( this, newEvent, event); // Add the new event to the persistent store PHandler.addEvent( newEvent); // Remove the original event from the persistent store. Because it // not forwarded, the event is discarded. PHandler.removeEvent_termAction(event); } /****************************************************************************** * Parses parameters for the action (none in this case) ******************************************************************************/ public Object doParse(IRule rule, String paramSz) throws ParserException { return null; } }

� 8 � �� �� ��� �� � �� 335

336 IBM Tivoli Enterprise Console: � �� ���

� 9 � �� �� ��

� ��� � ��� ��� ����.

v � ��

v � �����

v �� �� ���

�: �� ��� �� IBM Tivoli Enterprise Console �� ����.

�� ��� �� �� �� 311 ���� � 8 � ��� �� ��� �� � �

��� ������.

� ��

�� �� �� XML �� �� 1.0� ���� �����. � ���

$BINDIR/TME/TEC/default_sm/tecsce.dtd ��� ��� �� �� ��(DTD)� �

� ���.

XML � �� UTF-8���. �� UTF-8 ��� �� �����, XML

� �� �� ���. �� ����� �� ���� �� XML encoding �

��� ������.

<?xml version=”1.0” encoding=”EUC-JP”?>

� �� � ��� ��� �� ��� �� � �, �� ��� ��

�� ��� �� �� �� ��� ��� ����.

�: � ��� �� ��� �����.

� �

� ��� ���� � �� ���.

v � �� � ����� ��

v �� ��� ��(�� ��) �� � � ��� �� � � ��

v � � ��� � �

v �� �� CDATA ��� ��

��� �� � �����. � ��� �� ��� 338 ���� � 3� �����

�.

1 <?xml version="1.0"?>

2 <!DOCTYPE rules SYSTEM "tecsce.dtd">

© Copyright IBM Corp. 2003 337

3 <!-- Comments -->

4 <rules predicateLib="ZCE">

5 <predicateLib

6 name="ZCE"

7 class="com.tivoli.zce.predicates.zce.parser.ZCEPredicateBuilder">

8 <parameter>

9 <field>defaultType</field>

10 <value>String</value>

11 </parameter>

12 </predicateLib>

13 <variables scope=”test” >

14 <variable name=”IPS” type=”Set” value=”[1.2.3.4 1.2.3.5]” />

15 </variables>

16 <rule id="test.match" >

17 <eventType>PIX</eventType>

18 <match>

19 <predicate>

20 <![CDATA [

21 isMemberOf ( &hostAddress, $IPS )

22 ]]>

23 </predicate>

24 </match>

25 <action function=”TECSummary” singleInstance=”true” />

26 </rule>

27 </rules>

� 3. � �� �� ��

�� ��

1 - 2 � ��� ���� DTD � XML ��� �����.

4 �� �����. �� � XML ��� � �����.

� ��� �� ���� ���� ������. � �����(����� �� � �

� �� ��)� ��� ���. � ����� �� �� predicateLib ��� ��

�� ZCE�� � ������ �����.

338 IBM Tivoli Enterprise Console: � �� ���

� 3. � �� �� �� (��)

�� ��

5 - 12 ZCE ������ �� ��� �����.

6 XML ��� �� �� �� ��� �����.

7 ���� ���� �����. � ���� com.tivoli.zce.predicate.

IPredicateBuilder ����� � � ���.

9 - 10 �� ���� �� � � ����� �����. ��� ����� � �

������ �����. ZCE ����� ��� defaultType ����� String

��� ���� �� ��� �� � ���� � ��� String�� ��

���.

13 - 15 ��� �� test �� �� � � ��� �� � � ��� �����.

16 � ID� �����.

17 �� �� � � ��� ���� �����.

18 � ��� �����.

19 - 23 ��� ���� �� � ��� �����.

25 �� ��� � ��� ��� �����.

�� � ��

��� �� �� �� �����. �� �� ��� � 4� ������.

1 <rule id="rules.one" >

2 <match>

3 <predicate>

4 true

5 </predicate>

6 </match>

7 <action function="TECSummary" />

8 </rule>

� 4. �� �� �� ��

�� ��

1 rules.one��� � �� �����.

� ��� �� �� �� ��� SNMP���� �� OID(���� ID) ���� ��

��. � ���� �� �� ��� ��� ��� �����. � �� �� ��� ���

� �� ��� ���� �� ��� �� ��(�: ��)� �� � ���. � ��

�� �� �� ��� ��� �� �����.

rules.*

�� �� ID� ����� � ID� �� �� ����. �� ��, rule.one��� �

�� rule.one.a�� �� �� �� �� ����.

2 �� ��� �����(�: �� �).

4 �� �� ��� ��� �� �����. �� ��� true� ��� � �� �� �

��� �� �����.

� 9 � �� �� �� 339

� 4. �� �� �� �� (��)

�� ��

7 �� �� � ��� ��� � ��� �����.

� ����� ���� �� TECSummary ��� ����. � � ��� �� ���

�� ���� ���� Tivoli ��� � �� �����.

��� � ��

� �� � ���� ���� � �� �� �� ��� ��� ���. ��

�� ��� 341 ���� � 5� ������.

1 <rule id="rules.2" >

2 <eventType>PIX_TCP_in_conn_denied</eventType>

3 <collector timeInterval="10000" >

4 <cloneable

5 attributeSet="pix_sev pix_code pix_ifname"

6 />

7 <predicate>true</predicate>

8 </collector>

9 <action function="TECSummary">

10 <parameters>

11 <![CDATA[

12 SET:msg=SUMMARY_Multiple_TCPIP_Inbound_connections_denied

13 ]]>

14 </parameters>

15 </action>

16 </rule>

� �� ���� ��� ���� �����. �� ��� eventType ��(��

�� ��� ���� ��)� �� �� � � ���. ����� ��

PIX_TCP_in_conn_denied ���� ���� �����. eventType ��� ��

��� ��� �� �������. ��� �� ��� ��� ��� �� �

���.

<eventType>PIX_TCP_in_conn_denied</eventType>

<eventType>new_type_1</eventType>

<eventType>new_type_2</eventType>

...

340 IBM Tivoli Enterprise Console: � �� ���

� 5. �� �� �� ��

�� ��

3 �� �� �� �� �����.

� ��� �� ��� �� � ���� ���� ��� �� ���� �����. ��

��� timeInterval ��� ��� ��, 10,000�� �� �� �����.

4 - 5 � �� �� � � �����. �� �� pix_sev, pix_code, pix_ifname �� ��

�� �����.

��� ��� ��� ��� ��� ��� �� ���. ���� ��� ��� ��

� ����� ��� �� �� ���. ����� �� �� �� �� ���� ��

����� ��� ��� ���� ���� ��� ��� ��� �����. ��� �

�� � �� ���� �� �� ��� ��� � �� � ��� �� �

���. ��� �� �� � � � �� � ��� �� � ���.

7 �� �����.

� ���� �� �� true� ��� ��� ����. cloneable ��� attributeSet

��� ���� ����� ��� � � ���.

9 - 15 TECSummary ��� ���� ��� �� �� �����. � ��� ��� ����

�� � �� ���� ����. � ��� msg ��� SET ����� � ���. ��

���� �� �� �� msg �� �� � ���.

11 - 13 SET:msg=value, � �� �� ���� msg �� �� ���� ��� ��� ���

��.

� � ��

�� ��� � �� � �����. �� �� ��� � 6� ������.

1 <rule id="test.duplicate" > 2 <eventType>TEC_Error</eventType> 3 <duplicate timeInterval="10000"> 4 <predicate> <![CDATA[ 5 &msg == "internal error on my adapter" && 6 &hostname == "hostname1" && 7 &errno = 10 8 ]]> 9 </predicate> 10 </duplicate> 11 </rule>

� 6. �� �� �� ��

�� ��

1 test.duplicate�� � �� �����.

2 �� ���� ��� ��(TEC_Error)� �����. � ��, � ��� ��� ���

� ��� ��� �� eventType ��� � � ���. � ��� ��� ��

�� ���� �����.

3 10,000��(10)� �� ���� � �� �����. � �� �� �� ��� ��

���� �� �����.

4 �� ���� ���� � ���� �� �����.

� 9 � �� �� �� 341

� � ��

�� ��� � �� �� � ��� �� � �����. �� �� ��� � 7

� ������.

1 <rule id="test.threshold"> 2 <eventType>Node_Down</eventType> 3 <threshold thresholdCount="5" timeInterval="60000" 4 timeIntervalMode="slideWindow" triggerMode="allEvents"> 5 <predicate> 6 <![CDATA[ 7 (&msg == "node down") && 8 (isMemberOf(&hostname, [ 192.168./16 ])) 9 ]]> 10 </predicate> 11 </threshold> 12 </rule>

� 7. �� �� �� ��

�� ��

1 test.threshold�� � �� �����.

2 �� ���� ��� ��(Node_Down)� �����. � �� � ��� ��� ���

� ��� ��� �� eventType ��� � � ���. � ��� ��� ��

�� ���� �����.

3 - 4 �� ����� � ��� �� �����.

v ��� � - 5. � �� ���� ��� �� ��� �� �� ���� ����.

v �� �� - 60,000��(1). ���� ���� � �� �� ��� �� ����

���.

v �� �� �� - slideWindow. � �� ���, 1 � 5�� ���� ���� �

��� ����.

v �� �� - allEvents. � ��� ���� ��� �� �� ���� ���� �

���.

5 �� ���� ���� � ���� �� �����.

� � ��

�� ��� randomOrder=true � �� � �����. �� �� ��� 343 �

��� � 8� ������.

1 <rule id="detect_sequence.passThrough" > 2 <eventType>serverStatus</eventType> 3 <passthrough timeInterval="600000" 4 randomOrder="true" > 5 <cloneable ignoreMissingAttributes="false" 6 attributeSet="serverName" /> 7 <predicate> 8 <![CDATA[&serverType == "webserver" && 9 &serverOperational == "Off"]]> 10 </predicate> 11 <predicate> 12 <![CDATA[&serverType == "database" && 13 &serverOperational == "Off" ]]> 14 </predicate>

342 IBM Tivoli Enterprise Console: � �� ���

15 </passthrough> 16 <action function="TECSummary" > 17 <parameters> 18 <![CDATA[ 19 SET:msg=WebServer.Off.Database.Off 20 ]]> 21 </parameters> 22 </action> 23 </rule>

� 8. �� �� �� ��

�� ��

1 detect_sequence.passThrough�� � �� �����.

2 �� ���� ��� ��(serverStatus)� �����. � �� � ��� ��� ���

� ��� ��� �� eventType ��� � � ���. � ��� ��� ��

�� ���� �����.

3 - 4 �� ����� � � �� �����.

v �� �� - 60,000��(1). �� ��� �� � � �� �� �� �� ��

���� ���.

v �� �� �� - true. �� 7 - 14�� �� ��� ��� ���� � �,

���� ����� �� � ���� � �����.

5 - 6 �� serverName ���� ����� �����. �� serverName ��� �� � ��

�� �(null)�� �� �� �� � � ���� ����.

7 - 10 ���� ���� �� ���� �� �� �� �����(serverType =

″webserver″ � serverOperational = ″Off″).

11 - 14 ���� ���� �� ���� �� �� �� �����(serverType = ″database″

� serverOperational = ″Off″).

16 - 22 �� �� ���� �� ���� ��� ��� �����. � ���� ����� �

�� serverType ���� ���� �� � ���� msg � repeat_count ��� ��

�� � TECSummary ��� �����. � ��� �� ���� ����.

�� � ��� � ��

�� ��� randomOrder=false � �� � �����. �� �� ��� 344

���� � 9� ������.

1 <rule id="detect_sequence.resetOnMatch" > 2 <eventType>serverStatus</eventType> 3 <resetOnMatch timeInterval="600000" randomOrder="false"> 4 <cloneable ignoreMissingAttributes="false" attributeSet="serverName"/> 5 <predicate> 6 <![CDATA[&serverType == "webserver" && 7 &serverOperational == "Off"]]> 8 </predicate> 9 <predicate> 10 <![CDATA[&serverType == "webserver" && 11 &serverOperational == "On" ]]> 12 </predicate> 13 </resetOnMatch> 14 </rule>

� 9 � �� �� �� 343

� 9. �� �� �� ��

�� ��

1 detect_sequence.resetOnMatch�� � �� �����.

2 �� ���� ��� ��(serverStatus)� �����. � �� � ��� ��� ���

� ��� ��� �� eventType ��� � � ���. � ��� ��� ��

�� ���� �����.

3 �� ����� � � �� �����.

v �� �� - 60,000��(1). �� ��� �� � � �� �� �� �� ��

���� ���.

v �� �� �� - false. �� ���� ���� 5 ~ 12�� �� �� ��� ��

�� ���� � �����.

4 �� serverName ���� ����� �����. �� serverName ��� �� � ��

�� �(null)�� �� �� �� � � ���� ����.

5 - 8 ���� ���� �� ���� �� �� �� �����(serverType =

″webserver″ � serverOperational = ″Off″).

9 - 12 ���� ���� �� ���� �� �� �� �����(serverType =

″webserver″ � serverOperational = ″On″).

�� �

��� ��� ��� ����, � � ��� ��� �� � ���. �

�� �� �� ��� ���� �� �����. ���� �� , �� � ��

� �� �� ����� �� �� �����.

� ��� 5�� �� ��(String, Float, Int, Boolean � Set)� ���� ����

�. � ��� �� �� ������ ��� �� �� ��, �� ����

�� �� � �� ��� �� ���� ��� ���.

�� ����� ��� �� � ���� �����.

<?xml version="1.0"?>

<!DOCTYPE rules SYSTEM "tecsce.dtd">

<!-- Comments -->

<rules predicateLib="ZCE">

<predicateLib

name="ZCE"

class="com.tivoli.zce.predicates.zce.parser.ZCEPredicateBuilder">

<parameter>

<field>defaultType</field>

<value>String</value>

</parameter>

</predicateLib>

344 IBM Tivoli Enterprise Console: � �� ���

1 <variables scope="test" >

2 <variable name="IPS" type="Set" value="[1.2.3.4 1.2.3.5]" />

<variable name="INTS" type="Set" value="[1-5]" />

<variable name="TRUE" type="Boolean" value="true" />

3 <variable name="PRED1" type="Boolean" >

4 <value> <![CDATA[ (&a1=="1" && true) ]]> </value>

</variable>

</variables>

<rule id="test.match" >

<eventType>PIX</eventType>

<match>

<predicate>

<![CDATA[

5 $PRED1 &&

isMemberOf ( 1.2.3.4, $IPS ) &&

(intset.isMemberOf 4 $INTS ) &&

&a2=="2"

]]>

</predicate>

</match>

<action ...

��� ��� �� �� ��� � ����. � ��� test �� ��� �� �

� �� ��� � �� ��� �����. �� ��� �� ��� ��� �

� ���� � ��� ��� �� ��� � ���. ��� � �� ���

� � ��� �� �����.

� 10. �� �� ��

�� ��

1 ��� ��� �����.

2 IPS ��� �� [1.2.3.4 1.2.3.5] Set ���� �����. IPS� IP �� ����

�.

3 - 4 PRED1 ��� �� �(&a1=="1" && true)�� �����.

XML ���� �� � ��� �� �� ���� ����. �� �� ��(�: PRED1)

� ���� � ��� �����.

5 test.match �� �� test �� �� ��� ��� ��� PRED1 ��� �����.

� 9 � �� �� �� 345

�� �����

� ���� � ������ �� ��� �����. � � � ��� 347 �

��� ��� ��� � � ��� ������.

��

� ������� �� � ��� ���.

� 11. � ������ � ��

�� �� �� �

Integer 2, 444, -44 Long

Float 3.4, 5.122 Float

String ″somestring″, ″John Smith″ java.lang.String

Boolean true, false boolean

StringSet [ ″apples″, ″oranges″], { 1 2 3 } com.tivoli.zce.engine.StringSet

� ���� ��� �� ��� �� ����

��� � � �������.

IntSet [ 1, 3 - 6, 99 ] com.tivoli.zce.predicates.zce.IntSet

IPAddressSet [ 10.1.2.3, 9.4./16, 128.89.9.1 ] com.tivoli.zce.predicates.zce.IPAddressSet

IPAddress 10.1.2.3, 9.4./16 com.tivoli.zce.predicates.zce.IPAddress

��� ���� � �(.)� �����. �� ��,

9.4./16� � ��� ����� �� ����

�.

�� �� IntSet � IPAddressSet ���� ����. IntSet � ��� ��, ��

�(-)�� ��� �����. �� ��, 4 - 8� 4�� 8��� �� �� ���

�. IPAddressSet � ��� ���� ������ ��� �����. �� ��,

9.4.3.2� � IP ����, 9.4./16� 9.4.0.0 - 9.4.255.255 ��� �� IP ���

�����.

��

�� ���� ���� ���� ���� attribute=value ��� � �� ���.

��� ���� � ��� ���� �� ����(&) � �� ����. ��� �

�� �� ��� &hostname�� �����.

�� �� �� ��� ��� �� �� ��� ���� ���� �� ��� �

�� �� �� ���. ��� �� �� �����.

&hostname

� ���� ��

&hostname@0

� ���� ��

346 IBM Tivoli Enterprise Console: � �� ���

&hostname@1

�� ���� �� �, �� ���

&hostname@-3

���� � �� ���� ��

�� ��� �� � ��

� ����� �� ��� � � �� ��� �� �� � ��� �� ��

��� ���.

v ��

v �

v � � � ��

v IP ��

v ��

�� �� �� ��� �� ��� � � ��� � �����. �� ���

� � ��� �� �� ���. �� ���� ��, � ��� ��� �

����.

&arg1 == &arg2

� � ���� �� ��� �� ��� � �����. �� ��, ��� �

���.

(int.eq &arg1 &arg2)

� ���� � � int.eq ��� == �� ��� �����.

�� ��

�� ���� ��� �� �� �� �����.

v ==

v !=

v >

v <

v >=

v <=

== ��� ��, ��. �� �� �� true� �����.

��: ��

==

� 9 � �� �� �� 347

� �

int.eq

��: integer, integer

�: ��

(&integerSlot == 4)

� �

(int.eq &integerSlot 4)

!= ��� ��, �� ��. �� ��� �� �� true� �����.

��: ��

!=

� �

int.ne

��: integer, integer

�: ��

(&integerSlot != 4)

� �

(int.ne &integerSlot 4)

> ��� ��, �� �. �� �� �� ��� � �� true� �����.

��: ��

>

� �

int.gt

��: integer, integer

�: ��

(&integerSlot > 4)

� �

(int.gt &integerSlot 4)

348 IBM Tivoli Enterprise Console: � �� ���

< ��� ��, �� ��. �� �� �� ��� �� �� true� ���

��.

��: ��

<

� �

int.lt

��: integer, integer

�: ��

(&integerSlot < 4)

� �

(int.lt &integerSlot 4)

>= ��� ��, �� �� �� ��. �� �� �� � �� �� true�

�����.

��: ��

>=

� �

int.ge

��: integer, integer

�: ��

(&integerSlot >= 4)

� �

(int.ge &integerSlot 4)

<= ��� ��, �� �� �� ��. �� �� �� � �� �� true�

�����.

��: ��

<=

� �

� 9 � �� �� �� 349

int.le

��: integer, integer

�: ��

(&integerSlot <= 4)

� �

(int.le &integerSlot 4)

�� ��

�� ���� ��� �� �� �� �����.

v +

v -

v *

v /

v absolute

v max

v min

v mod

v negate

v numOfEvents

v range

v timeNow

v timeSpan

+ ��� ��, ���. ��� �� �� ��� �����.

��: ��

+

� �

int.add

��: integer, integer

�: ��

(&integerSlot + 4)

� �

350 IBM Tivoli Enterprise Console: � �� ���

(int.add &integerSlot 4)

- ��� ��, ��. �� ��� �� �� � �� ��� �����.

��: ��

-

� �

int.sub

��: integer, integer

�: ��

(&integerSlot - 4)

� �

(int.sub &integerSlot 4)

* ��� ��, "��. "�� �� �� ��� �����.

��: ��

*

� �

int.mul

��: integer, integer

�: ��

(&integerSlot * 4)

� �

(int.mul &integerSlot 4)

/ ��� ��, ���. �� �� �� �� �� �� ��� �����.

��: ��

/

� �

int.div

� 9 � �� �� �� 351

��: integer, integer

�: ��

(&integerSlot / 4)

� �

(int.div &integerSlot 4)

absolute �� �� �� �� �����.

��: ��

abs(..)

� �

int.abs

��: integer

�: ��

abs(&integerSlot)

� �

(int.abs &integerSlot)

max �� �� ���� ���� �����. � ��� �� �����.

��: ��

max(..)

� �

int.max

��: integer*

�: ��

max(&integerSlot, 4)

� �

(int.max &integerSlot 4)

352 IBM Tivoli Enterprise Console: � �� ���

min �� �� ���� ���� �����. � ��� �� �����.

��: ��

min(..)

� �

int.min

��: integer*

�: ��

min(&integerSlot, 4)

� �

(int.min &integerSlot 4)

mod �� �� �� �� �� �� �� �� �����.

��: ��

%

� �

int.mod

��: integer, integer

�: ��

(&integerSlot % 4)

� �

(int.mod &integerSlot 4)

negate �� �� ��� �����.

��: ��

neg(..)

� �

int.neg

��: integer

� 9 � �� �� �� 353

�: ��

neg(&integerSlot)

� �

(int.neg &integerSlot)

numOfEvents ���� �� �� ���� ���� ��� �

��: ��

numOfEvents()

� �

int.numOfEvents

��: �� ����.

�: ��

numOfEvents()

� �

(int.numOfEvents)

range �� � �� ���� ��� ��� �����. � ��� �� �����.

��: ��

range(..)

� �

int.range

��: integer*

�: ��

range(&integerSlot, 4, 100)

� �

(int.range &integerSlot 4 100)

timeNow 1970 1� 1� 00:00:00 GMT ��� � ��(�� �)� �����.

��: ��

timeNow()

354 IBM Tivoli Enterprise Console: � �� ���

� �

int.timeNow

��: �� ����.

�: ��

timeNow()

� �

(int.timeNow)

timeSpan �, � � ��� ��� ���� ��� �����.

��: ��

timeSpan(..)

� �

int.timeSpan

��: integer, integer, integer

�: ��

timeSpan(hours, mins, seconds)

� �

(int.timeSpan hours mins seconds)

� ��

�� ���� ��� � �� �� �����.

v ==

v !=

v >

v >=

v <

v <=

== ��� ��, ��. �� �� �� true� �����.

��: ��

==

� 9 � �� �� �� 355

� �

float.eq

��: float, float

�: ��

(&floatSlot == 4.0)

� �

(float.eq &floatSlot 4.0)

!= ��� ��, �� ��. �� ��� �� �� true� �����.

��: ��

!=

� �

float.ne

��: float, float

�: ��

(&floatSlot != 4.0)

� �

(float.ne &floatSlot 4.0)

> ��� ��, �� �. �� �� �� ��� � �� true� �����.

��: ��

>

� �

float.gt

��: float, float

�: ��

(&floatSlot > 4.0)

� �

(float.gt &floatSlot 4.0)

356 IBM Tivoli Enterprise Console: � �� ���

>= ��� ��, �� �� �� ��. �� �� �� � �� �� true�

�����.

��: ��

>=

� �

float.ge

��: float, float

�: ��

(&floatSlot >= 4.0)

� �

(float.ge &floatSlot 4.0)

< ��� ��, �� ��. �� �� �� ��� �� �� true� ���

��.

��: ��

<

� �

float.lt

��: float, float

�: ��

(&floatSlot < 4.0)

� �

(float.lt &floatSlot 4.0)

<= ��� ��, �� �� �� ��. �� �� �� � �� �� true�

�����.

��: ��

<=

� �

� 9 � �� �� �� 357

float.le

��: float, float

�: ��

(&floatSlot <= 4.0)

� �

(float.le &floatSlot 4.0)

� ��

�� ���� ��� � �� �� �����.

v +

v -

v *

v /

v absolute

v max

v min

v negate

v range

+ ��� ��, ���. ���� �� � ��� �����.

��: ��

+

� �

float.add

��: float, float

�: ��

(&floatSlot + 4.0)

� �

(float.add &floatSlot 4.0)

358 IBM Tivoli Enterprise Console: � �� ���

- ��� ��, ��. �� ��� �� �� � � ��� �����.

��: ��

-

� �

float.sub

��: float, float

�: ��

(&floatSlot - 4.0)

� �

(float.sub &floatSlot 4.0)

* ��� ��, "��. "�� �� � ��� �����.

��: ��

*

� �

float.mul

��: float, float

�: ��

(&floatSlot * 4.0)

� �

(float.mul &floatSlot 4.0)

/ ��� ��, ���. �� �� �� �� �� � ��� �����.

��: ��

*

� �

float.div

��: float, float

� 9 � �� �� �� 359

�: ��

(&floatSlot / 4.0)

� �

(float.div &floatSlot 4.0)

absolute � �� �� �� �����.

��: ��

abs(..)

� �

float.abs

��: float

�: ��

abs(&floatSlot)

� �

(float.abs &floatSlot)

max � �� ���� ���� �����. � ��� �� �����.

��: ��

max(..)

� �

float.max

��: float*

�: ��

max(&floatSlot, 4.0)

� �

(float.max &floatSlot 4.0)

min � �� ���� ���� �����. � ��� �� �����.

��: ��

min(..)

360 IBM Tivoli Enterprise Console: � �� ���

� �

float.min

��: float*

�: ��

min(&floatSlot, 4.0)

� �

(float.min &floatSlot 4.0)

negate � �� ��� �����.

��: ��

neg(..)

� �

float.neg

��: float

�: ��

neg(&floatSlot)

� �

(float.neg &floatSlot)

range �� � �� ���� ��� ��� �����. � ��� �� �����.

��: ��

range(..)

� �

float.range

��: float*

�: ��

range(&floatSlot, 4.0, 100.5)

� �

(float.range &floatSlot 4.0 100.5)

� 9 � �� �� �� 361

�� ��

�� ���� ��� � �� �� �����.

v ==

v !=

v >

v >=

v <

v <=

v endsWith

v ignorecase equal

v ignorecase not equal

v startsWith

== ��� ��, ��. �� �� �� true� �����.

��: ��

==

� �

string.eq

��: string, string

�: ��

(&stringSlot == "somestr")

� �

(string.eq &stringSlot "somestr")

!= ��� ��, �� ��. �� ��� �� �� true� �����.

��: ��

!=

� �

string.ne

��: string, string

�: ��

362 IBM Tivoli Enterprise Console: � �� ���

(&stringSlot != "somestr")

� �

(string.ne &stringSlot "somestr")

> ��� ��, �� �. �� �� �� ��� � �� true� �����.

��: ��

>

� �

string.gt

��: string, string

�: ��

(&stringSlot > "somestr")

� �

(string.gt &stringSlot "somestr")

>= ��� ��, �� �� �� ��. �� �� �� � �� �� true�

�����.

��: ��

>=

� �

string.ge

��: string, string

�: ��

(&stringSlot >= "somestr")

� �

(string.ge &stringSlot "somestr")

< ��� ��, �� ��. �� �� �� ��� �� �� true� ���

��.

��: ��

� 9 � �� �� �� 363

<

� �

string.lt

��: string, string

�: ��

(&stringSlot < "somestr")

� �

(string.lt &stringSlot "somestr")

<= ��� ��, �� �� �� ��. �� �� �� � �� �� true

� �����.

��: ��

<=

� �

string.le

��: string, string

�: ��

(&stringSlot <= "somestr")

� �

(string.le &stringSlot "somestr")

contains �� �� �� �� �� � �� true� �����.

��: ��

contains(..)

� �

string.contains

��: string, string

�: ��

contians(&stringSlot, “somestr")

364 IBM Tivoli Enterprise Console: � �� ���

� �

(string.contains&stringSlot "somestr")

endsWith �� �� �� �� ��� �� true� �����.

��: ��

endsWith(..)

� �

string.endsWith

��: string, string

�: ��

endsWith(&stringSlot, “somestr")

� �

(string.endsWith &stringSlot "somestr")

ignorecase equal �� �� �� true� �����. � � ���� �����.

��: ��

iceq(..)

� �

string.iceq

��: string, string

�: ��

iceq(&stringSlot, “somestr")

� �

(string.iceq &stringSlot "somestr")

ignorecase not equal �� ��� �� �� true� �����. � � ���� �����.

��: ��

icne(..)

� �

string.icne

� 9 � �� �� �� 365

��: string, string

�: ��

icne(&stringSlot, “somestr")

� �

(string.icne &stringSlot "somestr")

startsWith �� �� �� �� � ���� �� true� �����.

��: ��

startsWith(..)

� �

string.startsWith

��: string, string

�: ��

startsWith(&stringSlot, “somestr")

� �

(string.startsWith &stringSlot "somestr")

�� ��

�� ���� ��� � �� �� �����.

v concat

v dayOfWeek

v dayOfWeekString

v existRuleId

v getEventType

v hourOfDay

v length

v month

v monthString

v substring

v toUpperCase

v toLowerCase

v trim

366 IBM Tivoli Enterprise Console: � �� ���

concat �� ���� ��� � � �����. � ��� �� �����.

��: ��

concat(..)

� �

string.concat

��: string*

�: ��

concat(&stringSlot, “-1”)

� �

(string.concat &stringSlot “-1”)

dayOfWeek �� � � ��� �� ��� ���(����� ������ ���� 1 - 7)

�����. �� ��� �� ��� ���.

yyyy/MM/dd,HH:mm:ss

��� ��, UTC ��

yyyy/MM/dd,HH:mm:ss z

��� (�: 2001/10/23,14:30:33 PDT)

yyyy/MM/dd,HH:mm:ss'Z'

��� ��, Z� UTC ��

��: ��

dayOfWeek(..)

� �

string.dayOfWeek

��: string

�: ��

dayOfWeek(“2001/10/23,14:30:33”)

� �

(string.dayOfWeek “2001/10/23,14:30:33”)

� 9 � �� �� �� 367

dayOfWeekString �� � � ��� �� ��� � �(����� �����) �����. ��

��� �� ��� ���.

yyyy/MM/dd,HH:mm:ss

��� ��, UTC ��

yyyy/MM/dd,HH:mm:ss z

��� (�: 2001/10/23,14:30:33 PDT)

yyyy/MM/dd,HH:mm:ss'Z'

��� ��, Z� UTC ��

��: ��

dayOfWeekString(..)

� �

string.dayOfWeekString

��: string

�: ��

dayOfWeekString(“2001/10/23,14:30:33”)

� �

(string.dayOfWeekString “2001/10/23,14:30:33”)

existRuleId ��� � ID� ���� �� true� �����.

��: ��

existRuleId(..)

� �

string.existRuleId

��: string

�: ��

existRuleId(“tree.left”)

� �

(string.existRuleId “tree.left”)

368 IBM Tivoli Enterprise Console: � �� ���

getEventType � � � ��� ���� ��� �����.

��: ��

getEventType(..)

� �

string.getEventType

��: �� ����.

�: ��

getEventType()

� �

(string.getEventType)

hourOfDay �� � � ��� �� 24� ��� ���� ��� ��� �����. �� �

�� �� ��� ���.

yyyy/MM/dd,HH:mm:ss

��� ��, UTC ��

yyyy/MM/dd,HH:mm:ss z

��� (�: 2001/10/23,14:30:33 PDT)

yyyy/MM/dd,HH:mm:ss'Z'

��� ��, Z� UTC ��

��: ��

hourOfDay(..)

� �

string.hourOfDay

��: string

�: ��

hourOfDay(“2001/10/23,14:30:33”)

� �

(string.hourOfDay “2001/10/23,14:30:33”)

� 9 � �� �� �� 369

length � �� ��(��)� �����.

��: ��

length(..)

� �

string.length

��: string

�: ��

length(&stringSlot)

� �

(string.length &stringSlot)

month �� � � ��� �� �� ���(1��� 12��� 0�� 11�) �����. �

� ��� �� ��� ���.

yyyy/MM/dd,HH:mm:ss

��� ��, UTC ��

yyyy/MM/dd,HH:mm:ss z

��� (�: 2001/10/23,14:30:33 PDT)

yyyy/MM/dd,HH:mm:ss'Z'

��� ��, Z� UTC ��

��: ��

month(..)

� �

string.month

��: string

�: ��

month(“2001/10/23,14:30:33”)

� �

(string.month “2001/10/23,14:30:33”)

370 IBM Tivoli Enterprise Console: � �� ���

monthString �� � � ��� �� �� � �(1��� 12���) �����. �� ���

�� ��� ���.

yyyy/MM/dd,HH:mm:ss

��� ��, UTC ��

yyyy/MM/dd,HH:mm:ss z

��� (�: 2001/10/23,14:30:33 PDT)

yyyy/MM/dd,HH:mm:ss'Z'

��� ��, Z� UTC ��

��: ��

monthString(..)

� �

string.monthString

��: string

�: ��

monthString(“2001/10/23,14:30:33”)

� �

(string.monthString “2001/10/23,14:30:33”)

substring �� � �� �� ����, � �� �� � � �����. � ��

�� �����.

��: ��

substring(..)

� �

string.substring

��: string, int(��), int(��)

�: ��

substring(&stringSlot, 3, 5)

� �

(string.substring &stringSlot 3 5)

� 9 � �� �� �� 371

toUpperCase �� �� ��� ��� � � � �����.

��: ��

toUpperCase(..)

� �

string.toUpperCase

��: string

�: ��

toUpperCase(&stringSlot)

� �

(string.toUpperCase &stringSlot)

toLowerCase �� �� ��� ��� � � � �����.

��: ��

toLowerCase(..)

� �

string.toLowerCase

��: string

�: ��

toLowerCase(&stringSlot)

� �

(string.toLowerCase &stringSlot)

trim �� �� � � ��� �� � � � �����.

��: ��

trim(..)

� �

string.trim

��: string

372 IBM Tivoli Enterprise Console: � �� ���

�: ��

trim(&stringSlot)

� �

(string.trim &stringSlot)

IP �� ��

�� ���� ��� IP �� �� �� �����.

v ==

v !=

== ��� ��, ��. �� �� �� true� �����.

��: ��

==

� �

ipaddress.eq

��: ipaddress, ipaddress

�: ��

(&ipAddrSlot == 9.4.3.2)

� �

(ipaddress.eq &ipAddrSlot 9.4.3.2)

!= ��� ��, �� ��. �� ��� �� �� true� �����.

��: ��

!=

� �

ipaddress.ne

��: ipaddress, ipaddress

�: ��

(&ipAddrSlot != 9.4.3.2)

� �

(ipaddress.ne &ipAddrSlot 9.4.3.2)

� 9 � �� �� �� 373

�� �� ��

�� ���� ��� � �� �� �� �����.

v ==

v !=

v areDisjoint

v isMemberOf

v isSubsetOf

== ��� ��, ��. �� �� �� true� �����.

��: ��

==

� �

stringset.eq

��: set, set

�: ��

(&setSlot == [1, 5])

� �

(stringset.eq &setSlot [1, 5])

!= ��� ��, �� ��. �� ��� �� �� true� �����.

��: ��

!=

� �

stringset.ne

��: set, set

�: ��

(&setSlot != [1, 5])

� �

(stringset.ne &setSlot [1, 5])

374 IBM Tivoli Enterprise Console: � �� ���

areDisjoint �� �� � �� �, � ���� �� �� true� �����.

��: ��

areDisjoint(..)

� �

stringset.areDisjoint

��: set, set

�: ��

areDisjoint(&setSlot, [“off”])

� �

(stringset.areDisjoint &setSlot [“off”])

isMemberOf �� � �� � � �� ��� ��� �� true� �����.

��: ��

isMemberOf(..)

� �

stringset.isMemberOf

��: string, set

�: ��

isMemberOf(“error”, $setSlot)

� �

(stringset.isMemberOf “error” &setSlot)

isSubsetOf �� �� �� �� ���� �� true� �����.

��: ��

isSubsetOf(..)

� �

stringset.isSubsetOf

��: set, set

� 9 � �� �� �� 375

�: ��

isSubsetOf(&setSlot, [1, 2, 3])

� �

(stringset.isSubsetOf &setSlot [1, 2, 3])

�� �� ��

�� ���� ��� � �� �� �� �����.

v intersect

v join

v previousValues

intersect � ��� �� ��� �����. � ��� �� �����.

��: ��

intersect(..)

� �

stringset.intersect

��: set*

�: ��

intersect(&setSlot1, &setSlot2)

� �

(stringset.intersect &setSlot1 &setSlot2)

join � ��� ���� ��� ��� �����. � ��� �� �����.

��: ��

join(..)

� �

stringset.join

��: set*

�: ��

join(&setSlot, [“ibm”, “tivoli”])

� �

376 IBM Tivoli Enterprise Console: � �� ���

(stringset.join &setSlot [“ibm”, “tivoli”])

previousValues �� ��� � ���� ��� ���� � �� ��� ���� � ���

�����.

��: ��

previousValues(..)

� �

stringset.previousValues

��: string(attribute_type)

�: ��

previousValues(“hostname”)

� �

(stringset.previousValues “hostname”)

�� ��

�� ���� ��� �� �� �� �����.

v and

v not

v or

and �� �� �� and ��� �����. � ��� �� �����.

��: ��

&&

� �

boolean.and

��: boolean*

�: ��

(&booleanSlot && (&intSlot > 4))

� �

(boolean.and &booleanSlot (int.gt &intSlot 4))

� 9 � �� �� �� 377

not �� �� �� ��� �����.

��: ��

!

� �

boolean.not

��: boolean

�: ��

(!&booleanSlot)

� �

(boolean.not &booleanSlot)

or �� �� �� �� ��� �����. � ��� �� �����.

��: ��

||

� �

boolean.or

��: boolean

�: ��

(&booleanSlot || (&intSlot > 4))

� �

(boolean.or &booleanSlot (int.gt &intSlot 4))

�� �� ��

��� �� �� ����.

isMemberOf �� ��� �� ��, �� �� ��� �� �� �� true� ��

���.

��: ��

isMemberOf(..)

� �

378 IBM Tivoli Enterprise Console: � �� ���

intset.isMemberOf

��: integer, intset

�: ��

isMemberOf(5, [1, 3 - 6, 9])

� �

(intset.isMemberOf 5 [1, 3 - 6, 9])

IP �� �� ��

��� IP �� �� ����.

isMemberOf �� IP ��� �� ��, �� �� ��� IP ��� �� �� true

� �����.

��: ��

isMemberOf(..)

� �

ipaddress.isMemberOf

��: ipaddress, ipaddressset

�: ��

isMemberOf(9.4.3.2, [9.4./16])

� �

(ipaddress.isMemberOf 9.4.3.2 [9.4./16])

�� �� ���

��� �� �� ������. Tivoli ��� � �� �� ���� ��� �

����. �� ���� �� ������ �����. ���� ��� ID� ��

���� � ���.

ECOZC1001E URL url� �� �� XML ��

��� ���.

��: �� �� XML �� ��� ��� �� ��

� ���� �� URL ��� � ��� ����.

��� �: �� ��� URL ��� ��� ��� �

����.

ECOZC1002E ��� �� �� ��� ���

�����.

��: �� �� ��� ���� ���� �����.

��� �: Tivoli Tivoli Customer� ������.

ECOZC1001E

� 9 � �� �� �� 379

ECOZC1003E ��� �� �� ���� ���

���� �� �� ��� ��� �

����.

��: �� �� ��� ���� ���� �����.

��� �: Tivoli Customer Support� ������.

ECOZC1004E �� �� � rule�(�) �� ��

���� ��� � ��� �����.

��: ���� �� �� �� �� ���� ���

� ������.

��� �: Tivoli Customer Support� ������.

ECOZC1005E �� �� �� �� predicate �

� ��� ���.

��: �� �� �� ���� �� �� �����.

��� �: �� �� XML �� ��� �� ���

�� ����� �����. �� �� ���

Tivoli ��� � � �� ���� ������.

ECOZC1006E �� �� �� �� ��� class �

function�(�) ��� ���.

��: �� �� ��� ���� �� ��� ����

���.

��� �: �� �� XML �� ��� �� ���

��� ����� �����. � ��� �� ��

� Tivoli ��� � � �� ���� �����

�.

ECOZC1007E �� �� �� �� ��� class �

function�(�) parameter ���

� ���� ���.

��: �� �� �� ��� ���� �� �����

�����.

��� �: �� �� XML �� ��� �� ���

��� ���� ��� ��� ����� �����

�����. � ��� �� ��� Tivoli ��� �

� �� ���� ������.

ECOZC1008E �� ��� �� ��� ���

�� file�(�) ��� ���.

��: �� ��� � ��� ���� ��� ��

� ���� �� �� ��� ����� �� �

� ��� ����.

��� �: �� ��� �� ��� ���� ��

�� � �� ��� ���� �� ��� ��, �

� ��� �� �����. �� ��� ����

� �����.

ECOZC1009E �� ��� ��� ��� ��

� ��� directory �� ��� ��

�.

��: ��� ��� ��� ���� ��� ����

�� �������.

��� �: �� ��� �� ��� ���� ��

�� � �� ��� ����, �� ��� ��,

�� ��� �� �����.

ECOZC1010E �� �� XML �� ��� ��

��� ���.

��: �� �� XML �� ��� �� ��� ��

�.

��� �: �� �� XML �� ��� ���� �

�� ���� �����.

ECOZC1011E �� �� XML �� ��� ��

��� �����.

��: �� �� XML �� ��� �� � ��� �

� �� ��� �� � ����.

��� �: Tivoli Customer Support� ������.

ECOZC1012E �� �� XML �� ��� ��

��� �����.

��: �� �� ��� ���� ���� �����.

��� �: Tivoli Customer Support� ������.

ECOZC1013E �� �� � �� ��� ��

��� ���.

��: �� �� ��� �� ��� �� ��� �

��.

��� �: �� �� ��� �� ��� ���� �

�� ���� �����.

ECOZC1014E �� �� � �� ��� �

��� �� ��� ���.

��: �� �� ��� �� ��� ��� ��� �

� ��� ���.

ECOZC1003E

380 IBM Tivoli Enterprise Console: � �� ���

��� �: �� �� ��� �� ��� ��� �

��� �����.

ECOZC1015E �� �� XML �� ��� ��

��� �����. defaultType �

�� � type�(�) ��� ���.

��: �� �� XML �� ��� defaultType ���

�� �� � ��� �����.

��� �: �� �� XML �� ��� ���

defaultType ����� ��� ���� �����. �

�� ��� Int, Float, Set, Boolean � String���.

������ BAROC ��� �� ��� �����

��� �� �� ��� ���� �� � defaultType

����� �����.

ECOZC1016E �� �� XML �� ��� ��

��� ���. predicate �� ��

� ���.

��: �� �� XML �� ��� �� �� ���

���.

��� �: �� ��� ��� ���� ���

��. �� �� ��� Tivoli ��� � �� �

�����.

ECOZC1017E �� �� XML �� ��� �

predicate� �� �� term� �� ��

� ���.

��: �� ���� �� ��� �������.

��� �: �� ��� ������. �� ��

��� Tivoli Event ��� � � �� ����

������.

ECOZC1018E �� �� � rule� �� action�

��� ���.

��: �� �� ��� ���� ���� �����.

��� �: Tivoli Customer Support� ������.

ECOZC1019E rule �� ���� � � ��� �

����. � �� folder�(�) ��

��.

��: �� � �� ���� �� ���� ����

��. �� ����� � �� �� ��� ���.

��� �: Tivoli Customer Support� ������.

ECOZC1020E rule1 �� ���� � � ���

�����. � �� ��� rule2 ��

�� ��� ���.

��: � ��� �� �� �����. � �� ���

�� �� �� �� ��� ���.

��� �: Tivoli Customer Support� ������.

ECOZC1021E �� � ��� ���� ��� �

��� �����. �� file� ���

�� ���� ���.

��: ��� ���� ���� �����. � ��

�� �� ��� � � ��� � � ���.

��� �: �� �� ��� �� ��� �

�� �� �� ��� ��� �����. ��� �

��� Tivoli Customer Support� ������.

ECOZC1022E �� �� � �� ��� ��

�� �� ��� �����.

��: �� �� ��� �� ��� ��� ��� �

� ���.

��� �: ��� ��� �� event_type name

type ��� ��� ���.

ECOZC1023E �� �� � ��� ���

�� type ��� ���.

��: �� �� ��� �� ��� ��� ��� �

� ��� ���.

��� �: ��� �� ��� ������.

ECOZC1024E �� �� � �� �� file�

(�) �� � ��� �����.

��: ���� �� �� �� ��� �� ��� �

���� �� �� ��� �����.

��� �: Tivoli Customer Support� ������.

ECOZC1025E �� �� ��� ��� ���

���. event ���� ��� ��

�.

��: �� �� ��� �� ��� �� ���

��� ������. � ��� �� ��� ��

� �� �� �� �����.

��� �: �� �� ��� �� ��� �

ECOZC1015E

� 9 � �� �� �� 381

�� �� �� ��� ��� �����. ��� �

��� Tivoli Customer Support� ������.

ECOZC1026E ��� ���� � ��

(totalSize)� � � ��� ���

��� �� ��(maxFileSize)� ��

� � �� �� �.

��: �� �� ��� ���� ���� �����.

��� �: ��� ��� ���� � ��

(persistence.provider.totalSize)� � ��� ��

� �� ����� �� ��(persistence.provider.

maxFileSize)� ��� ��� �����.

ECOZC1027E ��� ��� �� operation

event ���� ��� � ��� ���

��.

��: �� �� ��� ���� ����� �� �

��� � ����. �� �� ��� ��� ��

��� �, �� ��� ��� �� �� ���

��. �� ��, ��� ��� ��� �� � �

��� ��� ����.

��� �: ��� ���� �� ��� �� �

��� �� � � ��� ��� �����.

ECOZC1026E

382 IBM Tivoli Enterprise Console: � �� ���

� 3 � ��

© Copyright IBM Corp. 2003 383

384 IBM Tivoli Enterprise Console: � �� ���

�� A. ���� Prolog ��

Tivoli Enterprise Console � ��� Prolog �� ��� �� ���� �� Prolog

�� ��� ������. ��� ��� ��� �� Prolog� ��� ��

�� � ���.

� ����� Prolog� �� ��� ����, � ��� ���� Prolog ��� �

�� �� � � ��� �� �� ��� �� Tivoli Enterprise Console

� ��� ���� �� ��� Prolog� �� �� �� �����. Prolog�

��� �� ���� xiii ���� ��� ���� ������.

Prolog �� � ��

� �� ��� � Prolog �� �� HTML ��� ��� �� IBM Tivoli

Enterprise Console �� �� ��� �� ��� �� ���� �� ���� �

� � ���.

$BINDIR/../generic_unix/TME/TEC/BOOKS/HTML/reference.html

�� CD� �� ����� �� � ���.

/BOOKS/HTML/reference.html

�� ��

Prolog� ���� �� ��� ���� �� ����� ��� ���� ���

�� �� �� ��� ����� �����. �� ����� Prolog�� ���

� ���, ��� �� � �� ���.

�� ��� ��� ��, ��, �� �� �� �� � � ���.

� � �� �. �� �� ����� ��� � � ��� ���

���� ��� �����. � � � �� �� ��� �� �

���. �� ��� �� �� � �� ����.

� � � �� �. ��� �� �� �� �(_)� ����, ��� ���

�� ��� ���� �� � ��� ��� � ���. Tivoli

Enterprise Console ��� ��� ��� � ��� �����.

� �

� �� ��. �� �� � �� ��� �����. � � �� ��

© Copyright IBM Corp. 2003 385

�� ��� �� ��� �� �(functor)� �����. �� �� �

��� ����� �� ����. �� �� � ��� ��

�� ���� �����.

�� ��� �� �����.

functor(arg1, ...)

�� ��� ��� � �� �� ��� �� ���. �� ��

� � �� ��� ��� ���. ��� �� �� �� �� �

��(arity)���. �� ��, �� �� � in_state� � � ��

2 ����. �� Austin� Texas �� ��� �����(���,

Austin� Texas �� ���).

in_state(’Austin’, ’Texas’)

��� ��, �� �� �� ���� �, 0� ��� �� � � ����

�. �� ����� ��� ���� �� �����.

[’Austin’, ’Dallas’, ’Houston’]

� �� �� �(null) ��� ��� �� �����.

[ ]

��

Prolog ���� ��� ��� ��� �� ��� ��� �����. �, ���

� �� ��� �����. �� ��, Austin� ���� ��� �� ��� � �

� ���.

city(’Austin’)

Austin� Texas �� � ���� ��� �� ��� � � � ���.

in_state(’Austin’, ’Texas’)

Texas� USA� � ��� ��� �� ��� � � � ���.

in_country(’Texas’, ’USA’)

Prolog ���� �� �� ��� �� ��� �����(Prolog �� Tivoli

Enterprise Console ��� ��). �� �� ��(�� �)� ��� ���� ��

��� �����. �� �� � ��� ���� :- ��(�� � ����� �

��� if ��� ��)� ����. �� ��� ����. �� �� �� �

���� ��� ��� �� �� �, ��, �� � �� �� �����. ��

��, �� ��� USA� � �� � � USA� ���� ��� �� �� �

��� �� ��� �� �� � ���.

in_usa(_city) :- city(_city), in_state(_city, _state), in_country(_state, ’USA’).

386 IBM Tivoli Enterprise Console: � �� ���

in_usa �� �����, � �� ��� �� ��� ���. ��, �� city

�� ��� ��� (in_usa �� _city �� �) �� ��� ��� ��

����. �� ��, city �� �����. �� ��, ��� USA� ��

�� �� ����, in_state �� ���� ��� �� � �� ��� state

��� ��� ���.

�����, �� USA� ��, in_country �� �����. � �� � ��

����, �� �����.

� �� ��� �� ��� � ���� ��� ��� �� ������.

��� ��� �, ��� �� �����. � ��� � ��� � �� ��

AND ��� �����. ���, ��� �� �� �� ���� ��� ��

�. � �� �� �� �� ����� ��� ���. ��� ��� � ��

� �� �� �� �����.

�� ��

�� � �� �� ���� ��� � ��� �����. �� ��� Prolog ��

� ��� ��� ��� � �� �� ���. �� � �� assert ��

�� ��� �����. �� ��� �� ��� �����, ��� �� ��

� ���.

city(’Austin’) in_state(’Austin’, ’Texas’)

assert(city(’Austin’) ) assert( in_state(’Austin’, ’Texas’) )

�� �� ��� ��� � �� �� :- �� �� ��� �� �

�� �� �� �����. � in_usa(_city)� �� ���� ��� �� ��

���.

assert( ((in_usa(_city) :- city(_city), in_state(_city, _state), in_country(_state, ’USA’) ))

Prolog ���� �� �� ��� ��� �� ���� �� �� �� �

� ��� � ���. �� �� �� �� �� �� ��� ���� ��

�� �� �� � ���. Austin� Texas �� �� ���� ��, ���

�� �� � ���.

city(’Austin’)

city �� �� � �� �� ��� Austin��� ��� �� � �� �

�� �����. ���, �� ���� �� �� ��� �����. �� ���

����, �� ���� ��� �� �� �� ��� ��� ���. ���

� ��� �� �� �� ���� �� �� �����. Austin� USA� �

� �� �� ��, �� ��� ���� �� �� �� � ���.

�� A. ���� Prolog �� 387

in_usa(’Austin’)

in_usa(’Austin’) �� ��� ��� ��� ��� �����.

city(_city)

in_state(_city, _state)

in_country(_state, ’USA’)

�� ���� � �� � ����, in_usa(’Austin’) �� �����.

��� ��� � �� ��� � ���. �� �� Austin�� ��� ��

�� ��� �� �� ��� �����. � �� in_state(’Austin’,

’Texas’)� ��� ����, �� ��� ��� � � Texas �� _state ���

�����.

in_state(’Austin’, _state)

��

Prolog �� � Tivoli Enterprise Console ��� �� � � � ����

�� ��� ���. /*(��� ��� ���) � */(��� ��� ���)

�� ��� �� � ���� ��� ���� ����� �� �����.

� ��� ���� �� ��� �� �� �� � ���. �� � �

�� %(��)���. � � �� � �� � �� ���� ����. ��

� ��� ���� �� �� ��� � �� �� � ����. % �

� /* */ �� �� �� � ��, � ��� ��� � ���� �

����.

��� �� � �

�� ��� ��� Prolog ��� ��� �� ��� �����.

�� ��� ��� �� �, � � �� �� � � � . �

� ������ �� �� ��� �� � ���. �� �

�� 32767� ���� ���. BAROC �� �� STRING� �� 255

�� �� � �� ������.

��� ��, ��, � �� � ��� ��� ��� �� ��

� -268435456 - 268435455� ��� ��� � 29� �(-228�� 228-1�

�). 10��� � ���, 1 - 36� �� �� ���� ��� � �

��. 10��� �� �� ���� ���� ��’����. �� ��,

2’1111011, 8’173 � 16’7B� � 10�� 123� �� 2�, 8� � 16��

�� ��� ����. ��� �� ��� ����� � � � ���. �

� ��, 1.23e+2� 123� �����.

�� ��� ��� �(heap)� �� �� ���� ��� �����.

� �� �� �� ��� ��� ��� �� ��

388 IBM Tivoli Enterprise Console: � �� ���

�� � ��� Tivoli Enterprise Console ��� ���, �� �

�(�: date_reception �� � � cause_date_reception �� �) � BAROC

��� �� INT32 �� �� ��� �����. � �� 32 �� �

���� 0x� ���� 16��� �����.

� �� �� � ��(arity)� 64���.

� �� �� � ��� 16��� ��� � ��� �. ��� ��

� ��� ����� ��� � ���. 1.23 � 123e-2� � �� 1.23

� �����. ��� ��� ±2.2250738585072014e-308 -

±1.79769313486231570e+308���.

BAROC� Prolog � ��� �� ��

Tivoli Enterprise Console ��� ��� BAROC ��� ���� �����. Tivoli

Enterprise Console �� Prolog ��� ���� � ��, BAROC ��� ���

Prolog ��� ��� ��� �� �� ���. �� ���� �� ���

��.

BAROC �� Prolog ��

��

ENUM �

INTEGER ��

INT32 �

REAL ��

STRING �

LIST ��

Tivoli Enterprise Console ��� Prolog �� ��

�� ��� ��� �� Prolog �� Tivoli Enterprise Console �� �� �

���. Tivoli Enterprise Console �� ��� Prolog �� Tivoli Enterprise

Console �� �� �� �� ���. 390 ���� ��� �� ��� ��

� �� Tivoli Enterprise Console ��� �� � �� �����. �� ���

�� ��, ���� �� �� ��� ��� ����.

� � �� �� ��� �� �����.

����

�� ��� ��� �� �����. � ��� ������, �� �

� � ��� �� �� ��� � ���. ����� �� ground�

� ����.

��� ��� �� �� ����. ��� ��� ���, ��� ���

��. ��� ���, ��� �����. �� ���� in_state(’Houston’,

�� A. ���� Prolog �� 389

_state) �� _state ��� Texas �� �����. � �� �� _state

���� ��� �� �����. ��� �� = ��� �� � �

��(�� ��).

rule: assert_rules: ( event: _event of_class _class, action: make_assertions: ( assert( city(’Austin’) ), assert( city(’Dallas’) ), assert( city(’Houston’) ), % Define what cities exist in the knowledge base. assert( in_state(’Austin’, ’Texas’) ), assert( in_state(’Dallas’, ’Texas’) ), assert( in_state(’Houston’, ’Texas’) ), % Define which cities are in which states. assert( in_country(’Texas’, ’USA’) ), % Define which states are in which countries. assert(( in_usa(_city) :- % Define a rule about which cities are in the USA. city(_city), % Is _city a fact in the knowledge base? If so, then continue. in_state(_city, _state), % Is there a rule which places _city in _state? If so, then % unify _state with the atom representing the state and continue. in_country(_state, ’USA’) % Is there a rule which places _state in the USA? If so, then % exit the in_usa predicate with success. )) ), action: test_assertions: ( city(’Austin’), % Succeeds. Austin is a city. in_state(’Austin’, ’Texas’), % Succeeds. Austin is in Texas. in_country(’Texas’, ’USA’), % Succeeds. Texas is in the USA. in_usa(’Austin’), % Succeeds. Austin is in the USA. in_usa(’Dallas’), % Succeeds. Dallas is in the USA. city(’Houston’), % Succeeds. Houston is a city. in_state(’Houston’, _state), % Succeeds. _state is unified with % Texas. in_country(_state, ’USA’), % Succeeds. Texas is in the USA. in_usa(’San Antonio’) % Fails. In the knowledge base, San Antonio is not in the USA. % In fact, it’s not even a valid city. The in_usa predicate failed at the % line city(_city), so the entire predicate fails. ) ).

390 IBM Tivoli Enterprise Console: � �� ���

Prolog �� � ���� � ��

� �� �� � � ��� ���� ��� �� �� � � ��� ��

����. ��� �� �� �� ��� �� � � ��� � �� ���� �

��� �� ���.

���� � ���

��� ��� ���� �� �� ��� �����. ��� �� �� ��

�� ���� �� ���� �� �����. �� ����, �� ����

� �� ��� �����. ��� ��� ����, �� �������. �

�� = ��� ����� � ���. ��� � ��� ����� ��, ==

��� ��� � ���.

�� ��� � ��� � � ��� � �� ���.

�/

��� ��

\== � �� �� ��

= � �� ��

=? � � �

== � �� ��

not � �� �

��� �� � �� ���� ���

Test �� �� ��� ��� ��� ��� �������� ����� �

�����.

�� ��� � ��� � � ��� � �� ���.

� ��

atom ��� � ��� ������.

atomic ��� �� ��� ������.

ground ��� �������� ��� ������.

integer ��� �� ��� ��� ������.

is_list ��� ��� ��� ������.

number ��� � ��� ��� ������.

pointer ��� � ��� ��� ������.

real(�� �� ���) ��� �� ��� ��� ������.

term_type ��� ��� ����.

�� A. ���� Prolog �� 391

��� �� ��

Conversion �� �� ��� ��� ���� � �����.

�� ��� � ��� �� � �� ���.

� ��

ascii ASCII �� ASCII �� �� �����.

inttoatom ��� ��� � �� �� �����.

pointertoatom �� �� � �� �� �����.

pointertoint �� �� �� �� �� �����.

real(�� ��) �� ��� �� ���� �����.

realtoatom ��� ��� � �� �� �����.

�� �

� � �� ����� ��� �� ��� Prolog�� � �� ����. Prolog

�� � � �� �� ��� ����. �� ����� �� ‘atom’� �

� �����. �� � � � ��� Prolog �����(�: [a,t,o,m]) ��

ASCII �� �����(�: [97,116,111,109]) ��� � ���. atom� ����

� � ����(�: ″� ″), ��� ��� ���� �� ASCII ��� ��

���([115, 116, 114, 105, 110, 103]).

� � �

�� ��� �� � �(�� ��, �� �� ), �� ��� ��� ��

��.

v �� @< � @< � @< � @< �. ��� ��� � �� ��(�

� ��), �� � �� �� �� ����.

��� ���, �� ��� �� ��� ���.

v ��� ��� ��� �����.

v �� ���� �����.

v �� ���� �����.

v �� ���� �����.

v �� � ��� �� �����.

– � ��� ���, ��� �� �����.

– ��� � ��� ���, ���� ����� �� �� ����� ��

���.

392 IBM Tivoli Enterprise Console: � �� ���

�� ��� � ��� �� � �� ���.

� ��

@< �� ���� �� � �� ��� ��� ������.

@=< �� ���� �� �� � �� ��� ��� ������.

@> �� ���� �� � �� ��� ��� ������.

@>= �� ���� �� �� � �� ��� ��� ������.

��

��� �� �� ����� ����� � �� �� �����. �� ���

� � �� ��� � ��� �����. ��� =? ��� = �� �� ��

�� ��� �����.

�� ��� � ��� �� � �� ���.

� ��

int_to_hex ��� 16� � ��

strip ��� � �

substring � �� ��� ��

��

��� �� ��� ��� ��� �����.

�� ��� � ��� �� � �� ���.

� ��

atomlength �� �� ��

atomconcat � ��

atompart ��� ��� ��

lowertoupper ��� �� � �� ��

sprintf �� ���� ��� �

� �

�� �� �� �� ��� ��� ��� ��� �� � ���.

�� ��� � ��� �� � �� ���.

� ��

append ��� �� ��

atomtolist � ��� � �� �� ��

delete ���� �� ��

disjoint �� �� �� �� ��� ��

empty_list ��� � �� ���

�� A. ���� Prolog �� 393

� ��

intersect � �� �� ��� � ��

length ��� �� ��

member �� �� �� �

name � ��� � �� �� �� ��

nmember �� � �� �� �� �

nmembers �� � �� �� �� �

remove_dups ���� � �� �

rremove ���� �� �� �

sort ��� ��� ���� ��

subset ��� �� ��� ����� ��� ���

subtract ��� � �� �

union �� �� �� �� �� ��

��� � �

� � ��� ��� ��� �� � ���.

� � ��

� �� ��� ���� � ��� � �� ��� ��� ��� �� �

�� � � �����.

�� ��� � ��� �� � �� ���.

� ��

is ��� ��

�� �

� �� ��� ���� ��� ��� � �� ��� ��� � �

�����. ��� ��� � �� ������ ���.

�� ��� � ��� �� � �� ���.

� ��

< ��� ��, �� ��

=:= ��� ��, ��

=\= ��� ��, �� ��

=< ��� ��, �� ��

> ��� ��, �� �

>= ��� ��, �� �� ��

��� ���

� ��� ��� ��� ��� ��� � � �����.

394 IBM Tivoli Enterprise Console: � �� ���

�� ��� � ��� ��� � �� ���.

��� ��

+ �� ��

-(�� ��) � �� ��

-(��) �� ��

* "�� ��

/ �� ��� ��

// �� ��� ��

��� ��

Tivoli Enterprise Console �� � ��� �� �� ���� �����.

v 32� �� ���

v �� �� ���� ��� ��(�� ��� �)

BAROC �� INT32 ��� Tivoli Enterprise Console ��� �� � ���.

Pointer arithmetic � � ��� �� � ��� �� ��� � � �

����.

�� ��� � ��� � � ��� � �� ���.

�/

��� ��

-(� �� ��) � �� �� ��

-(� ��) � �� ��

+(� �� ���) � �� ��� ��

pointeroffset � �� ��� ����.

��

��� �� ��� � ��� ��� �� �����.

�� ��� � ��� �� � �� ���.

� ��

round ��� �� �� ��� �

�� ��

Prolog ����� �� ��(�� � �)� �� ���� ��� � �� �

����. �� ��� �� �� � �� � � �� �� �� ��� ���

� ���.

�� A. ���� Prolog �� 395

�� ��� � ��� �� � �� ���.

� ��

abolish �� ���� �� � �

assert �� ��� � ��

compile Prolog �� �� ���

consult ���� Prolog ��� �� ���� ��

flisting � ��� � ��

reconsult ���� Prolog ��� �� ���� �� ��

retract �� ���� �� � �

I/O

��� �� ����� ���� �� �� � �����. ��� �� ��

� � �� �� �� �� �� ���. � ��� �� I/O �� � ��

� ��� ��� ��� �����.

�� ��� � ��� �� � �� ���.

� ��

fclose � ��� ��

fopen ��� �

printf ��� ���� �� ��

read � Prolog �� ���� Prolog �� ��

readln � ���� � �� ��

write � ��� ��

�� �� � ���� ��� ��

�� �� � � ��� ���� � ���.

396 IBM Tivoli Enterprise Console: � �� ���

+

��� ��.

��

_number1 + _number2

��

���� �� �� ��� � � ���. �� ��� ���� ����, ��

� ��� �����.

��

_number1

�. �� �� ��� ���.

_number2

�. �� �� ��� ���.

�� ����� �� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, _real1 is 2.1, % Assign values. _sum1 is _integer1 + _integer2, % _sum1 is unified with 130. _sum2 is _real1 + _integer2 % _sum2 is unified with 3.210000000000000e+01.

��

��

�� A. ���� Prolog �� 397

-(��� �� ��)

� �� �� ��

��

_pointer - _integer

��

�� ��� �� ��, ��� ��� ���. ��� ����,

=? ��� �� ��� ���� ���.

��

_pointer

_integer

��

�� ����� ��� ���� Tivoli Enterprise Console �� �����.

1. pointer_offset �� ���� �� � ���� �� ��� �� ��

�� �� _offset1 ��� �����.

2. � ��� ���� 1�� �� ��� ���� �� _offset2 ���

�����.

3. � �� ���� ���� �� �� �� ��� _offset2 ��� ��

�� �� �� ���� ��� �����.

4. � �� ��� ���� �� ���� �� �����, �� � � ��

�� �� �� �� ��� �� � ���� �� ��� �����.

rule: pointer_offset: ( event: _event of_class _class where [ date_reception: _date_reception % _date_reception unified with 0x37695cd4. ], action: ( first_duplicate(_event, event: _dup_event where [ status: outside [’CLOSED’], date_reception: _dup_date_reception % _dup_date_reception unified with 0x376958d4. ] ), pointeroffset(_dup_date_reception, _offset1, _date_reception), % 1. _offset1 is unified with 1024 (0x37695cd4 % - 0x376958d4).

398 IBM Tivoli Enterprise Console: � �� ���

_offset2 is _date_reception - _dup_date_reception, % 2. _offset2 unified with 1024 (0x37695cd4 - % 0x376958d4). _originalDate =? _dup_date_reception + _offset2, %3. _originalDate unifies with 0x37695cd4 % (0x376958d4 + 1024). _originalDupDate =? _date_reception - _Offset1 % 4. _originalDupDate unifies with 0x376958d4 % (0x37695cd4 - 1024). ) ).

��

=?

�� A. ���� Prolog �� 399

-(��� ��)

� �� ��

��

_pointer1 - _pointer2

��

��� � �� ���. ��� �����, is ��� �� ��� �

��� ���.

��

_pointer1

_pointer2

�� ����� ��� ���� Tivoli Enterprise Console � ��� �����.

1. pointer_offset �� ���� �� � ���� �� ��� �� ��

�� �� _offset1 ��� �����.

2. � ��� ���� 1�� �� ��� ���� �� _offset2 ���

�����.

rule: pointer_offset: ( event: _event of_class _class where [ date_reception: _date_reception % _date_reception unified with 0x37695cd4. ], action: ( first_duplicate(_event, event: _dup_event where [ status: outside [’CLOSED’], date_reception: _dup_date_reception % _dup_date_reception unified with 0x376958d4. ] ), pointeroffset(_dup_date_reception, _offset1, _date_reception), % 1. _offset1 is unified with 1024 (0x37695cd4 % - 0x376958d4). _offset2 is _date_reception - _dup_date_reception, % 2. _offset2 unified with 1024 (0x37695cd4 % - 0x376958d4).

400 IBM Tivoli Enterprise Console: � �� ���

��

is

�� A. ���� Prolog �� 401

-(�� � )

� �� ��

��

-_number

��

_number� ��� ��� ���.

��

_number

��� ��� � �. �� �� ��� ���.

�� ����� ��� ��� ��� �����.

_real1 is 2.1, _integer1 is 100, % Assign values. _neg1 is -_integer1, % _neg1 is unified with -100. _neg2 is -_real1 % _neg2 is unified with -2.100000000000000e+00. _neg3 is -_neg1, % _neg3 is unified with 100. _neg4 is -_neg2 % _neg4 is unified with 2.100000000000000e+00.

��

��

402 IBM Tivoli Enterprise Console: � �� ���

-(��)

�� ��

��

_number1 - _number2

��

���� �� �� ��� � � ���. �� ��� ���� ����, ��

� ��� �����.

��

_number1

� �. �� �� ��� ���.

_number2

� �. �� �� ��� ���.

�� ����� ��� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, _integer3 is 10, _real1 is 2.1, % Assign values. _diff1 is _integer - _integer2, % _diff1 is unified with 70. _diff2 is _integer3 - _real1 % _diff2 is unified with 7.900000000000000e+00.

��

��

�� A. ���� Prolog �� 403

*

"�� ��

��

_number1 * _number2

��

���� �� �� ��� � � ���. �� ��� ���� ����, ��

� ��� �����.

��

_number1

�. �� �� ��� ���.

_number2

�. �� �� ��� ���.

�� ����� ��� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, _real1 is 2.1,% % Assign values. _product1 is _integer1 * _integer2, %_product1 is unified with 3000. _product2 is _integer1 * _real1 % _product 2 is unified with 2.100000000000000e+02.

��

��

404 IBM Tivoli Enterprise Console: � �� ���

/

�� ��� ��

��

_number1 / _number2

��

���� �� �� ��� � � ���. �� ��� ���� ����, ��

� ��� �����.

��

_number1

���. �� �� ��� ���.

_number2

��. �� �� ��� ���.

�� ����� ��� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, _real1 is 2.1, _real2 is 10.5, % Assign values. _quotient1 is _real2 / _real1, % _quotient1 is unified with 5.000000000000000e+00. _quotient2 is _integer1 / _integer2 % _quotient2 is unified with 3.

��

��

�� A. ���� Prolog �� 405

//

�� ��� ��.

��

_integer1 // _integer2

��

���� ��� ���.

��

_integer1

���. ��� ���.

_integer2

��. ��� ���.

�� ����� ��� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, _integer3 is 10, % Assign values. _quotient1 is _integer1 // _integer3, % _quotient1 is unified with 10. _quotient2 is _integer1 // _integer2 % _quotient2 is unified with 3.

��

��

406 IBM Tivoli Enterprise Console: � �� ���

@<

�� ���� �� � �� ��� ��� ������.

��

_term1 @< _term2

��

_term1� ���� _term2�� ���(�� ��) �����.

��

_term1

Prolog �

_term2

Prolog �

�� ����� ��� � ���� �����.

’a’ @< ’b’, % Succeeds. ’A’ @< ’a’, % Succeeds. 12 @< 23.2, % Succeeds. ’12’ @< 12 % Succeeds.

��

��

�� A. ���� Prolog �� 407

@=<

�� ���� �� �� � �� ��� ��� ������.

��

_term1 @=< _term2

��

_term1� ���� _term2�� �� ��� �����.

��

_term1

Prolog �

_term2

Prolog �

�� ����� ��� � ���� �����.

12.0 @=< 12, % Succeeds. ’ADMINISTRATOR’ @=< ’Administrator’ % Succeeds. pointertoint(_pointer1, 100), % _pointer1 unified with 0x64. pointertoint(_pointer2, 200), % _pointer2 unified with 0xc8. 100 @=< 200, % Succeeds. _pointer1 @=< _pointer2, % Succeeds. 100 @=< _pointer2, % Succeeds. _pointer1 @=< 200 % Fails.

��

��

408 IBM Tivoli Enterprise Console: � �� ���

@>

�� ���� �� � �� ��� ��� ������.

��

_term1 @> _term2

��

_term1� ���� _term2�� �� �����.

��

_term1

Prolog �

_term2

Prolog �

�� ����� ��� ��� ���� �����.

’Administrator’ @> ’ADMINISTRATOR’, % Succeeds. ’aab’ @> ’aaa’, % Succeeds. 23.1 @> 10.2 % Succeeds.

��

��

�� A. ���� Prolog �� 409

@>=

�� ���� �� �� � �� ��� ��� ������.

��

_term1 @>= _term2

��

_term1� ���� _term2�� �� ��� �����.

��

_term1

Prolog �.

_term2

Prolog �.

�� ����� ��� ��� ���� �����.

’atom2’ @>= ’atom1’, % Succeeds. ’Atom2’ @>= ’atom1’ % Fails.

��

��

410 IBM Tivoli Enterprise Console: � �� ���

\==

� �� �� ��

��

_term1 \== _term2

��

== ��� ��� ��

��

_term1

Prolog �

_term2

Prolog �

�� ����� _hostname� _dup_hostname� ��� _hostname� �� ���

����� �� �����.

_hostname = ’tec.tivoli.com’, _dup_hostname = ’tec.tivoli.com’, % Assign values. _hostname \== ’arrakis.tivoli.com’ % Succeeds. _hostname \== _dup_hostname % Fails.

��

=, ==

�� A. ���� Prolog �� 411

+(��� �� ���)

� �� ��� ��

��

_pointer + _integer

��

��� ���� ��� �� �� ��� �� ���. ��� ���

�, =? ��� �� ��� ���� ���.

��

_pointer

_integer

��

�� ����� ��� ���� Tivoli Enterprise Console � ��� �����.

1. pointer_offset �� ���� �� � ���� �� ��� �� ��

�� �� _offset1 ��� �����.

2. � ��� ���� 1�� �� ��� ���� �� _offset2 ���

�����.

3. � �� ���� ��� �� �� �� ��� _offset2 ��� ���

� �� �� ���� ��� �����.

rule: pointer_offset: ( event: _event of_class _class where [ date_reception: _date_reception % _date_reception unified with 0x37695cd4. ], action: ( first_duplicate(_event, event: _dup_event where [ status: outside [’CLOSED’], date_reception: _dup_date_reception % _dup_date_reception unified with 0x376958d4. ] ), pointeroffset(_dup_date_reception, _offset1, _date_reception), % 1. _offset1 is unified with 1024 (0x37695cd4 % - 0x376958d4). _offset2 is _date_reception - _dup_date_reception, % 2. _offset2 unified with 1024 (0x37695cd4 -

412 IBM Tivoli Enterprise Console: � �� ���

% 0x376958d4). _originalDate =? _dup_date_reception + _offset2, % 3. _originalDate unifies with 0x37695cd4 % (0x376958d4 + 1024).

��

=?

�� A. ���� Prolog �� 413

<

��� ��, �� ��

��

_arithExp1 < _arithExp2

��

_arithExp1� �� _arithExp2� ��� ��� �����.

��

_arithExp1

� � �. ����� ���.

_arithExp2

� � �. ����� ���.

�� ����� ��� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, _integer3 is 10, _real1 is 2.1, % Assign values. _integer3 < _integer2, % Succeeds. int(_real1) < _real1, % Succeeds. _integer1 < _integer3 % Fails.

��

��

414 IBM Tivoli Enterprise Console: � �� ���

=

� �� ��

��

_term1 = _term2

��

Prolog �� ��. _term1 � _term2� �� ��� � �� �����. = �

��, ��� ����� == ��� ��� ��� �� ������.

��

_term1

Prolog �

_term2

Prolog �

�� ��� � tec.tivoli.com� �� _hostname� �����.

_hostname = ’tec.tivoli.com’

��

==, =?, is

�� A. ���� Prolog �� 415

=:=

��� ��, ��

��

_arithExp1 =:= _arithExp2

��

_arithExp1� �� _arithExp2� �� ��� �����.

��

_arithExpr1

� � �. ����� ���.

_arithExpr2

� � �. ����� ���.

_integer1 is 100, % Assign value. _integer1 =:= _integer2 + 70, % Succeeds, _integer2 is unified with 30. _integer1 =:= real(_integer1), % Succeeds. _integer1 =:= - _integer1 % Fails.

��

��

416 IBM Tivoli Enterprise Console: � �� ���

=?

� � �

��

_result =? _function

��

_function �� ��� ��� _result� �����. _function� 393 ���� �

��� � � �� �� �� � �� �, � ��� ������.

��

_function

�� � �

_result

Prolog �

�� ����� substring �� ��� ��� �� _msg� ���� �� ��

���.

_msg =? substring(_msg, _start, _length)

��

is

�� A. ���� Prolog �� 417

=\=

��� ��, �� ��

��

_arithExp1 =\= _arithExp2

��

_arithExp1� �� _arithExp2� �� �� ��� �����.

��

_arithExpr1

� � �. ����� ���.

_arithExpr2

� � �. ����� ���.

�� ����� ��� ��� ��� �����. ��� �� �� �� ��

� ��� ������.

_integer1 is 100, % Assign value. _integer1 =\= _integer1 + 1, % Succeeds. -_integer1 =\= -100 % Fails.

��

��

418 IBM Tivoli Enterprise Console: � �� ���

=<

��� ��, �� �� �� ��

��

_arithExp1 =< _arithExp2

��

_arithExp1� �� _arithExp2� ��� �� ��� �����.

��

_arithExpr1

� � �. ����� ���.

_arithExpr2

� � �. ����� ���.

�� ����� ��� ��� ��� �����.

_integer1 is 100, _real1 is 2.1, % Assign values. _integer1 =< _integer1 + 1, % Succeeds. _real1 =< _integer1 % Succeeds.

��

��

�� A. ���� Prolog �� 419

==

� �� ��

��

_term1 == _term2

��

Prolog �� ��._term1� _term2� ��� �����. ��� ���� ���

�. == ���, ��� �� = ��� ��� ��� �� ������.

��

_term1

Prolog �

_term2

Prolog �

�� ����� _hostname� _dup_hostname� �� ��� _hostname� ���

����� �� �����.

_hostname = ’tec.tivoli.com’, _dup_hostname = ’tec.tivoli.com’, % Assign values. _hostname == _dup_hostname, % Succeeds. _hostname == ’arrakis.tivoli.com % Fails.

��

=, \==

420 IBM Tivoli Enterprise Console: � �� ���

>

��� ��, �� �

��

_arithExp1 > _arithExp2

��

_arithExp1� �� _arithExp2� ��� �� �����.

��

_arithExpr1

� � �. ����� ���.

_arithExpr2

� � �. ����� ���.

�� ����� ��� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, % Assign values. _integer1 > _integer2, % Succeeds. _integer2 * 2 > _integer1, % Succeeds. _integer1 // 10 > _integer2 % Fails.

��

��

�� A. ���� Prolog �� 421

>=

��� ��, �� �� �� ��

��

_arithExp1 >= _arithExp2

��

_arithExp1� �� _arithExp2� ��� �� ��� �����.

��

_arithExpr1

� � �. ����� ���.

_arithExpr2

� � �. ����� ���.

�� ��� ��� ��� ��� �����.

_integer1 is 100, ]_integer2 is 30, _integer3 is 10, % Assign values. _integer1 >= _integer3 + 90, % Succeeds. _integer2 >= _integer1 - _integer1, % Succeeds. _integer3 >= _integer2 % Fails.

��

��

422 IBM Tivoli Enterprise Console: � �� ���

abolish

�� ���� �� �� ����.

��

abolish(_name, _arity)

��

�� ���� � ��� _arity _name �� �� �� ����.

��

_arity _name �� �� � ��. ��� ���.

_name Prolog �� �� �� ��(�) �. �� ���.

�� ����� � ��� �����.

assert( unix_hosts(arrakis, support) ), % Assert the fact into the knowledge base. unix_hosts(arrakis, support), % Succeeds. abolish(unix_hosts, 2), % Removes all facts named unix_hosts % with an arity of 2 from the knowledge base. unix_hosts(arrakis, support) % Fails, because this fact no longer exists % in the knowledge base.

��

assert, retract

�� A. ���� Prolog �� 423

append

��� ��� �����.

��

append(_list1, _list2, _list3)

��

�� _list2� �� _list1� ��, �� _list3�� ��� ��� �������. _list3

� � �������� _list1 �� _list2 ��� � ��� � � ���.

�� ��� � �� �� ����� ��� �� _list3� ��� ������

�. � �� � � ���� ����, �� _list3� � _list1 � _list2

� ��� � �����.

��

_list1 ��, ���� �� � �

_list2 ��, ���� �� � �

_list3 ��, ���� �� � �

�� ����� �� ��� ��� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], _ntHosts = [’charon’, ’scary’, ’mach5’, ’callisto’], % Assign values. append(_unixHosts, _ntTHosts, _allHosts), % _allHosts is unified with the list % [arrakis,rooster,dune,perro,charon,scary,mach5,callisto]. append(_unixHosts, _moreHosts, _allHosts) % _moreHosts is unified with [charon,scary,mach5,callisto].

��

��

424 IBM Tivoli Enterprise Console: � �� ���

ascii

ASCII �� ASCII �� �� �����.

��

ascii(_char, _asciicode)

��

_char� �� ASCII �� ������, ASCII ��� _asciicode� ���

��. _asciicode� �� ASCII ��� ������, ASCII �� _char�

�����. _char� _asciicode� � ������, �� ASCII �� ���

� �� �����. ��� �� ��� �� ���� ������ �

��.

��

_asciicode

0 - 255 ��� � ��, ���� �� � �

_char � � �, ���� �� � �

�� ����� ��� ASCII � � �� ��� �����.

ascii(a, _code1), % Succeeds and _code1 is unified with 97. ascii(’\n’, _code2), % Succeeds and _code2 is unified with 10. ascii(_char1, 65), % Succeeds and _char1 is unified with ’A’. ascii(_char2, 13) % Succeeds and _char2 is unified with ’\r’.

��

��

�� A. ���� Prolog �� 425

assert

��� � �� �� ��� �����.

��

assert(_clause)

��

_clause �� �� ��� �������.

�� �� � � � ��, �� ��� ����� ���� �� ���, �� �

�� � ��� � �� ���� �� �����. ��� ���, Prolog �� �

�� ����� � ���� ��� �� � �����. �� ��� 490 �

��� �Tivoli Enterprise Console � ���� ��� � � �� ���� ��

����.

��

_clause

Prolog �� �� �

1. �� ����� �� ��� ��� �����.

assert( unix_hosts(arrakis, support) ), assert( unix_hosts(io, manufacturing) ), assert( unix_hosts(tycho, development) ), assert( unix_hosts(acme, training) ), % Assert the facts named unix_hosts into % the knowledge base. % Now look up the following facts. unix_hosts(arrakis, support), % Succeeds. unix_hosts(tycho, _tycho_area), % Succeeds and unifies _tycho_area with ’development’. unix_hosts(cerberus, _cerberus_area) % Fails because a fact named unix_hosts for % ’cerberus’ does not exist in the knowledge base.

2. �� Prolog �� ��� ��� �� � ���� #�� Tivoli Enterprise

Console � ����� �� � ���. IBM� TEC_Start ���� ���

� �� �� �� �����. �� ����� �� ��� �����.

a. ��� �� �� �� my_string_match �� ���� Tivoli Enterprise

Console �

b. ��� �� ��� Prolog ����(interpreter) �� � �. �� �

�� 491 ���� �Prolog ���� ���� ������.

426 IBM Tivoli Enterprise Console: � �� ���

c. ��� �� ��� ���� Tivoli Enterprise Console � ��

rule: boot_string_match: (event: _start of_class within [’TEC_Start’] where [ ], reception_action: action0:( assert((my_string_match(_string, _substring, _left, _right) :- % my_string_match takes _string and _substring % as input and binds _left and _right such that % _left + _substring + _right = _string atomlength(_substring, _sublen), atompart(_string, _substring, _startsub,_len), _lenl is _startsub - 1, atompart(_string, _left, 1, _lenl), _startr is _lenl + _sublen + 1, atompart(_string, _right, _startr, _lenr), !, true)) ) ).

�� ����� my_string_match ��� Prolog ����(interpreter)�� �

�� � ��� ��� �����. �� ��� my_string_match �� ��

� � ��� � �� � �����(� ��� �) ���� �� �

����. � �� �� �� �� � � � �� ����.

?- my_string_match(’foobarmoo’,bar,L,R). L = foo R = moo Yes

?- my_string_match(’Interface xyz is Up’, ’ ’, L,R), my_string_match(R, ’ ’, _interface, R1). L = Interface R = xyz is Up _interface = xyz R1 = is Up Yes

Interface name is Up� �� �� � � � ���� � ���� �

�� ��� ��, �� ��� Tivoli Enterprise Console ��� ��� �

� �� � �� �� ���� �� ���� �� � �� ��� ��

����.

rule: plain_rule1: (event: _ev of_class within [’Some_Class’] where [ msg: _msg ] , reception_action: action0:( my_string_match(_msg, ’ ’, L,R), my_string_match(R, ’ ’, _interface, R1), % Isolate interface name. ) ).

�� A. ���� Prolog �� 427

��

compile

428 IBM Tivoli Enterprise Console: � �� ���

atom

��� � ��� ��� ������.

��

atom(_term)

��

_term� ��� �����.

��

_term ��, ���� �� � �

�� ����� atom ��� ��� ���� �����.

_atom = ’An atom’, % Assign value. atom(_atom), % Succeeds. _atom = 10 % Assign value. atom(_atom) % Fails because the variable is an integer.

��

��

�� A. ���� Prolog �� 429

atomic

��� �� ��� ��� ������.

��

atomic(_term)

��

_term� ��, ��, � �� ��� �����.

��

_term ��, ���� �� � �

�� ����� atomic ��� ��� ���� �����.

_integer = 200, _real = 2.345, _atom = ’An atom’, _list = [element1, element2, element3], % Assign values. atomic(_integer), % Succeeds. atomic(_real), % Succeeds. atomic(_atom), % Succeeds. atomic(_list) % Fails.

��

��

430 IBM Tivoli Enterprise Console: � �� ���

atomlength

�� ��� �����.

��

atomlength(_atom, _length)

��

_atom� ����� �� ��� _length� �����. _atom� _length� ��

������, � �� �� _atom� _length ���� �����.

��

_atom ��� � �. �� ���.

_length

_atom� �� ��. ��� ���.

�� ����� �� ��� ��� �����.

atomlength(’This is an atom’, _length), % _length is unified with 15. atomlength(’atom’, 4) % Succeeds.

��

��

�� A. ���� Prolog �� 431

atompart

���� ��� � ����.

��

atompart(_atom, _atomPart, _startPos, _length)

��

_atomPart �� _atom���� �� ��� �, _length ��� _atom�� �

� _startPos�� ������. �� �� �� �� 1� ���.

_atomPart� � ���, _startPos � _length� �� ��� _atom� ��� �

������. _startPos � _length �� ���� ����, � � 1� �� �

�� _atom� �� �����.

_atomPart� ������� _startPos� � ����, _startPos� _atom� �

_atomPart� �� �� �� ��� �������.

��

_atom �� � . �� ���.

_atomPart

_atom� � ��� . �� ���.

_length

��� _atomPart� ��. ��� ���.

_startPos

_atom� � ��� _atomPart� �� ��. ��� ���.

�� ����� ��� ���� �� �����.

1. �� ��� ��� �� ���� �� �� �� �(��� ��)� �

�� ���� � ���� �

2. �� 1�� ���� _msg ����� ��� (�, _msg� �� �)� �

�� ��� �� �

atompart(_msg, ’ ’, _startOfSpace, _lenOfSpace), % If an event were received where the msg % attribute contained the string ’pikes-peak is down’, % then _startOfSpace is unified with 11, % and _lenOfSpace is unified with 1. _lenOfHost is _startOfSpace - 1, % _lenOfHost is unified with 10. atompart(_msg, _host, 1, _lenOfHost) % _host is unified with ’pikes-peak’.

432 IBM Tivoli Enterprise Console: � �� ���

��

substring

�� A. ���� Prolog �� 433

atomconcat

�� ������.

��

atomconcat(_listOfAtomics, _concatAtom)

--��--

atomconcat(_atom1, _atom2, _concatAtom)

��

�� _concatAtom� ��� ���� _listOfAtomics ������ �� ��� �

��� �� _atom1 � _atom2� ����� �� ���� ��� ����.

_listOfAtomics, _atom1 � _atom2� �� �, ��, �� �� �� � �

��.

� �� �� � �� �� ����� � �� � � � � ���.

� �� ��� �����.

�� �� �� �� �� �� �� �����.

��

_atom1

_atom2� ���� �, ��, �� �� �

_atom2

_atom1�� ��� �, ��, �� �� �

_concatAtom

� ��� ��. � �� ����.

_listOfAtomics

��� ���� �� �, ��, �� �� �� ��

1. �� ����� �� � atomconcat ��� �����.

_hostname = ’shinai’, _repeat_count is 5, % Assign values. atomconcat([’Host ’, _hostname, ’ unavailable ’, _repeat_count, ’ times.’], _new_msg) % The variable _new_msg is unified with the % atom ’Host shinai unavailable 5 times.’

2. �� ����� � �� �� � atomconcat� ��� ��� �����.

434 IBM Tivoli Enterprise Console: � �� ���

_hostname = ’shinai’, % Assign value. atomconcat(_hostname, ’ is down.’, _down_msg), % _down_msg is unified with ’shinai is down.’. _msg = ’shinai is back up.’, % Assign value. atomconcat(_up_hostname, ’ is back up.’, _msg) % _up_hostname is unified with ’shinai’.

��

��

�� A. ���� Prolog �� 435

atomtolist

�� ��� �� �� �� �����.

��

atomtolist(_atomic, _listOfChar)

��

_atomic� ��������, �� ��� _listOfChar� �����.

_listOfChar� ��������, �� _atomic�� �����.

��� �� ��� �� ������ �� ���.

��� �� ����, ��� ��� ��� �� �����. �� ��� ���

� � ���.

v �: ��� 0x� ���� ��

v ��: _listOfChar� �� ��� 0 - 9 ��� � ��

v ��: ��� �� ���� �� ��

v �: �� �� ����

��

_atomic

� �, ���� �� � �

_listOfChar

�� ��, ���� �� � �

�� ����� �� ��� ��� ��� �����.

atomtolist(_hexNumber, [’0’, ’x’, ’1’, ’3’, ’2’]), % Unifies _hexNumber with 0x132. atomtolist(_integer, [’2’, ’3’, ’4’, ’5’]), % Instantiates _integer to 2345. atomtolist(_realNumber, [’1’, ’0’, ’.’, ’3’, ’2’]), % Instantiates _realNumber to 1.032000000000000e+01. atomtolist(prolog, _list), % Instantiates _list to [p,r,o,l,o,g]. atomtolist(_atom, _list) % Instantiates _atom to ’prolog’.

��

��

436 IBM Tivoli Enterprise Console: � �� ���

compile

Prolog �� ��� ������.

��

compile(_fileName)

��

_fileName� � ��� ��� Prolog �� ��� �� consult �� reconsult

�� � �� ���� ��� Prolog �� ��(filename.pro)� �� ���

�� ���� � filename.wic�� ��� Prolog ���� ��� ������.

Prolog �� ��� ��� Prolog � � ���� ���. � � � ��� assert

�� ���� �� ����. ��� � � ��� � �� ���� ��

�.

compile �� ���� �� Tivoli Enterprise Console ��� ��� ���� �

���� �� ���� BIM_PROLOG_DIR �� ��� �� $BINDIR/TME/TEC

��� ��� ���. �� �� �� ���� �� �� �����.

1. ����� �� odadmin environ get ��� �� ��� �������.

�� ����� �� ���� �� �����.

odadmin environ get > /tmp/oserv.env

2. ��� ���� ���� BIM_PROLOG_DIR �� ��� ���� ��

$BINDIR/TME/TEC�� ������. ���, $BINDIR� $BINDIR �� ��

� �� ����.

3. ����� ���� ���� ��� �� ���� ��� �� ��(� ��

�� /tmp/oserv.env)� � ��� �������. �� ����� �� ��

�� �� �����.

odadmin environ set < /tmp/oserv.env

odadmin ��� �� �� ��� Tivoli Management Framework ���� ���

���.

�����, Prolog �� ��� � ������� �� Prolog ����

(interpreter)� ���� � ���. �� ��� ��� �� ���� �� ��

compile �� assert �� ���� ��� � �� �� �� � �� ���

�����. �� ��� 490 ���� �Tivoli Enterprise Console � ���� ��

� � � �� ���� ������.

��

_fileName

Prolog �� ��� �� ��. ��� �� � ���. �� ���.

�� A. ���� Prolog �� 437

�� ��� /var/prolog ���� � unix_hosts.pro�� ��� Prolog �� �

�� �����. ��� �� �� ��� �� ���� � unix_hosts.wic

�� ��� ���� ��� ������. ��� consult �� ���� � Prolog

���� ��� � ��� �� � ���.

unix_hosts(arrakis, support). unix_hosts(odin, support). % Contents of /var/prolog/unix_hosts.pro compile(’/var/prolog/unix_hosts’) % Creates /var/prolog/unix_hosts.wic.

��

consult, reconsult

438 IBM Tivoli Enterprise Console: � �� ���

consult

���� Prolog ��� �� ���� �����.

��

consult(_fileName)

��

Prolog �� ���� �� _fileName� �� ��� ���� �������. ��

�� compile �, TECpcomp �� �� Prolog ����(interpreter)� �

��� ����� ���. ���� Prolog ��� Prolog ���� ������ �

��.

�: Prolog ���� ��� � �� ���� ���� ����. ��� ���,

��� �� � �� � �� �� ��� ���� ���. ��� � �

� ���� ���� ��, reconsult �� ������.

��

_fileName

Prolog ���� ��� �� ��. wic �� �� ��� ���� ���

�. �� ���.

�� ����� � � ��� �����.

unix_hosts(arrakis, support). unix_hosts(odin, support). % Contents of /var/prolog/tec_r.unix_hosts.pro compile(’/var/prolog/tec_r.unix_hosts’) % Creates /var/prolog/unix_hosts.wic. consult(’/var/prolog/unix_hosts’), % Load and assert the clauses in the compiled % unix_hosts.wic file. unix_hosts(arrakis, support), % Query of the knowledge base succeeds, this clause exists. unix_hosts(cerberus, development) % Query of the knowledge base fails, this clause % does not exist.

��

assert, compile, reconsult

�� A. ���� Prolog �� 439

delete

��� ���� �����.

��

delete(_list, _element, _residue)

��

�� _residue� _element� �� �� ��� ���� �� _list� ������

�.

_list � _residue� ���� ������, _element� _residue� � �� _list

� ��� �����.

��

_element

� �, ���� �� � �

_list ��. ����� ���.

_residue

��, ���� �� � �

�� ����� �� ��� ��� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], _ntHosts = [’charon’, ’scary’, ’mach5’, ’callisto’], % Assign values. append(_unixHosts, _ntHosts, _allHosts), % _allHosts is unified with the list % [arrakis, rooster, dune, perro, charon, % scary, mach5, callisto]. delete(_allHosts, ’arrakis’, _residue), % _residue is unified with the list % [rooster, dune, perro, charon, scary, mach5, callisto]. delete(_allHosts, _host, _residue) % _host is unified with ’arrakis’.

��

��

440 IBM Tivoli Enterprise Console: � �� ���

disjoint

�� �� �� �� ���� ��� ���.

��

disjoint(_list1, _list2)

��

_list1 � _list2� � ��� �� ��� �����.

��

_list1 ��

_list2 ��

�� ����� � ��� �� �� ��� ��� � �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], _ntHosts = [’charon’, ’scary’, ’mach5’, ’callisto’], % Assign values. disjoint(_unixHosts, _ntHosts) % Succeeds.

��

intersect

�� A. ���� Prolog �� 441

empty_list

��� � �� ������.

��

empty_list(_list)

��

_list� � ���� �����.

��� � � ��� ������, ���� ����� not �� ���� �

��.

��

_list ��, ���� �� � �

1. �� ����� �� _emptyList� � ���� ������, ���� ���

� �� �����. ���, �� _list� ���� �� �� ��� � �� �

��� �����.

_list = [element1, element2, element3], _emptyList = [], % Assign values. empty_list(_emptyList), % Succeeds. empty_list(_list) % Fails

2. �� ����� � ���� ��� ���� � not �� ��� � �� �

����. �� ���� _list ��� ����, ��� ��� ��� �� �

�� ���� ��� ��� �� not �� ������.

not empty_list(_list) % Succeeds. List contains no elements, % but the result is reversed.

��

not

442 IBM Tivoli Enterprise Console: � �� ���

fclose

� ��� ����.

��

fclose(_file)

��

_file� ��� ��� ����.

��

_file fopen �� ��� �� ����� �� �� �

�� ��� Tivoli Enterprise Console � ����� ��� �� �� � Prolog

�� ��� �� �� �����. ��� ���� ��� �� �� fclose �

� open_file ��� close_file �� �� �� � �� ��� ���� ���� �

� ��� ����.

action: open_file: ( fopen(_fp, ’/var/prolog/nt_hosts’, ’r’), action: close_file: ( fclose(_fp) )

��

fopen

�� A. ���� Prolog �� 443

flisting

� ��� �� �����.

��

flisting(_file, _predName)

��

�� ���� _predName �� �� �� �� � ���� �����. �

� ���� ��� ���, � ��� �� compile �� ���� � �

��.

��

_file fopen ���� �� �� �� ���� ��

_predName

�� �� ��

�� ��� Tivoli Enterprise Console � ����� unix_hosts �� �� ��

/tmp/maint_mode.pro ��� ���� �� �����.

action: write_predicates: ( fopen(_fp, ’maint_mode.pro’,w), flisting(_fp, ’unix_hosts’) fclose(_fp) ),

��

fclose, fopen

444 IBM Tivoli Enterprise Console: � �� ���

fopen

��� $��.

��

fopen( _file, _physFileName, _mode)

��

��� _mode �� �� ��, �� �� ��� �� _physFileName� ���

�� �� ��� $��. _physFileName� � ��� �� �� � _file� �

����. � �� ��� �� �� �� I/O ��� �����. ��� � �

���, fopen �� �����.

��

_file �� �. � ��� ���.

_mode ��� �� ��. ��� ��� �� ���� �� ���.

a ��� �� ��� $��.

r ��� �� ��� $��.

w ��� �� ��� $��.

_physFileName

�� ��� ��. �� ���.

�� ��� Tivoli Enterprise Console � ����� Prolog �� ��� �� ��

�� �� �����.

action: open_and_read: ( fopen(_fp, ’/var/prolog/nt_hosts’, ’r’), ),

��

fclose

�� A. ���� Prolog �� 445

ground

��� �������� ��� ������.

��

ground(_term)

��

_term� �������� �����. ��� ������ ���� �����

�, � ���� ����� not �� ���� ���.

��

_term ��, ���� �� � �

1. �� ���� �� _someVariable� ������ � some_String�� �

����. ground �� ��� ������ �� ��� ������.

variable _someOtherVariable� ������ �����, ���� �����.

_someVariable = ’some_String’, % Succeeds. ground(_someVariable), % Succeeds. Variable is instantiated to some_String. ground(_someOtherVariable) % Fails. Variable is not instantiated.

2. ��� ���� � not �� � ���� ��� � ���. �� ����

�� _someOtherVariable� ���� ��� ������ ��� � ����

���, ��� �� not �� ������.

not ground(_someOtherVariable) % Succeeds. Variable is not instantiated, but the % result is reversed.

��

not

446 IBM Tivoli Enterprise Console: � �� ���

int_to_hex

��� 16� � ��

��

int_to_hex(_integer)

--��--

int_to_hex(_integer, _width)

��

_integer � ����� �� �� 16� �� � ��� �����. _width �

� ��� �� �� �����. _atom� �� ���� 0�� �����.

��

_integer

��, ���� �� � �

_width ��. _atom� �� �� �� �����.

�� ����� ���� 16���� ��� ��� �����.

% Converts an integer to hexadecimal. _hexstring1 =? int_to_hex(100) % _hexstring1 is unified with ’64’. % Converts an integer to hexadecimal with a % specific field width. _hexstring2 =? int_to_hex(100, 8) % _hexstring2 is unified with ’00000064’.

��

��

�� A. ���� Prolog �� 447

integer

��� �� ��� ��� ������.

��

integer(_term)

��

_term� ���� �����.

��

_term ��, ���� �� � �

�� ����� integer ��� ��� ���� �����.

_integer = 200, % Assign value. integer(_integer), % Succeeds. _integer = 1.234, integer(_integer) % Fails because the variable is a real number.

��

��

448 IBM Tivoli Enterprise Console: � �� ���

intersect

� �� �� ���� ��� ���.

��

intersect(_list1, _list2)

--��--

intersect(_list1, _list2, _intersection)

��

�� _list1 � _list2� � ��� ��� �� ��� �����.

�� ����, _intersection� �� _list1 � _list2� ���� ����� �

����.

��

_intersection

_list1 � _list2� � ��� ��. ��

_list1 ��

_list2 ��

1. �� ����� �� �� ��( �� �)� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. intersect(_unixHosts, [’perro’, ’dune’]) % Succeeds.

2. �� ����� �� �� ��(� �� �)� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. intersect(_unixHosts, [’perro’, ’dune’, ’odin’], _intersection) % _intersection is unified with [’dune’,’perro’].

��

��

�� A. ���� Prolog �� 449

inttoatom

��� ��� � �� �� �����.

��

inttoatom(_integer, _atom)

��

_integer� ��� ������, ��� � ��� _atom�� �����.

_atom� ��� ���� �� ��������, �� �� ���� ����

_integer� �����.

��� �� ��� �� ���� ����� ���.

��

_atom �, ���� �� � �

_integer

��, ���� �� � �

�� ����� ��� �� � � ��� �����.

inttoatom(100, _atom1), % Succeeds and _atom1 is unified with ’100’. inttoatom(_int1, ’123’) % Succeeds and _int1 is unified with 123.

��

��

450 IBM Tivoli Enterprise Console: � �� ���

is

��� ��

��

_result is _arithExpr

��

� � � _arithExpr� ��� � ��(�� �� ��)� _result� ����

�. _arithExpr� ��, �� �� � �� � �� �� �� � � � ��

� ���.

��

_arithExpr

� � �

_result

�� �� �� ��

�� ����� ��� ��� ��� �����.

_integer is 10 % _integer is unified with 10. _result is _integer + 90 % _result is unified with 100.

��

=?

�� A. ���� Prolog �� 451

is_list

��� ��� ��� ������.

��

is_list(_list)

��

_list� �� ���� �����. _list� ��� �� � ��� � ���.

��

_list Prolog ��. ��� �� � �

�� ����� list ��� ��� ���� �����.

_list = [element1, element2, element3], _emptylist = [], % Assign values. is_list(_list), % Succeeds is_list(_emptylist) % Succeeds

��

��

452 IBM Tivoli Enterprise Console: � �� ���

length

��� ��� ����.

��

length(_list, _length)

��

_list� ��� �� _length� �������.

��

_length

�� _list� ��. ��

_list ��� �� � ��. ����� ���.

�� ����� �� _unixHosts� ��� �� �� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. length(_unixHosts, _listLength) % Unifies _listLength with 4.

��

��

�� A. ���� Prolog �� 453

lowertoupper

��� ��� �� �� �����.

��

lowertoupper(_lowercase, _uppercase)

��

_lowercase� � ��� _uppercase� �� ��� �������.

_uppercase� � ��� _lowercase� �� ��� �������.

��� �� ������ �� �� �� � ��� ���.

��

_lowercase

�� �. �� ���. ���� �� � �

_uppercase

�� �. �� ���. ���� �� � �

�� ����� �� ��� ��� �����.

_user = ’Administrator’, %Assign value. lowertoupper(_user, _uppercase), % _uppercase is unified with ’ADMINISTRATOR’. lowertoupper(_lowercase, _uppercase) % _lowercase is unified with ’administrator’.

��

��

454 IBM Tivoli Enterprise Console: � �� ���

member

�� �� ��� � ���.

��

member(_element, _list)

��

� ��� �. �� _element� �� _list� �� �����.

��� ��� ���� � ���, � � ���� � not �� ��� � ��

�.

_element� �� � ��, ��� �� �� ��� ���� �� �����.

��

_element

���� � ��. �� �

_list ��� ���� � � ��

1. �� ��� � arrakis� �� _unixHosts� �� � ���.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. member(’arrakis’, _unixHosts) % Succeeds. member(’odin’, _unixHosts) % Fails.

2. �� ��� not �� ���� ���� ����, �� ��� ��� ���

� � ���. �� ��� � odin� �� _unixHosts� ��� � ���.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. not member(’odin’, _unixHosts) % Succeeds. List does not contain the % element, but the result is reversed.

��

not

�� A. ���� Prolog �� 455

name

�� ��� � ��� �� �� �����.

��

name(_atomic, _listOfAsciiCodes)

��

If _atomic� ��������, ASCII codes ��� _listOfAsciiCodes� ��

���.

listOfAsciiCodes� ��������, �� _atomic�� �����. ��� �

� ��� �� ������ �� ���. ��� � ��� ��� �, ��

� ��� �� �� ��� �����. �� ��� ��� � � ���.

v �: ��� 0x� �� ASCII� ���� ��

v ��: _listOfAsciiCodes� �� ��� 0 - 9 ��� �� �� ASCII ��

��

v ��: ��� �� ���� �� ASCII ��� �� ��

v �: �� �� ����

��

_atomic

� �, ���� �� � �

_listOfAsciiCodes

�� �� ��

�� ����� �� ��� ��� ��� �����.

name(0x132, _hexList), % Instantiates _hexList to [48,120,49,51,50]. name(_hexNumber, _hexList), % Instantiates _hexNumber to 0x132. name(2345, _integerList), % Instantiates _integerList to [50,51,52,53]. name(_integer, _integerList), % Instantiates _integer to 2345. name(10.32, _realList), % Instantiates _realList to % [49,46,48,51,50,48,48,48,101,43,48,49]. name(_realNumber, _realList), % Instantiates _realNumber to % 1.032000000000000e+01.

456 IBM Tivoli Enterprise Console: � �� ���

name(prolog, _list), % Instantiates _list to % [112,114,111,108,111,103]. name(_atom, _list) % Instantiates _atom to ’prolog’.

��

��

�� A. ���� Prolog �� 457

nmember

��� � �� �� ��� � ���.

��

nmember(_element, _list, _index)

��

_element� �� _list� _index� �� ��� �� � � �����. ��� �

� 1� �����.

_element � _list� ��������, _element� �� _index� �����.

_list � _index� ��������, _element� _index�� _list� ��� ��

���.

��

_element

� �, ���� �� � �

_index ��, ���� �� � �

_list ��, ����� ���.

�� ����� �� ��� ��� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. nmember(’rooster’, _unixHosts, _index), % _index is unified with 2. nmember(_element, _unixHosts, 3) % _element is unified with ’dune’.

��

nmembers

458 IBM Tivoli Enterprise Console: � �� ���

nmembers

��� � �� �� ��� � ���.

��

nmembers(_indexes, _list, _listOfElements)

��

� �� � � � �� � �� ���� � ��� ���� ��� ���

�, nmember� �����. _indexes� _listOfElements� � � ����� � �

��. �, ��� ������ ���.

��

_indexes

��, ���� �� � �

_list ��, ����� ���.

_listOfElements

��, ���� �� � �

�� ����� ��� ��� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’,’perro’], % Assign value. nmembers(_indexes, _unixHosts, [’arrakis’, ’dune’]), % _indexes is unified with the list [1,3]. nmembers([2, 4], _unixHosts, _listOfElements) % _listOfElements is unified with the list % [rooster, perro].

��

nmember

�� A. ���� Prolog �� 459

not

� �� �

��

not _term

��

� �� _term� ���� ����, ��� �� _term� ���� �����.

��

_term Prolog �

�� ����� �� ���� ���� ��� ��� ���� integer �� �

����. ��� ���� ���� not �� �� ��� �� ���� ��� �

���.

integer(100), % Succeeds. integer(1.234) % Fails because this is a real number, not an integer. not integer(1.234), % Succeeds, because integer(1.234) would fail.

��

��

460 IBM Tivoli Enterprise Console: � �� ���

number

��� � ��� ��� ������.

��

number(_term)

��

_term� �� �� ���� �����.

��

_term ��, ���� �� � �

�� ����� number ��� ��� ���� �����.

_integer = 200, _real = 2.345, % Assign values. number(_integer), % Succeeds. number(_real) % Succeeds.

��

��

�� A. ���� Prolog �� 461

pointer

��� � ��� ��� ������.

��

pointer(_term)

��

_term� ��� �����.

��

_term ��, ���� �� � �

�� ��� Tivoli Enterprise Console ���� ���� ��� � date_reception

��� ��� �� �� �� ��� ���� �����.

rule: pointer:( event: _event of_class _class where [ date_reception: _date_reception ], reception_action: ( pointer(_date_reception) % Succeeds ) ).

��

��

462 IBM Tivoli Enterprise Console: � �� ���

pointeroffset

� � ��� ��� ����.

��

pointeroffset(_pointer1, _offset, _pointer2)

��

�� _offset�� ��� � _pointer1� � _pointer2���. ��� ���

�� � �� � ���. ��� � �� �� � � ���. _offset� ���

���. �� �� ��� �� � ����, ��� ��� ��� �� � �

�� ����.

��

_offset _pointer1� _pointer2 �� ��. ��� ���.

_pointer1

_pointer2

�� ��� Tivoli Enterprise Console � ����� ��� ���� �� �

���� ��� �� ��� ��( �)� ���� �� �� _offset1 ��� �

��� �� �����.

rule: pointer_offset: ( event: _event of_class _class where [ date_reception: _date_reception % _date_reception unified with 0x37695cd4. ], action: ( first_duplicate(_event, event: _dup_event where [ status: outside [’CLOSED’], date_reception: _dup_date_reception % _dup_date_reception unified with 0x376958d4. ] ), pointeroffset(_dup_date_reception, _offset1, _date_reception), % _offset1 is unified with 1024 (0x37695cd4 - % 0x376958d4).

��

��

�� A. ���� Prolog �� 463

pointertoatom

�� �� � �� �� �����.

��

pointertoatom(_pointer, _atom)

��

_pointer� � ��� ��������, � ��� _atom�� �����.

_atom� � �� � ��� ������, �� ���� _pointer�

�����. ��� �� ��� �� ���� ������ ���.

��

_atom �, ���� �� � �

_pointer

�, ���� �� � �

�� ��� Tivoli Enterprise Console ���� ��� �� � ��� ��

���.

rule: pointertoatom: ( event: _event of_class _class where [ date_reception: _date_reception ], reception_action: ( pointertoatom(_date_reception, _atom), % _Atom is unified with ’0x3745d5ed’. pointertoatom(_pointer, ’0x1234’) % _Pointer is unified with the % hexadecimal number 0x1234. ) ).

��

��

464 IBM Tivoli Enterprise Console: � �� ���

pointertoint

�� �� �� �� �� �����.

��

pointertoint(_pointer, _integer)

��

_pointer� � ��� ��������, �� ��� _integer� �����.

_integer� ��� ������, � ���� ���� _pointer� �����.

_pointer� �� �� ��� ���, �� ����.

��� �� ��� �� ���� ���� �� ���.

��

_integer

��, ���� �� � �

_pointer

�, ���� �� � �

�� ��� Tivoli Enterprise Console ���� ��� �� �� ��� ��

���.

rule: pointertoint: ( event: _event of_class _class where [ date_reception: _date_reception ], reception_action: ( pointertoint(_date_reception, _int_reception), % If the date_reception slot were to % contain the value 0x3745d5ed, % this line would unify the variable % _int_reception with -146418195. The % actual integer value of 0x3745d5ed % is 927323629 in decimal. However, % this is larger than the maximum % value of 268435455 (228-1) that an % integer type can hold. So this % number is the result of overflow. pointertoint(_pointer, 2000) % (_pointer is unified with 0x7d0. ) ).

��

��

�� A. ���� Prolog �� 465

printf

��� ���� ��� �����.

��

printf(_file , _format, _value)

��

_file �� �� ��� ��� _format� ��� ���� �����. �� ���

C ����� ��� fprintf() �� �����.

��

_file fopen �� ��� �� ����� �� �� �

_format

�� �� �� ��. �� ��� � �� ���� ����� ��

���.

%c �

%d 10� ����� �� ��

%e �� ����� �� ��

%f 10� ����� �� ��

%g � ���� �� ��(10� �� �� ���).

%o � �� 0�� ���� 8� ����� �� ��

%s �

%u ��� �� 10� ����� �� ��

%x � �� 0x� ���� 16� ����� �� ��

��� �� % �� �� � �� � ��� �� ��� �� �

���.

- �� ��

0 ��� 0�� ���

n �� �� � � ��, n� ��� �� �����.

n.m ��� ��, n� ��� �� ���� m� ��� �� ��� �

����.

_value ��� ��� � � �� � �� ��

466 IBM Tivoli Enterprise Console: � �� ���

�� ��� Tivoli Enterprise Console � ����� ���� ��

/tmp/eventdata.txt ��� ���� �� �����.

action: write_data: ( fopen(_fp, ’/tmp/eventdata.txt’, a), printf(_fp, ’Event of class %s was closed by %s’, [_class, _administrator]) ), action: close_file: ( fclose(_fp) )

��

��

�� A. ���� Prolog �� 467

read

� Prolog �� ���� Prolog �� ����.

��

read(_file, _term)

��

� _term� _file ����� ��� �� ��� �����. �� ����

��� ���(end-of-line �� �� �� � �) �� ��� ��� ��� ��

����� �����. � �� Prolog �� �� �� ����. ��� ���

��� ��� ���� 469 ���� �readln�� ������.

��

_file fopen �� ��� �� ����� �� �� �

_term ����� ��� Prolog �

�� ��� Tivoli Enterprise Console � ����� Prolog �� � Prolog �

� ��� � �� ��� �� �� �����. � ��� �� �� ��

/var/prolog/tec_r.nt_hosts ��� ���� ������.

nt_hosts(’hmckinne’). nt_hosts(’scary’).

�� �� �� ����� �� ��� ��� �� �����.

action: open_and_read: ( fopen(_fp, ’/var/prolog/tec_r.nt_hosts’, ’r’), read(_fp, _term) % _term is unified with nt_hosts(hmckinne). ), action: close_file: ( fclose(_fp) )

��

readln

468 IBM Tivoli Enterprise Console: � �� ���

readln

� ���� � �� ����.

��

readln(_file, _line)

��

�� _file� �� ��� �� _line�� �����. ��� �� � ��� �

�� EOF(�� �)�� ����. � ��� �� �� � �����.

��

_file fopen �� ��� �� ����� �� �� �

_line ����� ��� �. �� ��� �����.

�� ��� Tivoli Enterprise Console � ����� �� �� � /etc/hosts �

��� � �� �� �� �����.

127.0.0.1 localhost 146.84.113.31 arrakis

�� �� �� ����� �� ��� ��� �� �����.

loghostaction: open_hosts: ( fopen(_fp, ’/etc/hosts’, ’r’), readln(_fp, _hostsEntry) % _hostsEntry is unified with % ’127.0.0.1\tlocalhost\t’. ), action: close_hosts: ( fclose(_fp) )

��

read

�� A. ���� Prolog �� 469

real(�� ��)

�� ��� �� ���� �����.

��

real(_integer)

��

_integer� ��� �����.

��

_integer

�� ��

�� ����� � ���� �����.

_real is real(1) % _real is unified with 1.000000000000000e+00.

��

��

470 IBM Tivoli Enterprise Console: � �� ���

real(�� �� ���)

��� �� ��� ��� ������.

��

real(_term)

��

_term� ���� �����.

��

_term ��, ���� �� � �

�� ����� real ��� ��� ���� �����.

_real = 2.345, % Assign value. real(_real), % Succeeds. _real = 123, real(_real) % Fails because the variable is an integer.

��

��

�� A. ���� Prolog �� 471

realtoatom

��� ��� � �� �� �����.

��

realtoatom(_real, _atom)

��

_real� ��� ��������, � ��� _atom�� �����.

_atom� ��� ���� �� ������, ��� ���� _real�� ��

���.

��� �� ��� �� ���� ����� ���.

��

_atom �, ���� �� � �

_real ��, ���� �� � �

�� ����� ��� �� � � ��� �����.

realtoatom(2.345, _atom1), % Succeeds. _atom1 is unified with ’2.345000000000000e+00’. realtoatom(_real1, ’1.234’) % Succeeds. _real1 is unified with 1.234000000000000e+00.

��

��

472 IBM Tivoli Enterprise Console: � �� ���

reconsult

���� Prolog ��� �� ���� �� �����.

��

reconsult(_fileName)

��

� ��� _fileName� � Prolog �� �� ��� ���� �������. ��,

��� ��� ��� _fileName� ��� �� �� �����. �� ��

compile �, TECpcomp �� �� Prolog ����(interpreter)� ���� �

���� ���. ���� Prolog ��� Prolog ���� ������ ���.

��

_fileName

Prolog ���� ��� �� ��. wic �� �� ��� ���� ���

�. �� ���.

�� ����� � �� ��� �����.

unix_hosts(arrakis, support). unix_hosts(odin, support). unix_hosts(orange, support). % Contents of /var/prolog/tec_r.unix_hosts.pro compile(’/var/prolog/tec_r.unix_hosts’) % Creates /var/prolog/unix_hosts.wic. reconsult(’/var/prolog/unix_hosts’), % Reload and assert the clauses in the compiled % new version of the unix_hosts.wic file. unix_hosts(orange, support), % Query of the knowledge base succeeds, this % clause exists. unix_hosts(cerberus, development) % Query of the knowledge base fails, this clause % does not exist.

��

compile, consult

�� A. ���� Prolog �� 473

remove_dups

���� � ��� ����.

��

remove_dups(_list, _pruned)

��

�� _list�� �� ��� ����. ��� _pruned� �����.

��

_list �� ��. ����� ���.

_pruned

�� �� � ��, ���� �� � �

�� ��� �� �� ��� ��� � � ��� ����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. append(_unixHosts, [’odin’, ’perro’, ’arrakis’], _dupHosts), % _unixHosts is unified with the list % [arrakis, rooster, dune, perro, odin, perro, arrakis]. remove_dups(_dupHosts, _noDups) % _noDups is unified with the list % [arrakis, dune, odin, perro, rooster].

��

��

474 IBM Tivoli Enterprise Console: � �� ���

retract

�� ���� �� �� ����.

��

retract(_clause)

��

_clause� ���� �� �� �� ������ ����.

��

_clause

Prolog �� �� �

�� ����� �� ��� ��� �����.

assert( unix_hosts(arrakis, support) ), % Assert the fact unix_hosts(arrakis, % support) into the knowledge base. assert(unix_hosts(odin, support)), % Assert the fact unix_hosts(odin, support) % into the knowledge base. unix_hosts(arrakis, support), % Succeeds because the fact unix_hosts(arrakis, % support) has been asserted into the % knowledge base. retract( unix_hosts(arrakis, support) ), % Remove the fact unix_hosts(arrakis, support) % from the knowledge base. unix_hosts(odin, support), % Succeeds because the fact unix_hosts(odin, % support) has been asserted into the % knowledge base. unix_hosts(arrakis, _area) % Fails because the only fact about ’arrakis’ % has been retracted.

��

abolish

�� A. ���� Prolog �� 475

round

��� �� �� ��� � ���.

��

round(_real)

��

Prolog� ����� round(_number) = sign(_real) * trunc(abs(_real ) + 0.5)� �

����.

��

_real �� ��

�� ����� �� ��� ��� �����.

_float1 is 12.49, _float2 is -12.49, _float3 is 12.51, _float4 is -12.51, % Assign values. _int1 is round(_float1), % _int1 is unified with 12. _int2 is round(_float2), % _int2 is unified with -12. _int3 is round(_float3), % _int3 is unified with 13. _int4 is round(_float4) % _int4 is unified with -13.

��

��

476 IBM Tivoli Enterprise Console: � �� ���

rremove

���� �� ��� ����.

��

rremove(_element, _list, _tail)

��

_element� � ���, _element� �� _list� �� ��� ������ ��

� ��� _tail� �����.

_element� ��������, _element� ������ ��� ��� ��� _tail

� �����.

��

_element

� ���, ��� �� ��. ��������, ������ � �

�. �� �

_list ��� � �� ��

_tail �� ���� ��� �� �� ��

�� ����� ��� ��� �� _unixHosts��� ��� ��� ��� � �

� _tail� ���� �� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. rremove(_firstElement, _unixHosts, _tail) % Unifies _tail with [rooster,dune,perro]. rremove(’rooster’, _unixHosts, _tail2) % Unifies _tail with [arrakis,dune,perro].

��

��

�� A. ���� Prolog �� 477

sort

��� ��� ���� �����.

��

sort(_list, _sorted)

��

�� _list� �� �� �� ������ �����. �� ��� _sorted� �

����.

��

_list �� ��

_sorted

_list��� ��� ��

�� ����� _ntHosts ��� ���� �� �����.

_ntHosts = [’charon’,’scary’,’mach5’,’callisto’], % Assign value. sort(_ntHosts, _sorted) % _sorted is unified with [’callisto’,’charon’,’mach5’,’scary’].

��

��

478 IBM Tivoli Enterprise Console: � �� ���

sprintf

���� ���� �� ����.

��

sprintf(_atom, _format, _value)

��

_atom� _format� ��� ���� _value� � �� �������. �� �

�� C ����� ��� sprintf() �� �����.

��

_atom ��� � ���� �. �� �� � ��� ���.

_format

_atom� �� �� ��. �� �� �� ��� ��� �� ��� �

��� ������ ���.

%c �

%d 10� ����� �� ��

%e �� ����� �� ��

%f 10� ����� �� ��

%g � ���� �� ��(10� �� �� ���).

%o � �� 0�� ���� 8� ����� �� ��

%s �

%u ��� �� 10� ����� �� ��

%x � �� 0x� ���� 16� ����� �� ��

��� �� % �� �� � �� � ��� �� ��� �� � �

��.

- �� ��

0 ��� 0�� ���

n �� �� � � ��, n� ��� �� �����.

n.m ��� ��, n� ��� �� ���� m� ��� �� ��� �

����.

_value �� �� ��� � � �� � �� ��

�� ����� �� ��� ��� �����.

�� A. ���� Prolog �� 479

_integer is 123, _real is 12.3, _string = ’Hello, World’, % Assign values. sprintf(_string1, ’%s’, _string), % _string1 is unified with ’Hello, World’. sprintf(_string2, ’%20s’, _string), % _string2 is unified with ’ Hello, World’. sprintf(_string3, ’%-20s’, _string), % _string3 is unified with ’Hello, World ’. sprintf(_atom1, ’Integer in decimal notation: %d’, _integer), % _atom1 is unified with ’Integer in decimal % notation: 123’. sprintf(_atom2, ’Integer in decimal notation with field width: %10d’, _integer), % _atom2 is unified with ’Integer in decimal % notation with field width: 123’ sprintf(_atom3, ’Integer in decimal notation with leading zeros: %010d’, _integer), % _atom3 is unified with ’Integer in decimal % notation with leading zeros: 0000000123’. sprintf(_atom4, ’Integer in octal notation: %o’, _integer), % _atom4 is unified with ’Integer in octal % notation: 173’. sprintf(_atom5, ’Integer in hexadecimal notation: %x’, _integer), % _atom5 is unified with ’Integer in hexadecimal % notation: 7b’ sprintf(_atom6, ’Real in decimal notation: %f’, _real), % _atom6 is unified with ’Real in decimal % notation: 12.300000’. sprintf(_atom7, ’Real in decimal notation with field width: %3.2f’, _real), % _atom7 is unified with ’Real in decimal % notation with field width: 12.30’. sprintf(_atom8, ’Real in real notation: %f’, _real), % _atom8 is unified with ’Real in real notation: % 12.300000’. sprintf(_atom9, ’Real in exponential notation: %e’, _real), % _atom9 is unified with ’Real in exponential % notation: 1.230000e+01’. sprintf(_atom10, ’Real in its shortest form: %g’, _real) % _atom10 is unified with ’Real in its shortest form: 12.3’.

480 IBM Tivoli Enterprise Console: � �� ���

��

��

�� A. ���� Prolog �� 481

strip

���� �� ����.

��

strip(_atom, _position)

--��--

strip(_atom, _position, _chars)

��

�� ��(_chars �� ��)� � _atom���� �� �� ����.

�� ��(_chars �� �)� � _atom���� _char� ����.

_position� �� � �� ��� ��� �����.

��

_atom �� � �. �� ���.

_chars _atom���� � ��� �� �. �� ���.

_position

�� �� ��� �� � �� �� _atom �� ��. 3�� 2� �

� ���� ��� ���. 2�� 1� �� � ���� �� ��

�� �����. 2�� 0� �� ��� ��� ����.

_atom�

����

( � 2)

_atom� �

( � 1)

_atom� ��

( � 0) ��

� �

��

_position

0 0 0 ���� �� 0

0 0 1 �� ��� � � 1

0 1 0 �� ��� � � 2

0 1 1 �� �� ��� �

3

1 0 0 �� ����� � �

4

1 0 1 �� ��� � ���

� �

5

1 1 0 �� �� ��� �

6

1 1 1 �� ���� � � 7

482 IBM Tivoli Enterprise Console: � �� ���

1. �� ����� �� � strip �� ��� ��� �����(�� �

�).

_string =? string(’ atom with spaces ’), % instantiate _string with an atom. _newstring1 =? strip(_string, 4), % _newstring1 is unified with ’atom with % spaces ’. Characters stripped at beginning. _newstring2 =? strip(_string, 2), % _newstring2 is unified with ’ atomwithspaces ’. % Characters stripped at middle. _newstring3 =? strip(_string, 1), % _newstring3 is unified with ’ atom with % spaces’. Characters stripped at end. _newstring4 =? strip(_string, 7) % _newstring4 is unified with ’atomwithspaces’. % Characters stripped from entire atom.

2. �� ����� � �� �� � strip �� �����(��� �� ��

� �). � ���� Tivoli Enterprise Console ���� ����� �� msg

���� �������. � �� �� _msg ��� �����. � ��� �

��� ����� ��� � �� _newmsg ��� �����.

_msg = ’The following file has changed: "C:\CONFIG.SYS"’, % Assign message text to variable. _newmsg =? strip(_msg, 7, ’"’) % _newmsg is unified with ’The following file % has changed: C:\CONFIG.SYS’. Double quotation markss % stripped from entire atom.

��

��

�� A. ���� Prolog �� 483

subset

��� �� ��� ����� ��� ������.

��

subset(_list1, list2)

��

_list1� �� ��� _list2� ����� �����.

��

_list1 ���� ��

_list2 _list1 � ����� ��� �� ��

�� ��� ���� �� ��� �� ��� ��� ����� ��� �

�����.

_ntHosts = [’charon’, ’scary’, ’mach5’, ’callisto’], % Assign value. subset([’mach5’, ’callisto’], _ntHosts) % Succeeds.

��

��

484 IBM Tivoli Enterprise Console: � �� ���

substring

� ��� ��� � ����.

��

substring(_atom, _start, _length)

��

� _start�� ���� _length �� ���� _atom� ��� � �����.

�� �� �� �� 0�� �����. ���, atompart� � �� �

� �� ���� �� �� � � ��� �� ���� atompart �� �

����.

��

_atom �� � . �� ���.

_length

_atom���� �� ��� � ��. ��� ���.

_start _atom �� ��� � �� ��. ��� ���.

�� ����� �� 12�� ���� 6� ��� � _substr�� �����

� �� �����. � � �� �� �� 0�� �����.

_substr =? substring(’ atom with spaces ’, 12, 6) % _substr is unified with ’spaces’.

��

atompart

�� A. ���� Prolog �� 485

subtract

��� � ��� ����.

��

subtract(_list1, _list2, _difference)

��

_difference� ��������, _difference� �� _list2�� �� �� _list1�

��� �� ��� �� �����.

_difference� � ���, _difference� _list2�� �� _list1� ��� ����

�����.

��

_difference

_list1� _list2 �� ��. ��

_list1 ��

_list2 ��

�� ����� �� ��� ��� �����.

_ntHosts = [’charon’, ’scary’, ’mach5’, ’callisto’], % Assign value. subtract(_nthosts, [’charon’, ’scary’], [’mach5’, ’callisto’]), % Succeeds. subtract(_nthosts, [’mach5’, ’callisto’], _difference) % Instantiates _difference with [’charon’,’scary’].

��

��

486 IBM Tivoli Enterprise Console: � �� ���

term_type

��� ��� ����.

��

term_type(_term, _type)

��

_term� ��� _type� �����. _type� �� ��� ���� � ���

�������.

� ��

� �� var

�� ��

�� ��

� �

� �

�� � �

��

_term ��, ���� �� � �

_type � ��� ��, �� �� ��� ���� �� � �

�� ����� �� ��� ��� ���� �����.

_atom = ’Another atom’, _integer = 100, _real = 1.234, _list = [element1, element2, element3], % Assign values. term_type(_integer, _type1), % Succeeds and _type1 is unified with ’integer’. term_type(_real, _type2), % Succeeds and _type2 is unified with ’real’. term_type(_atom, _type3), % Succeeds and _type3 is unified with ’atom’. term_type(_var, _type4), % Succeeds and _type4 is unified with ’var’. term_type(_list, _type5) % Succeeds and _type5 is unified with ’functor’.

��

��

�� A. ���� Prolog �� 487

union

�� �� �� �� ��� �����.

��

union(_list1, _list2, _union)

��

�� _union� ��_list2� ���� �� _list1 ��� ��(_list2� ��� ���

�)� ���.

��

_list1 ��

_list2 ��

_union

_list1 � _list2� ��. ��

�� ����� �� �� ��� ��� �����.

_unixHosts = [’arrakis’, ’rooster’,’dune’, ’perro’], % Assign value. union(_unixHosts, [’perro’, ’dune’, ’odin’], _union) % instantiates _union with [’arrakis’, ’rooster’, ’perro’, ’dune’, ’odin’].

��

��

488 IBM Tivoli Enterprise Console: � �� ���

write

� ��� �����.

��

write(_file, _term)

��

_term� �� �� � _file� �� ��� ��� �����. � ��� ��

���� ����.

��

_file fopen �� ��� �� ����� �� �� �

_term �� Prolog �

�� Tivoli Enterprise Console � ��� /tmp/event.txt ��� ���� �� �

� �����. ���� ��� ��� ���� ��� ���� �� ��� ���

�� ����� ����� �� �� ����.

rule: write: ( event: _event of_class _class, action: write_assertions: ( fopen(_fp, ’/tmp/event.txt’, ’w’), write(_fp, ’Event of class ’), write(_fp, _class), write(_fp, ’, ’), write(_fp, _source), write(_fp, ’ received.\n’) ), action: close: ( fclose(_fp) ) ).

���� Su_Success ���� �� LOGFILE� � �����, /tmp/event.txt

��� � �� �� �� ���� ���.

Event of class Su_Success, LOGFILE received.

��

��

�� A. ���� Prolog �� 489

Tivoli Enterprise Console � ���� ���� �� � �� ��

��� Prolog�� ���� � � ��� Tivoli Enterprise Console � ���

� �� � ���. �� ��� �� ���� ��� �� �����.

v �� � � ��� �� Prolog ��� user_predicates ��� ��. �

� � ��� � ���� ���� � �����. � �� ����� ����

�� � � �� ���� ������.

v TEC_Start ���� � ��� �� ��� � assert �� ��. � �� ��

��� �TEC_Start ���� � assert � ���� ������.

v Tivoli Enterprise™ � ��� compile, consult/reconsult � ��. � ��

����� 437 ���� �compile�, 439 ���� �consult� � 473 ����

�reconsult�� ������.

����� �� � �� ��

� ��� � ���� ���� � �� ���� �� Prolog �� ��� ���

� ����.

1. Prolog �� ��� � � ��� ������.

2. ��� ����� � ���� TEC_TEMPLATES ������ Prolog ��

��� ������.

3. �� TEC_TEMPLATES ������ user_predicates ��� ������.

4. �� ��� Prolog �� ��� ��, user_predicates ��� �� �����

� ��� ������.

re_user_predicates(’filename’).

5. � ���� ���� �������.

�� � ���� �� ��� � � ��� ���� � � �� ���� � �

��� user_predicates �� �� Prolog �� ��� ��� � � ��� � ��

������, ��� ��� � � ��� ���� user_predicates ��� � �

��� ����� �� �� �����. ��� �� ��� ��� ����

� ���� ��� � � ��� ��� ���� �� ��� ����.

�: ���� � � ��� �����, �� ���� ���� ���

BIM_PROLOG_DIR �� ��� �� �� �� ���. �� ��

� 437 ���� �compile�� ������.

TEC_Start ���� �� assert �� ��

� � ��� �� ��� ���� assert �� � �� ��� � Tivoli

Enterprise Console �� ������. TEC_Start ���� � ��� �� ���

490 IBM Tivoli Enterprise Console: � �� ���

� �� �����. �� ����� my_string_match �� TEC_Start ��� �

� �� ���� �� �����. � �� �� ��� 426 ���� �assert��

�� ��� �����.

rule: boot_string_match: (event: _start of_class within [’TEC_Start’] where [ ], reception_action: action0:( assert((my_string_match(_string, _substring, _left, _right) :- atomlength(_substring, _sublen), atompart(_string, _substring, _startsub, _len), _lenl is _startsub - 1, atompart(_string, _left, 1, _lenl), _startr is _lenl + _sublen + 1, atompart(_string, _right, _startr, _lenr), !, true)) ) ).

Prolog ���� ��

Prolog ����(interpreter)� Tivoli Enterprise Console ��� �� ��

�. ��� ���� � � ��� � ��� ����� ���� ��� � �

��.

����(interpreter) ��� ��� ��� ��� � � ��� ��� ��

��� ��� � �� ����(interpreter)�� ���� ��� �����.

�� ��� �� ��� consult �� ���� � ���� ��� ���

��� �����. �� ��� ��� consult �� ���� ���. �� �

�� ��� ���, consult �� �����.

consult �� ���� �� ��� �� ���� ��� �, � Prolog ��

��(interpreter) �� ��� ���� � � ��� �� � ���. ��,

consult �� �� ��� ����� Prolog ���� ��� �����. ��

��� ���� ����, Tivoli Enterprise Console ��� ���� ��� ��

� ���.

����(interpreter)� ����� ��� ������.

1. $BINDIR/TME/TEC/interpreter.tar ��� ��� ���.

2. bash �� ���� UNIX �� �� �� ��� ��� ������. �

��� � ��� � ���� � ���� �� ��� �����.

v UNIX:

�� A. ���� Prolog �� 491

export BIM_PROLOG_DIR=$BINDIR/TME/TEC

v Windows:

export BIM_PROLOG_DIR=%BINDIR%\TME\TEC

3. ��� ! ��� �� $BIM_PROLOG_DIR/bin ���� ��� ��� �

��� BIMprolog ���� ����(interpreter)� ������.

����(interpreter)� ?- ����� �����.

4. ����(interpreter)� ����� halt� ������.(� �� �� ���

���.)

Prolog ���� �� ��

� ���� �� �� �� /prolog/source/connected.pro �� ��� �� �

�����.

connected(nodea,nodeb). connected(nodeb,nodec). is_connected(_first,_last):- (connected(_first,_last) -> !,true ; connected(_first,_next), is_connected(_next,_last) ).

�� �� ����(interpreter)� �� �� ��� ����, ����� ��

���, ���� ����� ������ ������.

�� ��� �� ��� � consult �� �����.

?- consult(’connected.pro’). compiling -c+ connected.pro loaded connected.pro Yes

�� ����� �� ��� ��� ��� �����. ��� ���� ����

��� ��� ��� ������.

?- is_connected(nodea,nodeb). Yes ?- is_connected(nodea,nodec). Yes ?- is_connected(nodea,noded). No

492 IBM Tivoli Enterprise Console: � �� ���

�� B. BAROC ��� BNF ��

���

parse ::= ( root | enumType | eventClass )* eof root ::= name ( <COLON> <TEC_CLASS> )? <SEMICOLON> <END> enumType ::= <ENUMERATION> name ( <INTEGER> ( name | string ) )+ <END> eventClass ::= <TEC_CLASS> <COLON> name ( superClasses )? ( <DEFINES> <LBRACE> ( name <COLON> ( ( complexity )? type )? ( ( slotFacet | slotFacets )+ )? <SEMICOLON> )* <RBRACE> )? <SEMICOLON> <END> ( <SEMICOLON> )? slotFacets ::= <COMMA> slotFacet slotFacet ::= default_value | parse_value | dup_detect | reverse reverse ::= <REVERSE> <EQUALS_SIGN> ( name | string ) parse_value ::= <PARSE> <EQUALS_SIGN> ( name | string ) dup_detect ::= <DUP_DETECT> <EQUALS_SIGN> ( name | string ) superClasses ::= <ISA> ( name | ( <LSQBRACH> name ( <COMMA> name )* <RSQBRACH> ) ) complexity ::= ( <SINGLE> | <LIST_OF> ) type ::= ( <STRING_TOK> | <INTEGER_TOK> | <INT32> | <REAL> | <NAME> ) default_value ::= <DEFAULT_TOK> <EQUALS_SIGN> ( <FLOAT> | string | list | name ) list ::= <LSQBRACH> ( ( name | string | <FLOAT> ) ( <COMMA> ( name | string | <FLOAT> ) )* )? <RSQBRACH> tokToStr ::= // Returns the string representation of the token. string ::= <STRING> name ::= ( <INTEGER> | <NAME> ) eof ::= ( "\u001a" | <EOF> )

���

< COLON: ":" > < COMMA: "," >

© Copyright IBM Corp. 2003 493

< DEFAULT_TOK: "default" > < DEFINES: "DEFINES" > < DOT: "." > < DUP_DETECT: "dup_detect" > < END: "END" > < ENUMERATION: "ENUMERATION" > < EQUALS_SIGN: "=" > <EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > < FLOAT: (["+","-"])? (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? | (["+","-"])? "." (["0"-"9"])+ (<EXPONENT>)? | (["+","-"])? (["0"-"9"])+ <EXPONENT> | (["+","-"])? (["0"-"9"])+ (<EXPONENT>)?> < INT32: "INT32" > < INTEGER: (["+","-"])? (["0"-"9"])+ > < INTEGER_TOK: "INTEGER" > < ISA: "ISA" > < LIST_OF: "LIST_OF" > < LBRACE: "{" > < LPAREN: "(" > < LSQBRACH: "[" > < MINUS: "-" > < NAME: (["a"-"z","A"-"Z","0"-"9","_",".","-","+","/","%","<",">", "&"])+ > < PARSE: "parse" > < RBRACE: "}" > < REAL: "REAL" > < REVERSE: "reverse" > < RPAREN: ")" > < RSQBRACH: "]" > < SEMICOLON: ";" > < SINGLE: "SINGLE" >

494 IBM Tivoli Enterprise Console: � �� ���

< STRING: ("\"" (~["\""] | "\\\"" | "\\\’")* "\"") | ("’" (~["’"] | "\\\"" | "\\\’")* "’") > < STRING_TOK: "STRING" > < TEC_CLASS: "TEC_CLASS" > < VAR: "_" ( ["a"-"z","A"-"Z","_","0"-"9"] )* >

�� B. BAROC ��� BNF �� 495

496 IBM Tivoli Enterprise Console: � �� ���

����

� ��� ��� ���� �� � ����� ��� ����. IBM� �� �

���� � �� �� ��, �� �� �� ���� �� �� ���.

� �� � � �� � ��� �� ��� �� IBM ���� �����

�. � ��� IBM ��, ��� �� ��� ����� �� �� IBM ��,

��� �� ��� �� � �� �� ���� ����. IBM �� �

��� ��� �� �, ���� �� ��, ��� �� ��� �� ��

�� ���. ��� IBM ��, ��� �� ��� � �� � �

�� ��� �����.

IBM� � ��� � � � �� ��� �� ��� ���� � � ��

� � � ���. � �� ����� �� ��� �� ������ ����

�� ����. ����� �� ����� ���� ������.

135-270

����� �� �$ 467-12, ������

�� ��..� ����

�����

����: 080-023-8080

2���(DBCS) ��� �� ���� ��� �� IBM ������ ����

�� ��� �� ����� ����.

IBM World Trade Asia Corporation Licensing

2-31 Roppongi 3-chome, Minato-ku

Tokyo 106, Japan

� ��� ���� ��� ��� �� ����� ��� ���.

IBM� �� �� �, ��� � �� ���� ���� �� ��� ���

��(, �� ��� ��) ����� ����� ��� ��� ���� � ��

���� �����.

�� ����� �� ��� ��� �� ��� ��� ����� ���� ��

�� � ��� ���� �� �� ���.

� ���� ���� ���� ���� ��� ��� � � ���. � �

�� ����� ����, � ����� ���� ����. IBM� � ��� �

�� �� �(��) ���� �� ��� ���� �� �(��) �� � �

��.

© Copyright IBM Corp. 2003 497

� ���� IBM� � ���� � ��� ��� ���, �� ���� ��

� ���� %��� �� �� ����. �� � ���� �� IBM ��

�� ��� ���� �� � ��� ���� � ��� �� � ���

���.

IBM� ��� ��� ��� �� �� ��� ����� ��� ��� ��

� ��� ��� ���� � ���.

(1) ����� ��� ��� � �� ���(� ��� ) �� �� �

(2) �� ��� �� ��� ���� ��� ��� ��� ���� ���

�� ��� ������.

135-270

����� �� �$ 467-12, ������

�� ��..� ����

�����

��� ��� �� �� � ��(�� ��, ��� �� �)� �� �� � �

��.

� ��� �� ��� ��� � �� �� �� ���� �� IBM� IBM

� ��, IBM ��� ���� ��(IPLA) �� �� �� ��� �� ��

� ����.

� ��� � � ���� �� ���� ��� ����. ���, �� �

��� �� ��� ��� �� � ���. �� ��� �� ��� ���� �

�� ���� � �� ��� ��� �� �� ���� ���� �� �

� � ����. ��, �� �� ��� � �� ��� �� ��� �� �

���. � ��� ��� ��� �� ��� �� ���� ���� ��

���.

IBM ��� ��� ��� �� ��� ���, �� � �� �� �� ��

��� � ����. IBM� ��� IBM ��� ����� �����, �� �

�� ��� �� ���, ��� �� � ��� ���� �� � ����.

IBM ��� �� �� ����� �� ��� ���� ������.

IBM� �� �� ��� ��� �� ��� ���� ��� � �� ��

� �� �� ����.

� ��� ��� ��� � ���� ��� � ���� �� ���. �

�� ��� ��� �� ��, � �� �, ��, ��� � ��� ��� ��

�. �� �� � � ����, �� ��� ������� �� ���� �� �

��� �� ���� ���� ��� �����.

498 IBM Tivoli Enterprise Console: � �� ���

� ���� �� ��� � �� ������ ��, �� ��� ���

�� ����� �� �����. ��� � �� ���� IBM� �� �

��� �� �� ���� ��� �"�� �� API(application programming

interface)� ��� ����� ���� ��, ��, �� �� ���

� ��� ���� ��, �� � � ���. �� ��� �� ��� ��

��� ���� �� ����. ��� IBM� �� ���� ���� ���, �

�� �� �� �� ��� �� ����. ��� � �� ���� IBM�

�� ���� �� IBM� API(Application Programming Interfaces)� ���

����� ���� ��, ��, �� �� � ���� ��� ���� �

�, �� � � ���.

����� ���� � ��� �� ��, ���� �� ��� ��� ���� �

� �� ���.

��

�� ��� � �� �� ���� ���� IBM Corporation� �����.

v IBM

v IBM ��

v Tivoli

v Tivoli ��

v DB2

v IBMLink

v NetView

v Tivoli Enterprise Console

v TME

Java � �� Java �� �� � ��� � �� �� ���� ���� Sun

Microsystems, Inc.� �� �� �������.

Microsoft � Windows NT� � �� �� ���� ���� Microsoft Corporation

� �������.

Java � �� Java �� �� � ��� � �� �� ���� ���� Sun

Microsystems, Inc.� �� �� �������.

UNIX� �� �� ���� ���� Open Group� �� �����.

�� ��, ��, �� ��� �� ��� �� �� ������.

���� 499

500 IBM Tivoli Enterprise Console: � �� ���

��

���� �� 346

�, �� � 243

�� ��, ��� xvii

��, ��� �� 216

�� ��

����� �� xv

��� ��� � 175

�� ��

� �� 116

� �� 226

�� 8

��, �� 116, 226

��, �� 226

�� facet 46

��

�� xvi

��� ��

�� � 181

�� ��� 218

� � 182

�� 232

�� 153

�� 59

�, � �� 86

��, � � 183

�� 60

�� � 187

��� �� �� 221

���� �� 197

��� �� � �� � 86

�� �� xvi

� � ��� 17, 23

� ��(facet) 46

� ��� 48

�� � ��� ��, � �� �� 28, 273

��� �� 140

��� �� � �� 135

��� � 246

���� �� � 122

����� ��� � 178

�� ���, � 54, 178

���� xv

��� �

�� 66

� � ��, � �� �� 275

�� 12

��� �� 66, 280

��� �� 66, 281

� � ��, � �� �� 275

� �� �� ��� �� 66

� �� �� ��� �� 66

��, �� 389, 390

�� ���, ��� 90, 94

��, � ���

� ��� �� �� 16

��� �� � �� Prolog � ��� 391

��� ��, BAROC� Prolog� � 389

�� � ��� 4

��� ��, � ��� 57

��� ��, ��� �� 216

��� ��, ��� xvii

���

�� �� Prolog � �� 236

�� ��� �� 198

�� 259

���� 264

�� �� ��� ��� 224

��� � �� � 88

������ � ��� 36

��� � ��� � , � �� �� 29

� ��� 48

�� 61

�� � �� 61

© Copyright IBM Corp. 2003 501

� (��)

��

� � 66

�� � 63

� � 61

�� � 68

�� 13

�� � 64

��� ��, �� 59

��� �� �� 59

� �� ��� �� �� 263

� � 66

� � �� 66

��, �� 389

���

� �� 259

�� �� Prolog � �� 236

�� ��� �� 198, 233

���, �� �� 224

� �� 259

� ���

���� ��� ��� 255

SendEvents ����� ��� ��� 257

tec_agent_demo ����� ��� ��� 255

� ����� 264

�� � 54, 63

�� � �� 54

�� � ��

�� � �� �� 74

��

��� 59

�� �� 58

�� 59

���� 58

�� �� �� 58

���� 58

� �� 58

�� 59

�� 58

��� �� 58

���� �� 58

� � 61

� � �� 61

�� � 285

�� �, ��, � �� �� 285

� � ��� 14

�� 80, 259

� (��)

(��)

���� 80, 264

� �, �� 389

�� �� Prolog � �� 236

�� � 68

�� � �� 68

��, �� �� �� 287

��, ��� �� 143

�� 60

�� ��

�� 337

�� 337

�� 326, 341

�� 312

�� 317

��� 318

� 317

�� 321

�� 11

�, �� 11

� �� � �� Prolog � �� 11

�� 11

��

� �� 295

��� ���� �� 239

��, �� 198, 233

��

� � 12

�� � 12

� � 11

�� � 12, 285

�� � 12

�� � 12

�� �� �� 57

��� �� 143

��� �� 53

��� ��

��� �� �� �� � �� �� �� � �� �� 70

�� ������ ���� 269

����, �� 389

�� � �

�� � � �� 206

��

� � 66

�� � 78

� � 78

�� � 68

502 IBM Tivoli Enterprise Console: � �� ���

� (��)

�� (��)

�� 78

�� 13

�� 78

�� �� �� 57

�� 78

�� � 78

�� �� 78

�� �� 78

�� �� 78

�� � 78

��� �� 129

reception_action 78

redo_action 79

� 61

���

�� 80

�� 80

���� 80

fire_on_non_leaf 80

�� �� 260

�� 120, 189

�� � 55, 64

�� � �� 55

�� � ��

�� � �� �� 76

��� �� 160, 163

���

� �� � �� 88

��� �� 154, 156

��� �� 129, 130, 131

ground, �� 389

Prolog

� 386

��� �� 385

�� 11

Prolog �� 11

/* */(� ��) 61

� �� � �� 61

� ���

�� 3, 14

�� 16, 19

� 17, 23

�� � ��� ��, � �� �� 273

�� 14, 16

� ��� �� �� 16

��� �� 57

� ��� (��)

��� ��, UNIX 36

��� 36

� ��� �� 14, 16

� ��� �� �� 16

� ��

� �� �� 269

� �� 17

� �� �� 17

� �� �� 18

� � 18

� � �� 18

� � �� 18

�� 17

�� 18

� 14

�� 36

�� 14

���� 15

�� 22

���� �� 15

�� �� �� 57

��� ��� 14

��� ��� �� 41

�� 14

���, wrb ��

Tivoli Enterprise Console ��� �� 292

���, � �� �� 292

��� �� ��, ��� �� 202

BAROC �� �� 23

compile 15

UNIX ��� �� 36

wrb �� 14

� ��� �� 3

� ��� ��

�� 19

� �� �� 18

� � �� 18

�� 14, 16

��� ��� 21

��� ��� �� 41

� ��� �� � ���, � �� �� 34

� ��� �� 18

� ��� ��, � �� �� 30

� ��� ��, � �� �� 31

� ��� ���� 15

� ��� ���, � �� �� 34, 292

� ���� ���� �� 15

� 503

� ���� �� 17

� ���� �� UNIX ��� �� 36

� ���� � �� � BAROC �� � , � �� �� 29

� �� 326

� ��

�� 270

�� � ��� �� 28, 273

� � 275

� �� �� ��� �� 280

� �� �� ��� �� 281

��� � ��� � 29

� ��� �� � �� � BAROC �� � 29

� ��� �� � ��� 34

� ��� �� 30

� ��� �� 31

� ��� ��� 34, 292

� ���� � �� �� 32

� ���� BAROC �� �� 33

� �� �� 291

�� � �� 285

�� ��� 287

� � ��� �� 27

� � �� 273, 275

�� 269

�� 272

��� � ��� � 28

�� 295

�� ������ � ���� 26

�� 270

��� ���, �� 269

UTF-8 �� 270

� �� �� 272

� ��

�� 19

� 17

� ��, �� 269

� �� ��, � �� �� 291

� �� ��, � �� �� 275

�� 18

�� 18

� � �� ��, � �� �� 273

�� 17

�� 20

�� �� �� 57

�� 57

��� �� 130, 131

� �� � 18

� �� �� 18

� �� �� 20

� �� ��, � �� �� 291

� �� ��, � �� �� 275

� ��� � ���� ��, � �� �� 32

� �� �� 80, 259

� �� ���� 80, 264

� �� �

��� �� � 86

��� � 88

�� 81

�� �� 81

�� 11, 81

�� �� � 86

��� � � 84

��� �� � 81, 245

��� �� � � 82

��� � � 85

�� �� � 88

�� � � � 85

��� � 85

��� 127

��� �� 84

add_to_repeat_count 89

all_clear_targets 90

all_duplicates 91

all_instances 93

any_clearing_event 95

any_clear_target 94

attr_condition 96

attr_exception 98

attr_sequence 99

BAROC �� � 84

bo_add_at_slotval_begin 100

bo_add_at_slotval_end 101

bo_get_class_of 102

bo_get_class_slots 103

bo_get_enum_options 105

bo_get_slotval 106

bo_is_defined_for_class 107

bo_is_direct_super_of 108

bo_is_super_of 109

bo_remove_from_slotval 110

bo_reset_default_slotval 111

bo_set_slotval 112

cancel_all_timers 113

cancel_timer 114

change_event_administrator 116

change_event_severity 117

504 IBM Tivoli Enterprise Console: � �� ���

� �� � (��)

change_event_status 118

check_all_thresholds 119

check_and_increment_count 120

check_event_criteria 122

check_threshold 124

clear_closed_events 126

commit_action 129

commit_rule 130

commit_set 131

convert_ascii_time 132

convert_gm_time 133

convert_local_time 134

create_cache_search_criteria 135

create_clearing_event 137

create_event_criteria 140

create_event_sequence 143

create_threshold 148

decrement_slot 150

drop_change_request 151

drop_received_event 152

erase_globals 153

exec_program 154

exec_program_local 156

exec_task 160

exec_task_local 163

first_causal_event 167

first_duplicate 169

first_effect_event 171

first_instance 173

first_related_event 175

forward_event 177

generate_event 178

get_attributes 179

get_config_param 180

get_globals 183

get_global_grp 181

get_global_var 182

get_gm_time 184

get_local_time 185

get_time 186

global_exists 187

increment_slot 188

init_count 189

init_event_activity 191

ip_node_unreachable 194

is_clearing_event 195

link_effect_to_cause 196

� �� � (��)

load_globals 197

log_error 198

place_change_request 200

print_cache 201

print_class_tree 202

print_event_activity 203

Prolog � �� � �� 396

redo_analysis 215

remove_bslashes 216

reset_event_activity 217

reset_global_grp 218

resolve_time 219

re_after_match 204

re_before_match 205

re_create 206

re_mark_as_modified 207

re_match 208

re_search_string 209

re_send_event_conf 210

re_split_event_id 211

re_substitute 213

re_substitute_global 214

save_globals 221

search_cache 222

set_detailed_debugging 224

set_event_administrator 226

set_event_message 227

set_event_severity 230

set_event_status 231

set_global_var 232

set_log_error_source 233

set_timer 234

trace_it 236

unlink_from_cause 237

update_event_activity 238

� ��

��, � 180

�� � �� 54

� 14

�� 53

� � 55

��� �� 53

�� �� 387

�� � �� 55

���� �� 55

� ��

� � 66

� 505

� �� (��)

� � �� 66

�� � 63

�� � �� 63

� � 61

� � �� 61

�� � 285

�� � 68

�� � �� 68

�� � 64

�� � �� 64

� ��

��, �� �� 78

� ��� �� 120, 189

� ��

��� �� �� 10

� ��� � �

� �� �� 53

� ��� 255

�, ��� �� 255

� �

�� 19

�� 18

�� 18

�� 18

�� 19

�� �� �� 57

�� 57

� � � 18

� � �� 18

� �� ��

�� ��� �� 74

�� �� �� 75

���� ��� �� 160, 163

���� ��� �� 154, 156

��� ��� ��

� ��� ��� �� �� 131

� �� ��� �� �� 130

� �� ��� �� �� 129

�� �� � �� 61

�� �� ��� 48

�� ��� 48

������

�� �� xii, xiv

���, ��� �� 227

���, ��� �� 227

��

postemsg 7, 255

upgrade_gui.sh 269

wpostemsg 7, 255

wrb

� ��� ��, �� 17

� �, �� 19

��� ���� 14

wrbupgrade 15

wtdumprl 6

�� ��, � 105

�� �� Prolog � 393

��� �

�� 312

� �� � 374

� �� � 376

� � 362

� � 366

��� ��

�� �� 379

����� � 243

���, �� 216

�� �

�� 63

� ��� �� �� 54

�� ��, �� 200

�� �� �� 12

�� 12

�� � ��

�� 74

�� �� �� 75

�� �� 74

�� ��

� ��� �� �� 54

�� 12

�� 74

�� 54

�� 200

�� 151

�� �� �� 151

��

��� ��

��� �� �� 59

� 58

506 IBM Tivoli Enterprise Console: � �� ���

�� (��)

�, �� �� 58

�� �� 59

�� �� 344

��� �� 70

�� �� 59

�� ��, TEC_UMASK 36

Prolog variables, described 385

TEC_UMASK �� �� 36

_class 70

_event 70

_(Prolog �� ��) 70

��, ��� xvii

�� 311, 318, 319, 320, 322

���

��� �

� �� 191

���� �� 203

� ��� 217

�� �� 238

��� �� 202

����, � �� 264

� �, �� 61

� �, �� 11

�� � 341

�� � 285

�� � �� 12

�� � ��, � �� �� 285

�� �, ��, � �� �� 285

� � 355

� � 358

�� � 377

�� � ��� 14

��� � �� 269

� �, �� 389

�����, Prolog 386

�� �� � �� 490

�� �� Prolog � �� 236

�� �

�� 68

�� � �� 285

�� 12

�� 239

�� � �� � 81

�� �� 239

�� ��� 239

�� ���, � �� 287

��, ��

�� �� �� 311

��, ��� ��� 47, 49

��, � �� 60

�� �� 8

� �� 346

�� 311

�� 337

� 312

��� 379

�� �� 344

�� 318, 319, 320, 322

�� 326, 341

�� �� 311

��, � 316

��, �� 346

� ����� 346

�� �� 313

�� � 317

��� � 318

� � 317

�� � 321

�� � 321

allEvents �� 318

CDATA �� 337

eventType �� 317

firstEvent �� 318

forwardEvents �� 319

id �� 316

lastEvent �� 318

sample.xml �� 311

TECSummary 313

thresholdCount �� 319

timeInterval �� 319

timeIntervalMode �� 319

triggerMode �� 318

XML 311

�� ��

� �� 118

� �� 231

�� 9

�� ��

�� 311

��, �� 118, 231

��, �� 231

� � ��� ��, � �� �� 27

� 507

� � �� ��, � �� �� 273

�����, �� 47

�� xii

�� ��� xiv

�� xiv

�� �� xiv

� �, � �� 55

����� ��

�� xv

��

�� �� 316, 346

thresholdCount 319

timeInterval 319

timeIntervalMode 319

triggerMode 318

�� � �� 150

�� � �� 188

�� � ��� 73

�� �� �� 75

�� � ��, �� �� �� �� 75

�� ��

��� ��, �� �� �� ���, �� �� �� ��� ��,

�� �� �� 73

�� ��

��� �� ��, �� �� 13

��, ���

��� �� �� 107

�� ��, �� � 74

�� ��, ��� �� 6

��� ��� �� 152

��� BAROC �� �� 51

����� � 108, 109

�����, �� 47

��� ��, �� �� �� 349, 357, 363, 364

��� � � Prolog � 394

�� 347

����� 346

� �� � �� Prolog � �� 81

� 362

� �� 374

��, 22

� 355

�� 377

�� � ��� �� �� 22

�� �� Prolog � �� 490

�� �� Prolog � �� 236

�� ��, Prolog �� 490

� (��)

�� 81, 385

�� �� 385

�� 347

�� �� 378

IP �� 373

IP �� �� 379

Prolog �� 491

� �� 22

��, ������ �� 216

��, �� 216

��

��, �� � 219

�� �� � ��, �� 134

�� �� GMT�, �� 133

�� ��, � 186

� , �� 132

� ��, � 185

GMT, � 184

�� �� ��, fixedWindow, �� � ��� 320

�� �� ��, slideWindow, � � ��� 320

�� �� � �� � 86

�#� �� 9

��� �� 117, 230

���, �� 117, 230

���, �� 230

������ xvii

� ��� xvii

��� �� xvii

���� xviii

��� � ��� � , � �� �� 28

���, ��� 5

������� �� ��� 3

��, �� 50

� ���

� 171

�� 242

� ��� �� 196

� ��� �� �� 237

�� � � 244

��

�� 239

��� ��� �� xiv

� ��� 22

508 IBM Tivoli Enterprise Console: � �� ���

�� (��)

� �� 295

�� 239

��� �� �� 144

��� � ��� 192

��, � 260

���� ���, � �� 264

Prolog �� 492

Prolog, ��� �� 389

���� ��, Prolog 438

�� ��

��� xiv

�� �� 311, 313

��, Prolog 491

� � � ��� �� 196

� � � ���� �� �� 237

� ���

�� 242

� ��� �� 196

� ��� �� �� 237

�� � � 244

�� � � 167

� �� Prolog � 392

��, 10

�� �� ��, � �� 57

���

��, ��� �� 211

��, �� 246

��� ��� � 175, 247

��, �� 116, 226

��, �� 226

��� � 246

�� 140

� 122

�� ��� � 178

�� ���, ��� 178

�� ���, � 54

�� ��� ��� 177, 210

�� ��� �� 177, 210

�� � 4

���, �� 227

���, �� 227

������� ��� 7, 255

�� ��

� ��� �� �� 54

�� 12

�� 54

��� (��)

�� �� (��)

�� 200

�� �� 239

��, �� 118, 231

��, �� 231

�� 5

�� 120, 189

�� �� 73, 246

�� ��, ��� �� 6

���, �� 117, 230

���, �� 230

�� 317

������ � 3

� ���

� 171

�� 242

� ��� �� 196

� ��� �� �� 237

�� � � 244

� ���

� 167

�� 242

� ��� �� 196

� ��� �� �� 237

�� � � 244

��� ��� 152

��� �� 152

���� � ��� 255

� ��

�� �� 239

�� �� �� 242

�� � ��, � �� �� 285

���, �� � 93

��� �� 148

��� � 119, 124

� 11, 54

��� �� 11, 54

� 317

� ���

�� 83

��� ���� �� � � 91

��� ���� �� � � 169

dup_detect ��(facet) 47

dup_detect (��)facet 47

��� ���

� 95

�� 243

� 509

��� (��)

��� ��� (��)

�� � 195

��� ��� �� 127, 137

���� �� ��� �� 90

��� �� ��� �� 94

�� � � 245

�� ��� ���, ��� 126

�� ��� � 173

�� � 135, 222

��, �� 10

��, ���� �� 12

�� 311

��� 7

� ��

���, � ��� �� 203

� ���

� �� 191

���� �� 203

� ��� 217

�� �� 238

ID 10

SendEvents ����� ��� 257

tec_agent_demo ����� ��� 255

��� �� � ��

�� �� 239

�� �� �� 242

�� � ��, � �� �� 285

��� �� 241

��� � � �� � 84

��� �, �� 140

��� �, � 122

��� ��� 152

��� ��� 177, 210

��� xiii, 3, 41

��� �� � �� � 81, 245

��� ��

�� �� 211

�� �� 180, 210

�� 294

��� ��� 177, 210

��� �� 177, 210

� 294

server_path �� �� 211

.conf �� 210

��� �� �� 294

��� �� ��� 294

��� �� � 294

��� ��

� �� 150

� � 179

� �� 188

� ��� 73

�, ���� �� 110

�, �� 112

��

� �� 116

� �� 226

�� 8

� �, �� 111

��� � �� 100, 101

��

� �� 118

� �� 231

�� 9

��, �� 207

�#� 9

��� 117, 230

���, �� 5

��� ��, �� 8

��, � 107

�� 246

acl 8

BAROC ��� �� 44

cause_date_reception 8

cause_event_handle 8

complex_type 45

date_reception 9, 10

duration 9

event_handle 9, 10

facet 46

msg 227

num_actions 9

Prolog ��� ��� � 389

server_handle 9, 10

server_path 9

server_path, �� 211

simple_type 45

��� ��

��� ��� � 175

�� ���� �� ��� �� 98

�� 239

�� �, �� 99

�� �� 99

�� ��, �� 98

�� �� 246

510 IBM Tivoli Enterprise Console: � �� ���

��� �� (��)

�� ��, �� 96

� ��� � 171

� ��� � 167

��� ��, �� 127, 137

��� � �� 143, 239

�� 239

��� ��� 5

��� � 11, 215

��� �� 177, 210

��� ��

� �� �� 53

� �, �� 135

��� ��� � 175, 247

�� ��� � 93

�� � � 91

�� � 243

�� 10

� ��� � 171

� ��� � 167

��� �� �� � 222

� ���, �� � � 91

� ���, �� � � 169

�� ��� � 173

�� � � 169

��� �� 201

��� �� � 135, 222

��� �� � � �� � 82

��� ��� � �� �� 53

��� ��� 48

�� �� 43

�� ��, ��� �� 202

���� �� 51

� ��� 48

� ��� 48

�� 48

�� �� 48

��, 51

� � ��� 14

�� � ��� �� �� 21

�� 47, 49

�����, �� 47

�� �, � 106

�� �� 44, 103

�� ��, � 107

��, �� �� � 103

��� BAROC �� �� 51

����� � 108, 109

��� ��� (��)

�����, �� 47

�� 48

�� �� �� 57

��� ��� 48

��� ��� �� 41

�� 43

��� ��, � 102

BAROC �� �� 41

fire_on_non_leaf ��� 80

non-leaf ��� � �� 80

non-leaf ���, � � 80

��� ��� �� 41

��� ��� �� ��

BAROC �� �� 41

��� ��

�� 70

�� 70

� �, �� 263

�� 70

�� ���� 74

�� 13, 70

�� �� 73

�� �� 13, 73

�� 73

��� ��

�� 70

_ 70

_class 70

_class outside 72

_class within 71

��� �� 13, 70

of_class �� 70

where � 73

��� ��� 7

�� �� 311

��� � � �� � 85

��� � ��

�� � �� 191

���� �� 203

� ��� 217

�� �� 238

��� ID 10

�� � ��� ��� 15

�� ������ � ���� 269

���� � �� Prolog � 391

����, �� 389

�, UTF-8 337

� 511

�� �� � �� � 88

�� � �

�� � � �� 206

��

� � ���� �� 209

��� � �� 205

��� � �� 204

�� �� � �� 214

�� � �� 213

�� � �� 208

�� � � � �� � 85

�� � 317

��� � 318

��� � �� � 85

��� �� 148

��� � 119, 124

����� �� 37, 52, 270

UTF-8 � 337

�� 10

��� ��

�� 11

��, � �� 54

redo_analysis � �� � 215

� � �� 347

�� �� � 378

�� � 347

�� � 350

��, � � 66

�� ����� 344

�� �, � 78

��, ��

��, �� �� 78

� �� 61

BAROC �� 61

Prolog 388

� � 317

� ���

�� 83

��� ���� �� � � 91

��� ���� �� � � 169

� �� 89

dup_detect ��(facet) 47

�� �� 347

�� �� �� 9

���

�, ��� �� 80

�� 80

���� 80

fire_on_non_leaf 48, 80

�� �� Prolog � 395

�� ��, �� 387

��� ���

� 95

�� ���, �� 90, 94

�� 243

�� � 195

��� ��� �� 137

�� � � 245

����� ���, �� 82

�� �� xii, xiv

�� ��� ��� ��� 126

�� � 321

�� 224, 259

�����, ���

��� �� �� 10

�� � 321

���

��� ��� �� 41

�����

�� �� 317, 318, 321

�� 12

�� 113, 114

�� �� 234

�� �

�� 64

�� 12

�� 55

�� � ��

�� 76

timer_duration �� 77

timer_info �� 76

���, ���� �� 160, 163

512 IBM Tivoli Enterprise Console: � �� ���

��� ���� � �� �� 269

��� ���, �� �� � �� 269

���

� �� � �� Prolog � �� � �� 81

���� ��, � �� 55

�� ��� 311

�����

��, ��� �� 210

� �� 57

� � 57

��� �� 201

BAROC

�� 41

�� �� 44

BAROC �� �� 41

root.baroc 21, 51

tecroot.xml 311

tecsce.dtd 311, 337

tec.baroc 21, 51

user_predicates 490

.conf 210

��, � ���� 17

���

�� �� xvii

�� xvii

�� �� xvii

���, ���� �� 154, 156

��� �� � �� � 84

��

�� �

�� � �� �� 74

�� 70

���

��� �� �� 70

�� �

�� � �� �� 76

����, Prolog 385

� � ��� 36

���, ��� �� ��� xvii

�� ��, TEC_UMASK 36

�� ��, ��� xvii

�� � ��� 36

Aabolish Prolog � 423

absolute float 360

absolute � 352

ACK �� 10

acl �� 8

add_to_repeat_count � �� � 89

allEvents �� 318

all_clear_targets � �� � 90

all_duplicates � �� � 91

all_instances � �� � 93

anonymous ��, Prolog 70

any_clearing_event � �� � 95

any_clear_target � �� � 94

append Prolog � 424

areDisjoint 375

ascii Prolog � 425

assert Prolog � 426, 490

atom Prolog � 429

atomconcat Prolog � 434

atomic Prolog � 430

atomlength Prolog � 431

atompart Prolog � 432

atomtolist Prolog � 436

atom, in Prolog 385

attr_condition � �� � 96

attr_exception � �� � 98

attr_sequence � �� � 99

BBAROC �� � �� � 84

BAROC ��

�� 43

��� ��, Prolog� � 389

� ����� �� 23

�� ��, � 105

�� ��, � 103

��� �� �� 51

�� 21, 48

��, �� 51

�� �� �� 57

��� ��� �� 41

� 61

root.baroc 21, 51

tec.baroc 21, 51

UTF-8 �� 52

� 513

BAROC �� (��)

/* */(� ��) 61

BAROC ��� � ���� ��, � �� �� 33

Boolean �� 344

boolean.and 377

boolean.not 378

boolean.or 378

bo_add_at_slotval_begin � �� � 100

bo_add_at_slotval_end � �� � 101

bo_get_class_of � �� � 102

bo_get_class_slots � �� � 103

bo_get_enum_options � �� � 105

bo_get_slotval � �� � 106

bo_is_defined_for_class � �� � 107

bo_is_direct_super_of � �� � 108

bo_is_super_of � �� � 109

bo_remove_from_slotval � �� � 110

bo_reset_default_slotval � �� � 111

bo_set_slotval � �� � 112

Ccancel_all_timers � �� � 113

cancel_timer � �� � 114

cause_date_reception �� 8

cause_event_handle �� 8

CDATA �� 337

change_event_administrator � �� � 116

change_event_severity � �� � 117

change_event_status � �� � 118

check_all_thresholds � �� � 119

check_and_increment_count � �� � 120

check_event_criteria � �� � 122

check_threshold � �� � 124

clears � �� � 127

clear_closed_events � �� � 126

CLOSED �� 10

commit_action � �� � 129

commit_rule � �� � 130

commit_set � �� � 131

compile Prolog � 437

complex_type 45

concat � 367

conf �� 210

consult Prolog � 439

contains � 364

convert ��� �� Prolog � 392

convert_ascii_time � �� � 132

convert_gm_time � �� � 133

convert_local_time � �� � 134

create_cache_search_criteria � �� � 135

create_clearing_event � �� � 137

create_event_criteria � �� � 140

create_event_sequence � �� � 143

create_threshold � �� � 148

Ddate_reception �� 9, 10

dayOfWeek � 367

dayOfWeekString � 368

DBCS ��

UTF-8 �� �� 37

DBCS(double-byte character support)

UTF-8 �� �� 37

decrement_slot � �� � 150

delete Prolog � 440

disjoint Prolog � 441

drop_change_request � �� � 151

drop_received_event � �� � 152

DTD �� 337

dup_detect ��(facet) 47

Eempty_list Prolog � 442

endsWith � 365

erase_globals � �� � 153

eventType �� 317

event_handle �� 9, 10

exec_program � �� � 154

exec_program_local � �� � 156

exec_task � �� � 160

exec_task_local � �� � 163

existRuleId � 368

Ffacet, �� 46

fclose Prolog � 443

fire_on_non_leaf ��� 48, 80

firstEvent �� 318

first_causal_event � �� � 167

first_duplicate � �� � 169

first_effect_event � �� � 171

first_instance � �� � 173

514 IBM Tivoli Enterprise Console: � �� ���

first_related_event � �� � 175

flisting Prolog � 444

Float �� 344

float.abs 360

float.add 358

float.div 359

float.eq 355

float.ge 357

float.gt 356

float.le 357

float.lt 357

float.max 360

float.min 360

float.mul 359

float.ne 356

float.neg 361

float.range 361

float.sub 359

fopen Prolog � 445

forwardEvents �� 319

forward_event � �� � 177

Ggenerate_event � �� � 178

getEventType � 369

get_attributes � �� � 179

get_config_param � �� � 180

get_globals � �� � 183

get_global_grp � �� � 181

get_global_var � �� � 182

get_gm_time � �� � 184

get_local_time � �� � 185

get_time � �� � 186

global_exists � �� � 187

ground Prolog � 446

ground, �� 389

GUI � ��

� �� �� 269

HhourOfDay � 369

Iid �� 316

ignorecase equal � 365

ignorecase not equal � 365

increment_slot � �� � 188

init_count � �� � 189

init_event_activity � �� � 191

Int �� 344

integer Prolog � 421, 448

intersect 376

intersect Prolog � 449

intset.isMemberOf 379

inttoatom Prolog � 450

int.abs 352

int.add 350

int.div 351

int.eq 347

int.ge 349

int.gt 348

int.le 349

int.lt 349

int.max 352

int.min 353

int.mod 353

int.mul 351

int.ne 348

int.neg 353

int.numOfEvents 354

int.range 354

int.sub 351

int.timeNow 354

int.timeSpan 355

int_to_hex Prolog � 447

IP �� �� � 379

IP �� � 373

IP ��, �� � ���� � 194

ipaddress.eq 373

ipaddress.isMemberOf 379

ipaddress.ne 373

ip_node_unreachable � �� � 194

is Prolog � 451

isMemberOf 375, 378, 379

isSubsetOf 375

is_clearing_event � �� � 195

is_list Prolog � 452

I/O Prolog � 396

Jjoin 376

� 515

LlastEvent �� 318

length Prolog � 453

length � 370

link_effect_to_cause � �� � 196

load_globals � �� � 197

log_error � �� � 198

lowertoupper Prolog � 454

Mmax float 360

max � 352

MBCS ��

UTF-8 �� �� 37

MBCS(multiple-byte character support)

UTF-8 �� �� 37

member Prolog � 455

min float 360

min � 353

mod � 353

month � 370

monthString � 371

msg �� 227, 313

Nname Prolog � 456

negate float 361

negate � 353

nmember Prolog � 458

nmembers Prolog � 459

not Prolog � 460

number Prolog � 461

numOfEvents � 354

num_actions �� 9

Oof_class �� 70

OPEN �� 10

Pplace_change_request � �� � 200

pointer Prolog � 462

pointeroffset Prolog � 463

pointertoatom Prolog � 464

pointertoint Prolog � 465

postemsg �� 7, 255

previousValues 377

printf Prolog � 466

print_cache � �� � 201

print_class_tree � �� � 202

print_event_activity � �� � 203

profile ��� 80

Prolog

��, �� 389

��� �� 388

��� ��, BAROC� � 389

� 386

��� �� 385

�� 385

� �, �� 389

�� 386

�� �� � �� 490

�, �� 385

Prolog � �� 385

�, �� �� 385

��, �� 11

��, ��� �� 389

���� �� 438

�� 491

����, �� 389

� 388

�� �� 387

atoms 385

basics 385

constants 385

ground, �� 389

terms 385

_(anonymous) �� 70

Prolog �

��� �� � �� � ��� 391

�� �� � 393

�� 391

�� �� 391

�� �� � �� 490

�� 385

��� � � � 394

�� �� 385

� �� � 392

���� � �� � 391

�� �� � 395

abolish 423

516 IBM Tivoli Enterprise Console: � �� ���

Prolog � (��)

append 424

ascii 425

assert 426, 490

atom 429

atomconcat 434

atomic 430

atomlength 431

atompart 432

atomtolist 436

compile 437

consult 439

convert ��� �� � 392

delete 440

disjoint 441

empty_list 442

fclose 443

flisting 444

fopen 445

ground 446

integer 448

intersect 449

inttoatom 450

int_to_hex 447

is 451

is_list 452

I/O � 396

length 453

lowertoupper 454

member 455

name 456

nmember 458

nmembers 459

not 460

number 461

pointer 462

pointeroffset 463

pointertoatom 464

pointertoint 465

printf 466

Prolog �� 491

read 468

readln 469

realtoatom 472

real(�� �� ���) 471

real(�� ��) 470

reconsult 473

remove_dups 474

Prolog � (��)

retract 475

round 476

rremove 477

sort 478

sprintf 479

strip 482

subset 484

substring 485

subtract 486

term_type 487

union 488

write 489

* 404

+(���) 397

+(� �� ���) 412

- (pointer subtraction) 400

-(�� ��) 402

-(��) 403

-(� �� ��) 398

/ 405

// 406

= 415

=:= 416

== 420

=? 417

=\ 419

=\= 418

> 421

>= 422

\ 414

\== 411

@=\ 408

@> 409

@>= 410

@\ 407

Rrange float 361

range � 354

rbtargets ��� 16

read Prolog � 468

readln Prolog � 469

realtoatom Prolog � 472

real(�� �� ���) Prolog � 471

real(�� ��) Prolog � 470

reception_action 78

� 517

reconsult Prolog � 473

redo_action 79

redo_analysis � �� � 215

remove_bslashes � �� � 216

remove_dups Prolog � 474

reset_event_activity � �� � 217

reset_global_grp � �� � 218

resolve_time � �� � 219

RESPONSE �� 10

retract Prolog � 475

re_after_match � �� � 204

re_before_match � �� � 205

re_create � �� � 206

re_mark_as_modified � �� � 207

re_match � �� � 208

re_search_string � �� � 209

re_send_event_conf � �� � 210

re_split_event_id � �� � 211

re_substitute � �� � 213

re_substitute_global � �� � 214

rls �� 57

root.baroc �� 21, 51

round Prolog � 476

rpk �� 57

rremove Prolog � 477

Ssave_globals � �� � 221

search_cache � �� � 222

SendEvents ��� 257

server_handle �� 9, 10

server_path �� 9

server_path �� �� 211

Set �� 344

set_detailed_debugging � �� � 224

set_event_administrator � �� � 226

set_event_message � �� � 227

set_event_severity � �� � 230

set_event_status � �� � 231

set_global_var � �� � 232

set_log_error_source � �� � 233

set_timer � �� � 234

set_to �� 75

simple_type 45

sort Prolog � 478

sprintf Prolog � 479

startsWith � 366

String �� 344

stringset.areDisjoint 375

stringset.eq 374

stringset.intersect 376

stringset.isMemberOf 375

stringset.isSubsetOf 375

stringset.join 376

stringset.ne 374

stringset.previousValues 377

string.concat 367

string.contains 364

string.dayOfWeek 367

string.dayOfWeekString 368

string.endsWith 365

string.eq 362

string.existRuleId 368

string.ge 363

string.getEventType 369

string.gt 363

string.hourOfDay 369

string.iceq 365

string.icne 365

string.le 364

string.length 370

string.lt 363

string.month 370

string.monthString 371

string.ne 362

string.startsWith 366

string.substring 371

string.toLowerCase 372

string.toUpperCase 372

string.trim 372

strip Prolog � 482

subset Prolog � 484

substring Prolog � 485

substring � 371

subtract Prolog � 486

Ttecroot.xml �� 311

tecsce.dtd �� 311, 337

TECSummary �� 313

tec.baroc �� 21, 51

tec_agent_demo ��� 255

TEC_UMASK �� �� 36

term_type Prolog � 487

518 IBM Tivoli Enterprise Console: � �� ���

thresholdCount �� 319

timeInterval �� 319

timeIntervalMode �� 319

timeNow � 354

timer_duration �� 77

timer_info �� 76

timeSpan � 355

Tivoli Availability Intermediate Manager

� ��� �� 22

Tivoli Enterprise Console � ��

� �� �� 269

Tivoli Software Information Center xiv

toLowerCase � 372

toUpperCase � 372

trace ��� 80

trace_it � �� � 236

triggerMode �� 318

trim � 372

Uunion Prolog � 488

UNIX � ���� �� ��� �� 36

unlink_from_cause � �� � 237

update_event_activity � �� � 238

upgrade_gui.sh �� 269

user_predicates �� 490

UTF-8 � 337

UTF-8 �� 37, 52, 270

Wwhere �, ��� �� 73

wpostemsg �� 7, 255

wrb ��

� ��� �� �� 17

� ��� �� 19

��� ���� 14

wrbupgrade �� 15

write Prolog � 489

wtdumprl �� 6

XXML �� 311, 337

� ���!=(��� ��, �� ��) 348, 356, 362

#(� ��) 61

&& 377

* Prolog � 404

*(��� ��, "��) 351, 359

+(���) Prolog � 397

+(��� ��, ���) 350, 358

+(� �� ���) Prolog � 412

- (pointer subtraction) Prolog � 400

- (sign reversal) Prolog � 402

-(��) Prolog � 403

-(��� ��, ��) 351, 359

-(� �� ��) 398

.conf �� 210

.rbtargets ��� 16

.rls �� 57

.rpk �� 57

/ Prolog � 405

/ (��� ��, ���) 359

/(��� ��, ���) 351

/* */(� ��) 61, 388

// Prolog � 406

= Prolog � 415

=:= Prolog � 416

== Prolog � 420

== (��� ��, ��) 347

==(��� ��, ��) 355, 362, 373

=? Prolog � 417

=\ 419

=\= Prolog � 418

>(��� ��, �� �) 348, 356, 363

>= Prolog � 422

>=(��� �� ��) 357

>=(��� ��, ��) 349, 363

%(� ��) 61, 388

\ 414

\== Prolog � 411

@=\ 408

@> Prolog � 409

@>= Prolog � 410

@\ 407

_ ��� �� 70

_class outside ��� �� 72

_class within ��� �� 71

_class �� 70

_class ��� �� 70

� 519

_event �� 70

_(Prolog �� ��) 70

520 IBM Tivoli Enterprise Console: � �� ���

���

Printed in Denmark by IBM Danmark A/S

SA30-1983-00