0% found this document useful (0 votes)
77 views5 pages

Running EventStatsticsUtil To Understand How Events Are Stored in The OBM Database

The document discusses using the EventStatsticsUtil command to view how events are stored in the OBM database. It recommends running EventStatsticsUtil -a once a day to understand how the database is configured and monitor for performance issues over time. It also provides examples of scripts to automatically run the command and collect the output on Linux and Windows systems.

Uploaded by

Chandan Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views5 pages

Running EventStatsticsUtil To Understand How Events Are Stored in The OBM Database

The document discusses using the EventStatsticsUtil command to view how events are stored in the OBM database. It recommends running EventStatsticsUtil -a once a day to understand how the database is configured and monitor for performance issues over time. It also provides examples of scripts to automatically run the command and collect the output on Linux and Windows systems.

Uploaded by

Chandan Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Running EventStatsticsUtil to understand how events are

stored in the OBM database


Using EventStatsticsUtil to understand how events are stored in the OBM
database Operations Bridge Manager (OBM) All versions

06-Dec-2022•Knowledge

URL Name
KM000012187
Products
Operations Bridge Manager (OBM)
Article Body
Environment

Operations Bridge Manager (OBM) All versions


Situation

is there an Operations Bridge Command which can help me see how events are
stored in the database?
 
Resolution

EventStatsticsUtil is a valuable Support command.  It is a starting point for many performance


problems as it shows how events are structured in the database.  It indicates at a glance so much
about how the system is configured and if this is optimal.  More importantly, it’s a great way of
seeing how the system changes in terms of the event content and gives ideas around how events
can be managed.
 
Running EventStatsticsUtil -a once a day and storing the output helps.  The load on the system is not
particularly high but schedule running the command during a quieter period. 
 
EventStatsticsUtil –r rebuilds the databases index (please see Oracle/Postgres/MSSQL for more
information). 

Index fragmentation can be viewed by running EventStatsticsUtil -ic.  This shows indexes where
fragmentation is greater than 30%. No rebuild is made

Value of the data:


The data retuned is very useful (as in how many CMAs, how many history lines and so on) but also
knowing how long the command takes to run gives you an idea about database performance.  The
data and run times should not change too much over time unless more data sources have been
added.  Therefore if you noticed a trend where the time it takes to run the command increases
maybe this indicates the start of something which needs investigation further?  Please
see https://portal.microfocus.com/s/article/KM000012198  for more information.
 
How to collect EventStatisticsUtil data:
Please find below how you can collect and time this data for Linux and Windows:
  
Linux
Run crontab –e as the user which OBM is running with.  Add this line to the crontab if you want
this to run at 4am
* 4 * * * /path/to/CollectEventStatisticsUtil.sh

Naturally you can add a scheduled action to do the same which would proababally be the better
way to manage this as you can collect the results as an annotation.
 
In this example EventStatsticsUtil -a (all) is used which gives more information - choose
EventStatsticsUtil  -ic (index check) if concerned about the loading on the database.
 
Run using scheduled action and collect the output or redirect to file if needed.  Create a script
called CollectEventStatisticsUtil.sh which contains:
 
#!/bin/bash
# CollectEventStatisticsUtil.sh
DATE=$(date +%Y%m%d_%H%M%S)
(time /opt/HP/BSM/opr/support/EventStatisticsUtil.sh -a ) |&
tee /some/log/file/EventStatisticsUtil-a.$DATE
(time /opt/HP/BSM/opr/support/EventStatisticsUtil.sh –r ) |&
tee /some/log/file/EventStatisticsUtil-r.$DATE

There isn’t much error handing in the EventStatisticsUtil script –the EventStatisticsUtil.sh


finishes it always ends with exit 0 (at least that’s what I think).
 
Don’t forget to chmod +x the script.
 
 
 
Windows
Use the windows scheduler or add a scheduled action to do the same.  Don’t forget to redirect the
output into a file or as an annotation.
 
Please find below a simple example unsupported wrapper script to process run time:
runTime.cmd 
 
@echo off
rem runTime.cmd for CollectEventStatisticsUtil.bat
setlocal
call %1 %2
 
set ENDTIME=%TIME%
 
echo STARTTIME: %STARTTIME%
echo ENDTIME: %ENDTIME%
 
set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 +
(1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 +
(1%STARTTIME:~9,2%-100)
set /A ENDTIME=(1%ENDTIME:~0,2%-100)*360000 +
(1%ENDTIME:~3,2%-100)*6000 + (1%ENDTIME:~6,2%-100)*100 +
(1%ENDTIME:~9,2%-100)
set /A DURATION=%ENDTIME%-%STARTTIME%
 
if %ENDTIME% LSS %STARTTIME% set set /A DURATION=%STARTTIME%-
%ENDTIME%
 
set /A DURATIONH=%DURATION% / 360000
set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 -
%DURATIONM%*6000) / 100
set /A DURATIONHS=(%DURATION% - %DURATIONH%*360000 -
%DURATIONM%*6000 - %DURATIONS%*100)
 
if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH%
if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM%
if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS%
if %DURATIONHS% LSS 10 set DURATIONHS=0%DURATIONHS%
 
echo STARTTIME: %STARTTIME% centiseconds
echo ENDTIME: %ENDTIME% centiseconds
echo DURATION: %DURATION% in centiseconds
echo %DURATIONH%:%DURATIONM%:%DURATIONS%,%DURATIONHS%
endlocal
goto :EOF
 

Example running EventStatsticsUtil command to get the time taken:


C:\HPBSM\opr\support> runTime.cmd  EventStatisticsUtil.bat -ic
Initializing Hibernate connection to DB...
15 sec spent for Hibernate initialization
Table Name                    | Index Name                       | % Fragmented
all_events                    | indexoversequencenumber          | 66.67
all_events                    | indexovertimereveiced            | 66.67
marble_persist_2              | marble_persist_2_ix1             | 60.00
hi_change                     | idxhiovtimeciid                  | 57.14
cp_selected_items             | cp_selected_items_pkey           | 52.17
all_events                    | indexoverstate                   | 50.00
all_events                    | indexoversourceciid              | 50.00
all_events                    | indexovertimestatechanged        | 50.00
c001_cr_path_constraints      |
c001_cr_path_constraints_link_type_start_var_id_end_var_id_key| 44.44
c001_cr_symptoms              | c001_cr_symptoms_pkey            | 44.44
c000_cr_symptoms              | c000_cr_symptoms_pkey            | 44.44
c000_cr_path_constraints      |
c000_cr_path_constraints_link_type_start_var_id_end_var_id_key| 44.44
event_statistics              | event_statistics_pkey            | 42.86
all_events                    | indexoverrelatedciid             | 42.86
c001_cr_path_constraints      | c001_cr_path_constraints_pkey    | 40.00
cfg_parameter                 | constraint_94                    | 40.00
c000_cr_path_constraints      | c000_cr_path_constraints_pkey    | 40.00
history_line                  | history_line_pkey                | 33.33
cfg_template                  | constraint_5f                    | 33.33
cfg_templatefile              | constraint_124                   | 33.33
all_events                    | indexovercause                   | 33.33
cfg_templateversion           | constraint_49                    | 33.33
all_events                    | all_events_pkey                  | 33.33
cfg_templatefile              | templatever_idx1                 | 33.33
hi_change                     | hi_change_pkey                   | 33.33
cfg_templateversion           | template_idx                     | 33.33
marble_persist_1              | marble_persist_1_pkey            | 33.33
cfg_at_aspvers_tmplvers       | aspectver_idx1                   | 33.33
cfg_at_aspvers_tmplvers       | ataspvertmplvertmplversionid     | 33.33
marble_persist_2              | marble_persist_2_pkey            | 33.33
c001_cr_variables             | c001_cr_variables_pkey           | 33.33
c000_correlation_rules        | c000_correlation_rules_pkey      | 33.33
databasechangelog             | pk_databasechangelog             | 33.33
history_line                  | histlinetimechangedindex         | 33.33
cfg_template                  | constraint_index_5f              | 33.33
c000_cr_variables             | c000_cr_variables_pkey           | 33.33
c001_correlation_rules        | c001_correlation_rules_pkey      | 33.33
cfg_parameter                 | aspectversion_idx                | 33.33
oas_permission_to_role        |
oas_permission_to_role_role_id_resource_key_operation_key_key| 33.33
hi_change                     | idxhiovtime                      | 33.33
STARTTIME: 10:37:23.33
ENDTIME: 10:37:45.78
STARTTIME: 3824333 centiseconds
ENDTIME: 3826578 centiseconds
DURATION: 2245 in centiseconds
00:00:22,45

Further options would be to create metrics from these values and store in the embedded
performance database by using opcmon.  This means you can plot the values in Performance
Dashboard and create alerts if database starts to exceed a threshold.
Document Type
Knowledge
Article Total View Count
65
Article Created Date
22/11/2022 09:59
Last Published Date
06/12/2022 20:59
Title
Running EventStatsticsUtil to understand how events are stored in the OBM
database
Summary
Briefly describe the article.
Using EventStatsticsUtil to understand how events are stored in the OBM
database Operations Bridge Manager (OBM) All versions
Owner
Duncan Wood

You might also like