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
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
- Accessibility to Centreon database
- a new database with the SQL table Alert (see the file Alert.sql)
- Perl
- mysql client
- Centreon 2.5.4
- Perl v5.10.1
In construction...
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]
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
Example : for 780 alerts/day => 1 mn/day of work for the script to feed the table Alert.
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