Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

feat(core): centreon_health script to gather various data #7418

Merged
merged 1 commit into from
Apr 12, 2019

Conversation

adr-mo
Copy link
Contributor

@adr-mo adr-mo commented Apr 12, 2019

Pull Request Template

Description

Script that gathers various information useful for centreon diagnostic.
PR made from @Sims24 one (reworked a little bit)

Script to quickly gather an overall overview of centreon scope and parameters. Very helpfull when things goes bad. Easily extensible.

Cover following topics :

  • rrd
  • database
  • module
  • server
  • systems
  • broker
  • logs

Centreon version : More complete for 2.8.x, but also manage 2.7.x (el6 and el7).

Offers following output format :

  • MARKDOWN
  • JSON
  • TEXT
  • DUMPER (debug perl)

Only prerequiste is perl binding for SSH C lib and centreon_plugins for Linux (SNMP) :

  • el6
yum install libssh libssh-devel 
git clone https://github.com/garnier-quentin/perl-libssh
cd perl-libssh/
perl Makefile.PL
make && make install
  • el7
yum install perl-Libssh-Session-0.3-1.el7.centos.x86_64

Sample output below (skip logs for the sake of clarity) :

[root@centreon-centos7 centreon]# su - centreon -c "/usr/share/centreon/bin/centreon_health --output-format MARKDOWN --skip-logs"

CENTREON_HEALTH TEXT OUTPUT

CENTREON OVERVIEW

  • Centreon Version: 2.8.17
  • Number of pollers: 2
  • Number of hosts: 17
  • Number of services: 139
  • Number of metrics: 318
  • Number of modules: 4
  • Number of plugin-packs: 35
  • Number of recurrent downtimes: 0

AVERAGE METRICS

  • Host / poller (avg): 8
  • Service / poller (avg): 69
  • Service / host (avg): 8
  • Metrics / service (avg): 2

RRD INFORMATIONS

  • RRD not updated since more than 180 days: 0
  • RRD written during last 5 five minutes: 33
  • RRD files Count/Size in /var/lib/centreon/metrics/ directory: 251/95M
  • RRD files Count/Size in /var/lib/centreon/status/ directory: 140/47M

DATABASES INFORMATIONS

Databases size

  • Size of centreon_storage database: 856M
  • Size of centreon database: 8M

Tables size (centreon_storage db)

  • Size of log_archive_host table: 29M
  • Size of downtimes table: 96K
  • Size of data_bin table: 687M
  • Size of log_archive_service table: 36M
  • Size of logs table: 100M

Partitioning check

  • Last partition date for log_archive_host table: 01/14/2018 00:00:00
  • Last partition date for data_bin table: 01/14/2018 00:00:00
  • Last partition date for log_archive_service table: 01/14/2018 00:00:00
  • Last partition date for logs table: 01/14/2018 00:00:00

SQL Engine tuning variables

  • Variable innodb_file_per_table = ON
  • Variable join_buffer_size = 4M
  • Variable key_buffer_size = 256M
  • Variable max_allowed_packet = 64M
  • Variable open_files_limit = 32000
  • Variable read_buffer_size = 512K
  • Variable read_only = OFF
  • Variable read_rnd_buffer_size = 256K
  • Variable sort_buffer_size = 32M

MODULE INFORMATIONS

  • Module Centreon License Manager is installed. (Author: Centreon # Codename: centreon-license-manager # Version: 1.0.1)
  • Module Centreon Plugin Pack Manager is installed. (Author: Centreon # Codename: centreon-pp-manager # Version: 2.2.0)
  • Module Centreon Open Tickets is installed. (Author: Centreon Team # Codename: centreon-open-tickets # Version: 1.2.0)
  • Module Centreon Auto Discovery is installed. (Author: Centreon # Codename: centreon-autodiscovery-server # Version: 2.3.0)

CENTREON NODES INFORMATIONS

Central

Identity:

  • Engine (version): Centreon Engine (1.7.2)
  • IP Address (SSH port): 127.0.0.1 (22)
  • Localhost: YES
  • Running: YES
  • Start time: 11/09/2017 16:49:33
  • Last alive: 01/04/2018 09:16:51
  • Uptime: 1M 3w 4d 5h 58m 15s
  • Count Hosts/Services - (Last command check): 13/114 - (01/04/2018 09:16:50)

Engine stats:

  • Buffer Usage(In_Use): 0
  • Buffer Usage(Max_Used): 3
  • Buffer Usage(Total_Available): 4096
  • Host Actively Checked(Last_15_minutes): 13
  • Host Actively Checked(Last_5_minutes): 13
  • Host Actively Checked(Last_hour): 13
  • Host Actively Checked(Last_minute): 1
  • Host Check Execution Time(Average): 1.468
  • Host Check Execution Time(Max): 10.002
  • Host Check Execution Time(Min): 0.000
  • Host Check Latency(Average): 0.082
  • Host Check Latency(Max): 0.175
  • Host Check Latency(Min): 0.000
  • Hosts Status(Down): 2
  • Hosts Status(Unreachable): 0
  • Hosts Status(Up): 12
  • Service Actively Checked(Last_15_minutes): 98
  • Service Actively Checked(Last_5_minutes): 78
  • Service Actively Checked(Last_hour): 113
  • Service Actively Checked(Last_minute): 7
  • Service Check Execution Time(Average): 7.109
  • Service Check Execution Time(Max): 60.155
  • Service Check Execution Time(Min): 0.003
  • Service Check Latency(Average): 0.092
  • Service Check Latency(Max): 0.208
  • Service Check Latency(Min): 0.002
  • Services Status(Critical): 3
  • Services Status(OK): 63
  • Services Status(Unknown): 47
  • Services Status(Warning): 1

Broker stats:

File: central-broker-master-stats.json
  • Version: 3.0.8
  • State: connected
  • Event proecessing speed 2.9
  • Queued events: 0
  • Last connection attempts: 12/30/2017 13:43:41
  • Last connection success: 12/30/2017 13:43:41
File: central-module-master-stats.json
  • Version: 3.0.8
  • State: connected
  • Event proecessing speed 1.1875
  • Queued events: 540
  • Last connection attempts: 12/30/2017 13:44:40
  • Last connection success: 12/30/2017 13:44:40
File: central-rrd-master-stats.json
  • Version: 3.0.8
  • State: listening
  • Event proecessing speed 0
  • Queued events: 0
  • Last connection attempts: -1
  • Last connection success: -1

System stats:

  • CPU => OK: CPU Usage: Wait 0.84 %, Guest 0.00 %, User 4.88 %, Soft Irq 0.02 %, Kernel 0.00 %, Interrupt 0.00 %, Guest Nice 0.00 %, Idle 93.30 %, Steal 0.00 %, System 0.96 %, Nice 0.00 % |
  • LOAD => OK: Load average: 0.00, 0.05, 0.08 |
  • MEMORY => OK: Ram Total: 1.80 GB, Used (-buffers/cache): 799.33 MB (43.44%), Buffer: 0.00 B, Cached: 835.89 MB, Shared: 96.30 MB |
  • SWAP => OK: Swap Total: 600.00 MB Used: 43.91 MB (7.32%) Free: 556.08 MB (92.68%) |
  • STORAGE => OK: All storages are ok |
    Storage '/' Usage Total: 1.99 GB Used: 1.15 GB (57.88%) Free: 858.37 MB (42.12%)
    Storage '/usr' Usage Total: 3.99 GB Used: 2.67 GB (66.81%) Free: 1.32 GB (33.19%)
    Storage '/var/lib/mysql' Usage Total: 3.99 GB Used: 3.00 GB (75.14%) Free: 1015.75 MB (24.86%)
    Storage '/tmp' Usage Total: 1016.66 MB Used: 258.26 MB (25.40%) Free: 758.40 MB (74.60%)

Poller

Identity:

  • Engine (version): Centreon Engine (1.7.2)
  • IP Address (SSH port): 10.30.2.66 (22)
  • Localhost: NO
  • Running: YES
  • Start time: 10/03/2017 17:14:17
  • Last alive: 01/04/2018 09:16:48
  • Uptime: 3M 1d 9h 35m 22s
  • Count Hosts/Services - (Last command check): 4/25 - (01/04/2018 09:16:48)

Engine stats:

  • Buffer Usage(In_Use): 0
  • Buffer Usage(Max_Used): 0
  • Buffer Usage(Total_Available): 4096
  • Host Actively Checked(Last_15_minutes): 3
  • Host Actively Checked(Last_5_minutes): 2
  • Host Actively Checked(Last_hour): 3
  • Host Actively Checked(Last_minute): 0
  • Host Check Execution Time(Average): 0.057
  • Host Check Execution Time(Max): 0.085
  • Host Check Execution Time(Min): 0.005
  • Host Check Latency(Average): 0.143
  • Host Check Latency(Max): 0.182
  • Host Check Latency(Min): 0.073
  • Hosts Status(Down): 0
  • Hosts Status(Unreachable): 0
  • Hosts Status(Up): 3
  • Service Actively Checked(Last_15_minutes): 13
  • Service Actively Checked(Last_5_minutes): 10
  • Service Actively Checked(Last_hour): 13
  • Service Actively Checked(Last_minute): 0
  • Service Check Execution Time(Average): 0.153
  • Service Check Execution Time(Max): 0.305
  • Service Check Execution Time(Min): 0.020
  • Service Check Latency(Average): 0.084
  • Service Check Latency(Max): 0.192
  • Service Check Latency(Min): 0.002
  • Services Status(Critical): 0
  • Services Status(OK): 7
  • Services Status(Unknown): 6
  • Services Status(Warning): 0

Broker stats:

File: poller-module-stats.json
  • Version: 3.0.7
  • State: connected
  • Event proecessing speed 0.5
  • Queued events: 392
  • Last connection attempts: 12/30/2017 13:44:10
  • Last connection success: 12/30/2017 13:44:10

System stats:

  • CPU => OK: CPU Usage: Wait 0.00 %, Guest 0.00 %, User 1.26 %, Soft Irq 0.01 %, Kernel 0.00 %, Interrupt 0.00 %, Guest Nice 0.00 %, Idle 98.42 %, Steal 0.00 %, System 0.31 %, Nice 0.00 % |
  • LOAD => OK: Load average: 0.01, 0.05, 0.05 |
  • MEMORY => OK: Ram Total: 1.80 GB, Used (-buffers/cache): 299.58 MB (16.28%), Buffer: 948.00 KB, Cached: 502.29 MB, Shared: 96.45 MB |
  • SWAP => OK: Swap Total: 820.00 MB Used: 0.00 B (0.00%) Free: 820.00 MB (100.00%) |
  • STORAGE => OK: Storage '/' Total: 6.19 GB Used: 2.09 GB (33.87%) Free: 4.09 GB (66.13%) |
    Storage '/' Total: 6.19 GB Used: 2.09 GB (33.87%) Free: 4.09 GB (66.13%)

Type of change

  • New functionality (non-breaking change)

Target serie

  • 18.10.x
  • 19.04.x (master)

How this pull request can be tested ?

Execute the script and check that information returned are correct.

Checklist

Community contributors & Centreon team
  • I followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • [] I have made corresponding changes to the documentation.
  •  I have rebased my development branch on the base branch (master, maintenance).
Centreon team only
  • I have made sure that the unit tests related to the story are successful.
  • I have made sure that unit tests covers 80% of the code written for the story.
  • I have made sure that acceptance tests related to the story are successful (local and CI)

@adr-mo adr-mo merged commit 19ec23f into master Apr 12, 2019
@adr-mo adr-mo deleted the centreon-health branch April 12, 2019 09:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant