Skip to content

sgaudart/centreon_consolidate_alerts

Repository files navigation

centreon_consolidate_alerts

Introduction

The script centreon_consolidate_alerts.pl is helpfull to generate reports on Centreon alerts, it will generate a SQL table with all the useful information for Centreon alerts

Technical specification

This script will read data from the 3 tables centeron_storage.logs + downtimes + acknownledgements in your desired time range [use option --start => --end].

The script will feed a new custom table [your_database].Alert where each entry in the table represents a Centreon alert. See info in the attached documentation table_Alert.pdf.

The conf file is used to populate the connection information for the database centreon_storage and your database for the Alert table.
NOTE: The --conf option is mandatory

Requirements

  • Accessibility to Centreon database
  • a new database with the SQL table Alert (see the file Alert.sql)
  • Perl
  • mysql client

Tested with...

  • Centreon 2.5.4
  • Perl v5.10.1

Roadmap

In construction...

Options

centreon_consolidate_alerts.pl --conf <conf_file.conf> : conf file
       [--start <DD-MM-YYYY>|<DD/MM>] default : start and end date is the last day
       [--end <DD-MM-YYYY>|<DD/MM>] default : start and end date is the last day
       [--verbose] [--debug]

Utilization

Launch the script (if you want data about the October month in the table Alert) :

# ./centreon_consolidate_alerts.pl --start 01/10 --end 01/11  --verbose --conf database_info.conf > centreon_consolidate_alerts.log

Performance

Example : for 780 alerts/day => 1 mn/day of work for the script to feed the table Alert.

Examples

TOP10 unavailability hosts with downtime supported (if your ping service is called 'ping') :

SELECT host_name, service_description, service_id, SUM( interpreted_duration ) AS tps_indispo
FROM Alert
WHERE service_description LIKE 'ping'
GROUP BY service_id
ORDER BY tps_indispo DESC
LIMIT 10

List of alerts with downtime(s) occured but which have been acknowledged :

SELECT * FROM `Alert` WHERE downtime_occurence > 0 and acknowledgement_id is NOT NULL

About

[CENTREON REQUIRED] consolidate information (ack, downtime, duration) about Centreon alerts for reporting purposes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages