centreon-en Logo
      • Home
      • Recently active topics
      • Unanswered questions
      • Centreon Forums
      • Platform164
      • Data collection41
      • Data usage and Visualization24
      • Contribution and Development5
      • About the Community
      • Latest News10
      • Community Requests & Feedback3
      • The Watch User Guides6
      • Knowledge base
      • Getting Started
      • General information5
      • First steps with Centreon3
      • Getting Helped
      • Product How-To28
      • Troubleshooting11
      • Webinars & Tutorials
      • Webinars replays8
      • Videos tutorials11
  • Events
  • Groups
Logo

Do you have ideas about which feature should be added to Centreon? Tell us here!

Fabrix
3 months ago

Knowledge Base

Find relevant and complete information about Centreon platform.

Getting Started

  • 2 Categories
  • 8 Articles

Getting Helped

  • 2 Categories
  • 39 Articles

Webinars & Tutorials

  • 2 Categories
  • 19 Articles

Product How-To

Monitoring AWS with Centreon

In this tutorial, we'll describe how Centreon can monitor the resources you're deploying into the Amazon Web Services cloud platform.Example of AWS Architecture - Copyright AWS Inc. The Centreon solution includes multiple plugins to monitor AWS: one plugin per AWS service. At the time of writing, the following AWS services are included in the Centreon Plugin Library:Billing Cloudfront Cloudwatch EBS Elasticache ELB Lambda RDS S3Centreon's Plugin Pack functionality, which facilitates configuring these plugins by providing ready-to-use Host Templates and Service Templates, are included in both Centreon IMP and Centreon EMS. Be sure to check the Centreon Documentation or the Integration page of our website to get the most up to date list of supported Plugin Packs.ln this tutorial, we'll use the following example: how do we monitor an AWS EC2 virtual machine?We will first explain how Centreon connects to the Amazon CloudWatch service to collect metrics. We will then install the AWS EC2 Plugin and test it from the Command Line Interface to better understand how it's working. Finally, we'll explain how to use the Plugin Pack and easily start monitoring. 1. AWS API credentials and Amazon CloudWatch serviceAWS provides a Rest API for all its cloud services. There is one API access per Amazon Region.For the Centreon plugins to connect and authenticate with this API, an Access Key, consisting of an access key ID and a secret access key is needed. This AWS IAM documentation gives information about how to use the Identity and Access Management service to create the required credentials such as:Amazon Region name (eg 'us-east-2') Secret Key Access Key AWS includes its own monitoring service: CloudWatch. CloudWatch is a free service (for basic use) that collects performance metrics for all of your AWS resources. CloudWatch comes with its own API that Centreon plugins will query every five minutes. The free package allows up to 1 million requests per month, which should be plenty.Please refer to the Amazon CloudWatch documentation for further information. 2. Installing and testing the AWS EC2 Centreon PluginPrerequisitesThe Centreon AWS monitoring plugins require either the Perl paws library or the awscli command line to connect to the AWS Rest API. In this tutorial, we will use the awscli tool which we will install alongside the plugin.Plugin InstallationThe Centreon AWS plugins are open source. The Git repository can be found under the project centreon-plugins. To install the EC2 plugin, please use the packages provided by Centreon on a CentOS/RedHat 7.x operating system. This should be done on the poller that accesses the AWS API.# yum install centreon-plugin-Cloud-Aws-Ec2-Api.noarch awscli Testing the PluginIt's always a good practice to test the plugin from the CLI, at the minimum to verify our credentials grant access to the API. Please perform various tests to validate the proper operation of this plugin and to know more about its functionalities.Please note that by default the plugin collects the average usage of your resources. But it's also possible to get the minimum and maximum usage of your resources by using the --statistic option. For example, to get both the average and minimum usage metrics, you must add the following option in your command line:--statistic=average --statistic=minimum Test 1 - Get the EC2 instance list$ /usr/lib/centreon/plugins/centreon_aws_ec2_api.pl --plugin=cloud::aws::ec2::plugin --custommode=awscli --region=eu-west-1 --aws-secret-key='cgDbAaBKpGSYphr8+RiWcvXAf3Y7QpT' --aws-access-key='AKIAIAHAQ7FJ7C3Q' --mode=list-instances List instances: [Name = i-f15afe17][AvailabilityZone = us-east-2b][InstanceType = t2.small][State = running][Tags = centreon-support][Name = i-06717f4d0eee337af][AvailabilityZone = us-east-2b][InstanceType = t2.micro][State = stopped][Tags = centreon-poc-ha-poller] Test 2 - Check EC2 instance statusFor this check, we need to give the name of the EC2 instance with the --name option.$ /usr/lib/centreon/plugins/centreon_aws_ec2_api.pl --plugin=cloud::aws::ec2::plugin --custommode=awscli --region=eu-west-1 --aws-secret-key='cgDbAaBKpGSYphr8+RiWcvXAf3Y7QpT' --aws-access-key='AKIAIAHAQ7FJ7C3Q' --mode=status --type=instance --name=i-f15afe17 --critical-status='%{status} =~ /failed/i'OK: Instance 'i-f15afe17' StatusCheckFailed_Instance: passed, StatusCheckFailed_System: passed  Test 3 - Check all CPU metrics of EC2 instanceSpecify the name of the EC2 instance with the --name option.$ /usr/lib/centreon/plugins/centreon_aws_ec2_api.pl --plugin=cloud::aws::ec2::plugin --custommode=awscli --region=eu-west-1 --aws-secret-key='cgDbAaBKpGSYphr8+RiWcvXAf3Y7QpT' --aws-access-key='AKIAIAHAQ7FJ7C3Q' --mode=cpu --type=instance --name=i-f15afe17 OK: Instance 'i-f15afe17' average CPUCreditBalance: 288.00, CPUCreditUsage: 0.02, CPUSurplusCreditBalance: 0.00, CPUSurplusCreditsCharged: 0.00, CPUUtilization: 0.37 % | 'cpucreditbalance_average'=288.00;;;; 'cpucreditusage_average'=0.02;;;; 'cpusurpluscreditbalance_average'=0.00;;;; 'cpusurpluscreditscharged_average'=0.00;;;; 'cpuutilization_average'=0.37%;;;;Here is a short description of each metric (More details in this AWS documentation):Metric Description cpucreditbalance The number of earned CPU credits that an instance has accrued since it was launched or started. cpucreditusage The number of CPU credits spent by the instance for CPU utilization. cpusurpluscreditbalance The number of surplus credits that have been spent by an unlimited instance when its CPUCreditBalance value is zero. cpusurpluscreditscharged The number of spent surplus credits that are not paid down by earned CPU credits, and which, then incur an additional charge. cpuutilization The percentage of allocated EC2 compute units that are currently in use on the instance.  Test 4  - Check AWS EC2 network metricsSpecify the name of the EC2 instance with --name option.$ /usr/lib/centreon/plugins/centreon_aws_ec2_api.pl --plugin=cloud::aws::ec2::plugin --custommode=awscli --region=eu-west-1 --aws-secret-key='cgDbAaBKpGSYphr8+RiWcvXAf3Y7QpT' --aws-access-key='AKIAIAHAQ7FJ7C3Q' --mode=network --type=instance --name=i-f15afe17 OK: Instance 'i-f15afe17' average NetworkIn: 39.90KB, NetworkOut: 40.59KB, NetworkPacketsIn: 123.00 packets, NetworkPacketsOut: 117.40 packets | 'networkin_average'=40858.40B;;;; 'networkout_average'=41559.40B;;;; 'networkpacketsin_average'=123.00packets;;;; 'networkpacketsout_average'=117.40packets;;;;Here is a short description of each metric (more details in this AWS documentation)Metric Description networkin The number of bytes received on all network interfaces by the instance. networkout The number of bytes sent out on all network interfaces by the instance. networkpacketsin The number of packets received on all network interfaces by the instance. networkpacketsout The number of packets sent out on all network interfaces by the instance.  Test 5 - Check AWS EC2 disk metricsSpecify the name of the EC2 instance with the --name option.$ /usr/lib/centreon/plugins/centreon_aws_ec2_api.pl --plugin=cloud::aws::ec2::plugin --custommode=awscli --region=eu-west-1 --aws-secret-key='cgDbAaBKpGSYphr8+RiWcvXAf3Y7QpT' --aws-access-key='AKIAIAHAQ7FJ7C3Q' --mode=diskio --type=instance --name=i-f15afe17OK: Instance 'i-f15afe17' average DiskReadBytes: 0.00B, DiskWriteBytes: 0.00B, DiskReadOps: 0.00 ops, DiskWriteOps: 0.00 ops | 'diskreadbytes_average'=0.00B;;;; 'diskwritebytes_average'=0.00B;;;; 'diskreadops_average'=0.00ops;;;; 'diskwriteops_average'=0.00ops;;;;Here is a short description of each metric (More detail this AWS documentation):Metric Description diskreadbytes Bytes read from all instance store volumes available to the instance. diskwritebytes Bytes written to all instance store volumes available to the instance. diskreadops Completed read operations from all instance store volumes available to the instance in a specified period of time. diskwriteops Completed write operations to all instance store volumes available to the instance in a specified period of time.  3. Installing and using the AWS EC2 Centreon Plugin PackPlugin Packs Manager is the name of the Centreon user interface by which you can list, download and update from our 300+ (and counting) Centreon Plugin Packs.Read the Centreon Plugin Packs documentation to install the latest Plugin Packs if your platform is offlineFrom the Configuration > Plugin Packs > Manager user interface, search for aws:On the Centreon Plugin Pack Manager user interface:Install the  AWS EC2 pack by clicking on the + button As usual, the ? button will automatically redirect to the relevant Monitoring Procedure, including how to install the relevant Plugin.If the installation has been completed properly, you should find the host template Cloud-Aws-Ec2-Instance-Custom in the Configuration > Hosts > Templates menu.To monitor our AWS EC2 instance, we need to create a new host in Centreon with the following parameters:IP Address / DNS: localhost Host Template: Cloud-Aws-EC2-Instance-custom; Macros AWSSECRETKEY, AWSACCESSKEY and AWSREGION: your AWS API credentials Macro AWSINSTANCENAME: your instance name (eg i-f15afe17) Make sure you check the option to Create Services linked to the Template too: this will automatically create and configure the 5 Services defined by the Service Templates included in the Plugin Pack: Cloud-Aws-Ec2-Cpu-Credit-Api for CPU credits usage metrics Cloud-Aws-Ec2-Cpu-Usage-Api for CPU usage metrics Cloud-Aws-Ec2-Diskio-Api for disks I/O utilization metrics Cloud-Aws-Ec2-Network-Api for network usage metrics Cloud-Aws-Ec2-Status-API for internal checks status metrics You are now ready to generate the configuration, export it and send it to the Poller:Follow the two steps of the Deploying Configuration procedure  in the Centreon documentation.You are now able to verify Centreon is collecting metrics for your EC2 instance in the  Monitoring> Status Details> Hosts user interface:Done! Your Centreon platform is now monitoring your AWS EC2 virtual machine.Tip : the Configuration > Hosts > Templates user interface lets you modify the Cloud-Aws-Ec2-Instance-Custom template to save the credentials in the relevant macro. You are also able to create one such template by AWS Region. 4. What's next?From there on, you can start using the Centreon AWS Plugin Packs and plugins to monitor your complete AWS infrastructure. You will now be able to build your infrastructure and applications by using the following tools: Center for Dashboards, MAP for graphical dashboards and MBI for weekly and monthly analytics reports. Real-time AWS infrastructure monitoring with Centreon MAP Visit our Plugin Packs Library!  300+ standard industry IT domains already addressed: networks, servers, applications, storage, database, devices, equipment, etc. - physical, virtual and hybrid infrastructures.

sims24
Forum|Forum|6 months ago
590

Connecting Centreon and PagerDuty: Configuration Tips

A while back, we discussed the benefits of connecting PagerDuty and Centreon. Many of you wanted to learn more on this configuration, to get optimal results. So here they are, our best tips for you to happily connect PagerDuty with your favorite monitoring solution. Before we dive in, two important things to remember1. What is PagerDuty?PagerDuty  is an incident management software. It is shipped with basic features such as acknowledging and closing alerts.The SaaS platform lets you compile alerts from many different systems thanks to over 375 connectors which integrate with your other services and tools, including Centreon. The PagerDuty platform is AI-enabled for greater automation and predictability. 2. What is a Stream ConnectorA Stream Connector sends monitoring data to any external tool that can receive data. As each tool serves its own purpose, data needs to come in a dedicated format. This is the function of a Stream Connector, formatting and transmitting data, including metrics and events.What’s the point of connecting Centreon to PagerDuty?Centreon provides a dedicated Stream Connector that sends alerts to PagerDuty. Monitoring alerts become incidents in PagerDuty.Now that we’ve refreshed you on the basics, we can move on to the central question: Why would you want to connect Centreon to PagerDuty? (Aside from bragging rights, that is.)Connecting those tools brings three distinct advantages. Enrich alerts with reliable and exhaustive data Because Centreon enables holistic visibility over the IT estate, you can integrate reliable and exhaustive data. Frictionless integration Our stream connector makes implementation a breeze so there’s no wasted time in exchanging data. Agility and scalability Integrating Centreon with PagerDuty promotes the agility and scalability of your IT monitoring system and helps bridge IT and business visibility needs.The Stream Connector is a central element to issue monitoring events. Monitoring alerts then become incidents within PagerDuty. Configuring PagerDuty: Configure a service for incidents1. Go to the Services > Service directory menu.2. Add a new service (or use an existing one): 3. Follow the Name, Assign and Alert Grouping steps and configure them according to your needs.4. During the  integration step, select the Centreon integration.5. When done, do not forget to retrieve your integration key. It will be used by the stream connector to communicate with PagerDuty.Configure Centreon Stream connector installation1. Connect to your Centreon central server through SSH with a root user.2. Install the needed dependencies:yum install -y lua-curl epel-release make gcc3. Install the lua packet manager called luarocks:yum install luarocks4. Install the needed lua modules:luarocks install centreon-stream-connectors-libluarocks install luatz5. Download the Stream Connector:wget -O /usr/share/centreon-broker/lua/pagerduty-events-apiv2.lua https://raw.githubusercontent.com/centreon/centreon-stream-connector-scripts/master/centreon-certified/pagerduty/pagerduty-events-apiv2.lua6. Configure the right permissionschmod 644 /usr/share/centreon-broker/lua/pagerduty-events-apiv2.luaStream connector configuration1. Connect to the web interface with an admin account.2. Go to Configuration > Pollers and select Broker Configuration.3. Click on the central-broker-master broker configuration.4. Go to the Output tab.5. Add a new Generic- Stream connector output.6. Give it a name.7. Set up the stream connector path /usr/share/centreon-broker/lua/pagerduty-events-apiv2.lua.8. Add a new string parameter called pdy_routing_key with the integration key as a value.9. Add a new string parameter called pdy_centreon_url with the address of your Centreon central server as a value:10. Save your configuration.11. Go to the Configuration > Pollers menu and select Pollers.12. Select the Central poller.13. Click the Export configuration button.14. Tick the 4 first checkboxes.15. Click the Export button.Your Centreon is now ready to send alerts to PagerDuty. Alerts journey from Centreon to PagerDutyThe beginning: CentreonNow that everything is set up, let’s get a closer look at an alert journey. Below, our host Blog-server is monitored by Centreon. An alert is up on the Info service.Transmission : the Stream ConnectorBy increasing the logging verbosity level of the Stream Connector logs, we get the following information:INFO: [EventQueue:send_data]: Going to send the following json {"dedup_key":"20_H","payload":{"component":"Blog-server","group":"technical-content","summary":"Blog-server: CRITICAL: Cooling fluid leak detected","class":"service","severity":"High","timestamp":"2021-10-07T12:36:23.000","custom_details":{"Hostgroups":"technical-content"},"source":"Blog-server"},"event_action":"trigger","client":"Centreon Stream Connector","routing_key":"XXXXXXXXXXXXXXX","links":[{"href":"http://10.25.11.14/centreon/main.php?p=20202&o=hd&host_name=Blog-server","text":"Link to Centreon host summary"}]}In its standard working level, we notice that the Stream Connector creates a dedicated JSON for PagerDuty. Then the JSON file is sent to PagerDuty.The end: PagerDutyOn the PagerDuty side, we can observe our alerts.More details are available when clicking on the incident, such as the incident timeline as seen by PagerDuty.An incident will be automatically resolved in PagerDuty when the corresponding service will turn into an OK state in Centreon, thanks to the Stream Connector.Here is the timeline as seen by Centreon.Learn moreThe Stream Connector offers numerous options to customize which alerts to send to PagerDuty and how this will get done. You will find every possible information in the dedicated documentation.  Centreon Support does not actively maintain knowledge articles. If you have questions or require assistance with an article, please create a case or post a comment below.

sims24
Forum|Forum|6 months ago
820

Monitoring Microsoft Office 365 with Centreon

In this tutorial, we'll show how Centreon can monitor Office 365 online services.Office 365 is a line of online subscription services offered by Microsoft in their Microsoft Office product suite. Office 365 covers document creation and management, emailing, video conferencing and many more collaboration offerings. Already one of the most widely spread office productivity suites, it is still enjoying a high adoption rate.In this article, we'll demonstrate how Centreon plugins and Plugin Packs can monitor the usage of each service in the Office 365 suite. As usual with mature SaaS solutions, it is not so much the service availability that matters: after all, we can trust the highly redundant Microsoft Azure cloud infrastructure will guarantee an excellent service level availability (but don't worry, we'll still check, we've got your back). What matters most is the cost of the service, which explains why we'll first and foremost monitor the usage and consumption of each service. This includes:How much space is used by the Exchange mailboxes, and in particular the storage volume of inactive mailboxes. How much the OneDrive storage space growing How many SharePoint intranet sites are created and how many of the pages are viewed How many active and inactive Skype or Teams users each month and of those users, which service they useIt's important to track this information for efficiency. Microsoft makes all this information available through the Office 365 management API. With this in mind, the first step is to authorize Centreon to access this API.1. Authorizing Centreon to access Office 365 management APIThe authorize this first step, please register Centreon in the Azure Active Directory and configure its application rights to grant API access. Follow this Microsoft tutorial to register your Centreon application and get a client identifier (Client ID) and its associated secret (Client Secret).Once you've got your Client ID and Client Secret, you're ready to use Centreon plugins and Plugin Packs dedicated to Office 365 monitoring. Please note that you will also need your Azure Tenant ID, which uniquely identifies your organization within the multi-tenant Office 365 SaaS service.This diagram shows the Office 365 management API authorization and access flow. 2. Installing and testing Office 365 Centreon pluginsOffice 365 services are monitored by the centreon-plugin-Cloud-Microsoft-Office365-* plugins. Tasks available on the Centreon standard repository help our users:To monitor the availability of all services and their functionalities:centreon-plugin-Cloud-Microsoft-Office365-Management-ApiTo monitor the usage of each service:centreon-plugin-Cloud-Microsoft-Office365-Exchange-Api centreon-plugin-Cloud-Microsoft-Office365-Onedrive-Api centreon-plugin-Cloud-Microsoft-Office365-Sharepoint-Api centreon-plugin-Cloud-Microsoft-Office365-Skype-Api centreon-plugin-Cloud-Microsoft-Office365-Teams-ApiThese six plugins must be installed on the Poller that will access the API. Use the standard CentOS/RedHat yum command:yum install centreon-plugin-Cloud-Microsoft-Office365-*yum install centreon-plugin-Cloud-Microsoft-Office365-*Installing these six plugins will also automatically install the following Perl dependencies:JSON::XSText::CSVDateTimeDigest::MD5Digest::SHALWP::UserAgentLWP::Protocol::httpsIO::Socket::SSLURIEncodeHTTP::ProxyPACYou're now ready to use the plugins.It is a good practice to test the plugins with command lines and verify Centreon can connect to the Office 365 management API. Use your own Tenant ID, Client ID and Client Secret in the command line parameters below.Let's start by verifying the availability of all Office 365 services with the centreon-plugin-Cloud-Microsoft-Office365-Management-Api plugin:/usr/lib/centreon/plugins//centreon_office365_management_api.pl --plugin=cloud::microsoft::office365::management::plugin --mode=service-status --custommode='managementapi' --tenant='b3dd23de-593f3cfe-4d741212-bcf9-f035c1a2eb24' --client-id='76f82731-073b-4eb2-9228-901d252d2cb6-1b0d' --client-secret='9/kRTASjPoy9FJfQZg6iznXAkzCGertBgNq5r3tPfECJfKxj6zA='You may filter this command to get information about a single service, say Exchange for example, using the --filter-service-name parameter:/usr/lib/centreon/plugins//centreon_office365_management_api.pl--plugin=cloud::microsoft::office365::management::plugin--mode=service-status --custommode='managementapi'--tenant='b3dd23de-593f3cfe-4d741212-bcf9-f035c1a2eb24'--client-id='76f82731-073b-4eb2-9228-901d252d2cb6-1b0d'--client-secret='9/kRTASjPoy9FJfQZg6iznXAkzCGertBgNq5r3tPfECJfKxj6zA='--verbose --filter-service-name='Exchange Online'--filter-feature-name='' --warning-status=''--critical-status='%{status} !~ /Normal/i'OK: Service 'Exchange Online' Status is 'Normal service' - All featuresstatus are ok |Checking service 'Exchange Online'Status is 'Normal service'Feature 'E-Mail and calendar access' Status is 'Normal service'Feature 'E-Mail timely delivery' Status is 'Normal service'Feature 'Management and Provisioning' Status is 'Normal service'Feature 'Sign-in' Status is 'Normal service'Feature 'Voice mail' Status is 'Normal service'Let's continue now with the other five plugins.Counting active mailboxes:/usr/lib/centreon/plugins//centreon_office365_exchange_api.pl --plugin=cloud::microsoft::office365::exchange::plugin --mode=email-activity --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='OK: Active mailboxes on 2019-03-10 : 141/1532 (9.20%) - Total (active mailboxes) Send Count: 9478, Receive Count: 62197, Read Count: 24401 | 'active_mailboxes'=141mailboxes;;;0;1532 'total_send_count'=9478;;;0; 'total_receive_count'=62197;;;0; 'total_read_count'=24401;;;0;Counting active SharePoint sites:/usr/lib/centreon/plugins//centreon_office365_sharepoint_api.pl --plugin=cloud::microsoft::office365::sharepoint::plugin --mode=site-usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='OK: Active sites on 2019-03-10 : 31/223 (13.90%) - Total Usage (active sites): 894.19 GB, Usage (inactive sites): 39.96 GB, File Count (active sites): 484988, Active File Count (active sites): 25216, Visited Page Count (active sites): 2100, Page View Count (active sites): 63313 | 'active_sites'=31sites;;;0;223 'storage_used_active'=960124526467B;;;0; 'storage_used_inactive'=42908489124B;;;0; 'total_file_count'=484988;;;0; 'total_active_file_count'=25216;;;0; 'total_visited_page_count'=2100;;;0; 'total_page_view_count'=63313;;;0;Counting OneDrive active sites and files:/usr/lib/centreon/plugins//centreon_office365_onedrive_api.pl --plugin=cloud::microsoft::office365::onedrive::plugin --mode=usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='OK: Active sites on 2019-03-10 : 22/6999 (0.31%) - Total Usage (active sites): 329.71 GB, Usage (inactive sites): 1.32 TB, File Count (active sites): 86072, Active File Count (active sites): 564 | 'active_sites'=22sites;;;0;6999 'storage_used_active'=354024695212B;;;0; 'storage_used_inactive'=1456160306142B;;;0; 'total_file_count'=86072;;;0; 'total_active_file_count'=564;;;0;-bash-4.2$Counting devices that are connected to Skype:/usr/lib/centreon/plugins//centreon_office365_skype_api.pl --plugin=cloud::microsoft::office365::skype::plugin --mode=devices-usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='OK: Active users on 2019-03-10 : 0/11110 (0.00%) - Users count by device type : Windows: 0, iPad: 0, iPhone: 0, Android Phone: 0, Windows Phone: 0 | 'active_users'=0users;;;0;11110 'windows'=0;;;0; 'ipad'=0;;;0; 'iphone'=0;;;0; 'android_phone'=0;;;0; 'windows_phone'=0;;;0;Counting devices that are connected to Teams:/usr/lib/centreon/plugins//centreon_office365_teams_api.pl --plugin=cloud::microsoft::office365::teams::plugin --mode=devices-usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='OK: Active users on 2019-03-10 : 11/11154 (0.10%) - Users count by device type : Windows: 10, Mac: 0, Web: 3, iOS: 2, Android Phone: 0, Windows Phone: 0 | 'active_users'=11users;;;0;11154 'windows'=10;;;0; 'mac'=0;;;0; 'web'=3;;;0; 'ios'=2;;;0; 'android_phone'=0;;;0; 'windows_phone'=0;;;0;Great! Your plugins are installed and can connect to the Office 365 management API. It's now time to start monitoring. 3. Installing and monitoring with Office 365 Plugin PacksPlugin Pack Manager is the name of the Centreon user interface to list, download and update over 300 Plugin Packs.Read the Centreon Plugin Packs documentation to install the latest Plugin Packs if your platform is offline.From the Configuration > Plugin Packs > Manager user interface, search for Office:Install each Plugin Pack to get the Host configuration templates:Cloud-Microsoft-Office365-Management-Api-Custom Cloud-Microsoft-Office365-Exchange-Api-Custom Cloud-Microsoft-Office365-Onedrive-Api-Custom Cloud-Microsoft-Office365-Sharepoint-Api-Custom Cloud-Microsoft-Office365-Skype-Api-Custom Cloud-Microsoft-Office365-Teams-Api-CustomThis will also install the associated Service configuration templates.Add a new Host which IP Address / DNS parameter is localhost and add these Host Templates to it. Make sure you check the option to Create Services linked to the Template too: this will automatically create and configure the Services defined by the associated Service Templates. You will need to fill in your Office 365 management API credentials into the relevant Macro:OFFICE365TENANT : Tenant ID OFFICE365CLIENTID : Client ID OFFICE365CLIENTSECRET : Client SecretYou are now ready to generate the configuration, export it and send it to the Poller.Follow the two steps of the Deploying Configuration procedure in the Centreon documentation.Done! You are now monitoring the availability of the Office 365 services, their usage and consumption. 4. Detailing the metrics Centreon is monitoringData collected and monitored by the Office 365 Host and Service configuration templates installed with the Plugin Packs is listed in the following tables. Exchange :Metric Name Description active_mailboxes Total active mailboxes (Percentage) total_read_count Read emails (count) total_receive_count Received emails (count) total_send_count Sent emails (count) storage_used_active Storage used by active mailboxes (bytes, Gbytes) storage_used_inactive Storage used by inactive mailboxes (bytes, Gbytes)  OneDrive :Metric Name Description active_sites Active sites count (count, percentage) storage_used_active Storage used by active sites (bytes, Gbytes) storage_used_inactive Storage used by inactive sites (bytes, Gbytes) total_file_count Total file count (count) total_active_file_count Total active file count (count)  SharePoint :Metric Name Description active_sites Active sites count (count, percentage) storage_used_active Storage used by active sites (bytes, Gbytes) storage_used_inactive Storage used by inactive sites (bytes, Gbytes) total_file_count Total file count (count) total_active_file_count Total active file count (count) total_visited_page_count Total visited pages (count) total_page_view_count Total viewed pages (count) active_users Total active users (count, percentage) total_viewed_edited_file_count Total edited files (count) total_synced_file_count Total synchonized files (count) total_shared_int_file_count Total shared files (count) total_shared_ext_file_count Total shared files to external users (count)  Skype :Metric Name Description active_users Active users (count, percentage) windows Windows devices connected (count) ipad iPad connected (count) iphone iPhone connected (count) android_phone Android devices connected (count) windows_phone Windows phone connected (count) total_peer_to_peer_sessions Active sessions (count) total_organized_conference Planned Videoconferences (count) total_participated_conference Completed Videoconferences (count)  Teams :Metric Name Description active_users  Active users (count, percentage) windows Windows devices connected (count) mac Macintosh devices connected (count) web Web browser connection (count) ios iOS devices connected (count) android_phone Android devices connected (count) windows_phone Windows Phone devices connected (count) total_team_chat Collaborative Chat sessions (count) total_private_chat Private Chat sessions (count) total_call Total Calls (count) total_meeting Total Meetings (count)  5. See & Share monitoring information: it's your time to be creativeCentreon EMS includes two different tools to visualize and share monitoring information:Custom Views are widget-based dashboards that teams in charge of maintaining services, unified communications and infrastructure in Operational Conditions leverage or custom-build to their exact needs MAPs are draw-it-yourself graphical views used to easily share relevant information with all stakeholdersIt's your time to be creative! Start by adding Office 365 services availability information into your existing high-level MAP cockpit view that summarize the overall IT service and infrastructure health. You may then create a dedicated Office 365 Custom View to monitor service usage and consumption KPIs and proactively anticipate any capacity shortage.Office 365 monitoring dashboard in Centreon. Your turn to play with CentreonDownload Centreon to trial our do-it-yourself or end-to-end hybrid monitoring platform. Check our tutorials catalog including: Monitoring Microsoft Azure, Monitoring VMware and more. Join our Slack community to be a part of the dialog and exchange

sims24
Forum|Forum|6 months ago
1320

Seamless collaboration: Send Centreon notifications in Microsoft Teams rooms

Over the last few months, Microsoft Teams has become one of the leading collaborative platforms, with a range of services from video conferencing to instant messaging and many other features that facilitate the daily work of ITOps (the focus for this blog), as it does for other users in many other industries. In particular, Microsoft Teams lets you set up teams and channels. Team members thus access the content and tools they need to collaborate, including Slack-like discussion threads, a familiar platform for ITOps. In this blog post, we’ll see how you can send and display Centreon alerts using Microsoft Teams messaging functionalities.  What's a notification Plugin? A notification Plugin is a piece of code connecting prominent Centreon features (Contact, Notification rules, Escalations, etc.) and third-party technologies, communication, or alerting software. Centreon offers a range of possibilities in that area, for example, you can send SMS notifications through OVH, Slack, or Telegram. Here, we will show you how to use the Teams notification Plugin.  How Centreon notifications work  - A refresherThe integration is based on the mail notification system, natively included within Centreon and follows the same principles: The scheduler (a.k.a. the Centreon engine) triggers a notification Command when an event or a metric reaches a certain threshold.  IMPORTANT: A notification Command needs to be first configured within Centreon for the scheduler to run it using the right parameters (binary path, information to be included in the notification, etc.). Notification commands are associated with a Centreon user whom you choose to notify explicitly using a plugin, in this instance, the Teams notification Plugin. You need to define a Centreon Contact for this specific Command definition.  This Centreon Contact must be linked to the monitoring assets to receive notifications (Hosts, Services, Business Activities). Configure Microsoft TeamsTo allow Centreon to send an alert in a Teams channel, you must configure an Incoming Webhook in your workspace. You can achieve this by clicking on the (...) in your Team workspace and search for the 'Incoming Webhook' application: Note: You can also configure this at the channel level using the same (...) shortcut.Associate your application with a Team:Pick the team and get to the next step to set up the connector: Give a name to your application and personalize the look and feel if you want to: Once finished, click on Create. You will obtain a URL that you can easily copy/paste thanks to the dedicated icon:Keep the webhook URL preciously. You'll need it later. Validate with the Done button. If everything's OK, you will probably get a Teams notification confirming the configuration of the connector:  Configure Centreon  1. Notification Plugin setupInstall the Microsoft Teams notification Plugin with the Yum package manager on each Poller expected to send notifications to a Teams Channel:yum install centreon-plugin-Notification-TeamsManager on each Poller expected to send notifications to a Teams Channel. 2. Use CLAPI to set up your configuration objects quicklyTo get the full benefits from Plugin capabilities, you have to create the following Centreon objects:A Notification Command corresponding to all possible kinds of resources (Hosts, Services, Business Activities).  A Centreon Contact, corresponding to a channel within Teams. It means that you'll need several Contacts if you need to notify several channels.  To speed things up and make it easier, we've created an almost ready-to-import CLAPI file. Copy the content below and drop it within a file on your Central server’s /tmp directory. As an example /tmp/clapi-teams.import:CMD;ADD;bam-notify-by-microsoft-teams;1;$CENTREONPLUGINS$/centreon_notification_teams.pl --plugin=notification::microsoft::office365::teams::plugin --mode=alert --custommode=webhookapi --teams-webhook='$CONTACTPAGER$' --bam --service-description='$SERVICEDISPLAYNAME$' --service-state='$SERVICESTATE$' --service-output='$SERVICEOUTPUT$' --date='$DATE$ $TIME$' --centreonurl='$CONTACTADDRESS1$'CMD;setparam;bam-notify-by-microsoft-teams;enable_shell;0CMD;setparam;bam-notify-by-microsoft-teams;command_activate;1CMD;setparam;bam-notify-by-microsoft-teams;command_locked;0CMD;ADD;host-notify-by-microsoft-teams;1;$CENTREONPLUGINS$/centreon_notification_teams.pl --plugin=notification::microsoft::office365::teams::plugin --mode=alert --custommode=webhookapi --teams-webhook='$CONTACTPAGER$' --notification-type='$NOTIFICATIONTYPE$' --host-name='$HOSTNAME$' --host-state='$HOSTSTATE$' --host-output='$HOSTOUTPUT$' --date='$DATE$ $TIME$' --action-links --centreon-url='$CONTACTADDRESS1$' --extra-info='$NOTIFICATIONAUTHOR$//$NOTIFICATIONCOMMENT$'CMD;setparam;host-notify-by-microsoft-teams;enable_shell;0CMD;setparam;host-notify-by-microsoft-teams;command_activate;1CMD;setparam;host-notify-by-microsoft-teams;command_locked;0CMD;ADD;host-notify-by-microsoft-teams;1;CMD;ADD;service-notify-by-microsoft-teams;1;$CENTREONPLUGINS$/centreon_notification_teams.pl --plugin=notification::microsoft::office365::teams::plugin --mode=alert --custommode=webhookapi --teams-webhook='$CONTACTPAGER$' --notification-type='$NOTIFICATIONTYPE$' --host-name='$HOSTNAME$' --service-description='$SERVICEDESC$' --service-state='$SERVICESTATE$' --service-output='$SERVICEOUTPUT$' --date='$DATE$ $TIME$' --action-links --centreon-url='$CONTACTADDRESS1$' --extra-info='$NOTIFICATIONAUTHOR$//$NOTIFICATIONCOMMENT$'CMD;setparam;service-notify-by-microsoft-teams;enable_shell;0CMD;setparam;service-notify-by-microsoft-teams;command_activate;1CMD;setparam;service-notify-by-microsoft-teams;command_locked;0CONTACT;ADD;Microsoft-Teams-Consulting-Channel;notify_teams_consulting_channel;node@deadend;md5__2995dea107230ea9a8c4d6e5;0;0;browser;localCONTACT;setparam;notify_teams_consulting_channel;hostnotifperiod;24x7CONTACT;setparam;notify_teams_consulting_channel;svcnotifperiod;24x7CONTACT;setparam;notify_teams_consulting_channel;hostnotifopt;d,uCONTACT;setparam;notify_teams_consulting_channel;servicenotifopt;w,u,cCONTACT;setparam;notify_teams_consulting_channel;contact_pager;<SET_TEAMSWEBHOOK_URL>CONTACT;setparam;notify_teams_consulting_channel;contact_address1;<SET_CENTREON_URL>CONTACT;setparam;notify_teams_consulting_channel;contact_js_effects;0CONTACT;setparam;notify_teams_consulting_channel;reach_api;0CONTACT;setparam;notify_teams_consulting_channel;reach_api_rt;0CONTACT;setparam;notify_teams_consulting_channel;contact_enable_notifications;1CONTACT;setparam;notify_teams_consulting_channel;contact_activate;1CONTACT;setparam;notify_teams_consulting_channel;show_deprecated_pages;0CONTACT;setparam;notify_teams_consulting_channel;contact_ldap_last_sync;0CONTACT;setparam;notify_teams_consulting_channel;contact_ldap_required_sync;0CONTACT;setparam;notify_teams_consulting_channel;hostnotifcmd;host-notify-by-microsoft-teamsCONTACT;setparam;notify_teams_consulting_channel;svcnotifcmd;service-notify-by-microsoft-teams Warning!Before loading the file, substitute these values with yours: <SET_CENTREON_URL>, the URL you use to access Centreon web UI. <SET_TEAMSWEBHOOK_URL>, the Teams Webhook URL obtained previously. Sometimes, the Teams webhook URL can be longer than 200 characters. If this is your case, extend the size of the contact_pager row in the centreon configuration database. You can use this query: ALTER TABLE centreon.contact MODIFY contact_pager VARCHAR(255);Use Centreon credentials and CLAPI to load the file: centreon -u ‘<adminuser>’ -p ‘<password>’ -i /tmp/clapi-teams.importIf the import is successful, you will obtain something similar to the definition below confirming that everything is OK: Depending on what you want to do, you can assign this Contact to a Group or link it with one or several resources and get notifications in your channel! You can also easily reach the performance graph and details of the asset using links and buttons included in the post. Convenient, isn't it? Diving deeperCentreon Notifications allow advanced notification rules to fit your needs. You can find an advanced description of this concept in our official documentation.One more important thing: When using a proxy, make sure to add these options to your notification commands: --proxy-url='protocol://your.proxy.domain:port' --http-backend=curl (change the value with yours!)For any other question or matter, reach us through the centreon-plugin notification channel on Slack!  Centreon Support does not actively maintain knowledge articles. If you have questions or require assistance with an article, please create a case or post a comment below.

sims24
Forum|Forum|6 months ago
1414

Troubleshooting

F.A.Q.

Help! I keep being disconnected from the UI

In this article, we will explain why, in some cases, you can be disconnected from web UI after a short amount of time. Reason #1 : you are using centreon web 21.10.[0-2] If you are using centreon web 21.10.0, 21.10.1 or 21.10.2, you are probably disconnected from Centreon after a variable time which is defined in Administration > Parameters > Centreon UI > Sessions Expiration Time.The problem is that sessions are never updated, even if there is activity on the UI. To avoid this, just update to version 21.10.3 (which should be released in the next few days) or apply this patch. Reason #2 : a browser tab opened on the disconnection url On most browsers, there is a behavior that refreshes the tabs after a certain time, even if they are not active.So, if a tab is located on the centreon disconnect url (/centreon/index.php?disconnect=1), you will be disconnected each time the browser refreshes this tab. Note that this problem will not occur in the next version (planned in Q2-2022), because the disconnection will be done by an asynchronous call which will be transparent for the user (no disconnection argument in the url). Reason #3 : an administrator has fun kicking you out An administrator can kick from Administration > Sessions pageIn this case, a discussion must take place between him and you 

kduret
Forum|Forum|3 months ago
1030
F.A.Q.

Help! Actions on monitored objects aren’t being applied

In the first article of this series, which aims to provide a bounty of hints to solve technical problems faster,  you discovered tools and methods to spot and troubleshoot connection issues between pollers and the central server. In this article, we will be looking at those cases when actions on monitored objects are not being applied in the interface. What’s more annoying than acknowledging an alert, scheduling a maintenance or running an immediate check, and then seeing none of that is happening.Operating overviewLet's take a closer look at what happens when users trigger an action through the interface:Our user is connected to the Centreon web interface and acknowledges an alert (for example). The Apache Web server (httpd24-httpd) will then communicate with the centreon-gorgone API on the Central server and send it the command to run (in this example: the acknowledgment). There are then 2 possibilities: if the acknowledgment is for a device monitored by the central server then centreon-gorgone writes in a pipe file opened by the centreon-engine monitoring engine; if the acknowledgment is for a device monitored by a poller, then the central’s centreon-gorgone communicates with the poller’s centreon-gorgone process which also writes in the file opened by the poller’s centreon-engine monitoring engine. This pipe file is continuously read by the centreon-engine process. As soon as a new command is written in the file, centreon-engine runs it and sends the information back to the central.External commands: What are they?External commands refer to all the monitoring actions that can be run by a Centreon user with the web interface, for example:Acknowledge (an alert): taking an alert into account and muting notifications to avoid alert fatigue; Set downtime: disabling alerts for a resource over a given period of time;  Check: running an immediate check on a resource and refreshing the monitoring.There are other actions such as submitting results (submit result) for passive services, etc. You can learn more about monitoring management here.Solving this issue in Centreon 21.04: With great power comes great responsibility (to quote Spider-Man)You might get a déjà vu reading this section, but it’s worth the revisit  We’re still on the same platform as in the previous article:a central server with the main Centreon components as well as the database instances (IP 192.168.56.125) a poller (IP 192.168.56.126)In this article, the commands passed by SSH on the servers use root. Here’s where you need to remember that with great power comes great responsibility.Check 1: Check access to the "gorgoned" APIAs seen previously, when a monitoring action is triggered by users from the interface, the action is sent by the Web server to centreon-gorgone via its API.Let's first see if the centreon-gorgone process API ('gorgoned') is listening on its default TCP/8085 port. To do this you can use the netstat or ss utilities:[root@centreon-central ~]# netstat -plant | grep 8085LISTEN 0 5 *:8085 *:* users:(("gorgone-httpser",pid=7855,fd=36))If this command doesn’t return any results, check that the gorgoned process is currently running on your central server using the following command:[root@centreon-central ~]# systemctl status gorgoned gorgoned.service - Centreon Gorgone Loaded: loaded (/etc/systemd/system/gorgoned.service; enabled; vendor preset: disabled) Active: active (running) since jeu. 2021-08-19 15:43:32 CEST; 1min 12s ago Main PID: 14468 (perl) CGroup: /system.slice/gorgoned.service ├─14468 /usr/bin/perl /usr/bin/gorgoned --config=/etc/centreon-gorgone/config.yaml --logfile=/var/log/centreon-gorgone/gorgoned.log --severity=d... ├─14476 gorgone-nodes ├─14477 gorgone-dbcleaner ├─14478 gorgone-autodiscovery ├─14479 gorgone-cron ├─14480 gorgone-engine ├─14511 gorgone-statistics ├─14512 gorgone-action ├─14513 gorgone-httpserver ├─14514 gorgone-legacycmd ├─14536 gorgone-proxy ├─14537 gorgone-proxy ├─14544 gorgone-proxy ├─14545 gorgone-proxy └─14558 gorgone-proxyaoût 19 15:43:32 centreon-central systemd[1]: Started Centreon Gorgone.This command confirms that the gorgoned process is active/running. In the list of child processes, gorgone-httpserver is the process for the centreon-gorgone API.If the process isn’t started, you can first try to restart it using the following command:[root@centreon-central ~]# systemctl restart gorgonedAnd if the process still hasn't started, you’ll have to go and look at the centreon-gorgone log file in /var/log/centreon-gorgone/centreon-gorgone.log. The most common causes for errors are:SElinux in ENFORCING mode; Rights on directories and files; Missing dependency or library, etc.Check 2: Check our central’s pipe fileLet's check if a command that needs to be run by central can actually be run.Previously we saw that centreon-gorgone writes the monitoring action commands in a pipe file which is continuously read by the centreon-engine monitoring engine.Let's check that the file exists using the command:[root@centreon-central ~]# ll /var/lib/centreon-engine/rw/centengine.cmdprw-rw----. 1 centreon-engine centreon-engine 0 18 août 18:20 /var/lib/centreon-engine/rw/centengine.cmdThis file must have the corresponding rights rw-rw----, belong to the centreon-engine user, to the centreon-engine group and be a pipe or named pipe identifiable by the first character p  in the rights chain.This file is what’s known as a FIFO (First In/First Out): the writing made to this file is instantly consumed by centreon-engine.In some cases, the format of this file or its rights may be incorrect. Restarting the monitoring engine is then required for the file to be correctly recreated:[root@centreon-central ~]# systemctl restart centengineThis file is created by an external module (exactly like cbmod.so): externalcmd.so. If the file is missing, you can check that the module is properly loaded by centreon-engine when it starts by looking in the /var/log/centreon-engine/centengine.log log file:[root@centreon-central ~]# grep -RIri external /var/log/centreon-engine/centengine.log [1629366622] [29381] Event broker module '/usr/lib64/centreon-engine/externalcmd.so' deinitialized successfully[1629366622] [24389] Event broker module '/usr/lib64/centreon-engine/externalcmd.so' initialized successfullyYou can also check its presence in the centreon-engine configuration, as well as the proper loading of the module:[root@centreon-central ~]# grep -RIri external /etc/centreon-engine/centengine.cfg broker_module=/usr/lib64/centreon-engine/externalcmd.socheck_external_commands=1If you can’t see the module loaded or present in the centreon-engine configuration, you can check the collector configuration in the Configuration > Collectors > Collection engine configuration menu by clicking on the central configuration and going to the Data tab. This configuration must include a command that points to /usr/lib64/centreon-engine/externalcmd.so:If this configuration is missing, add it, referring to the screenshot above. Save the form and then export the new central configuration by choosing the Restart method:To test that everything’s working properly, you can, for example, run an immediate check from the Centreon interface for a service linked to a host monitored by your central server.In parallel, check log files /var/log/centreon-gorgone/centreon-gorgone.log and /var/log/centreon-engine/centengine.log, the action in question should appear as follows:In /var/log/centreon-gorgone/centreon-gorgone.log:  2021-08-19 17:17:32 - INFO - [engine] Processing external command '[1629386252] SCHEDULE_FORCED_SVC_CHECK;HQ-FW-Inet;Ping;1629386252'   In /var/log/centreon-engine/centengine.log: [1629386253] [24389] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;HQ-FW-Inet;Ping;1629386252 Check 3: On our poller, check the Gorgone communicationNow that you’ve validated that monitoring actions are properly operating on the central server, let's check that these same actions are also running on a device monitored by the poller.When monitoring through a poller, the Apache server doesn’t communicate directly with the poller, first transferring  the command to the central’s gorgone process. This process then takes charge of dispatching and transferring the commands to the poller(s) in charge of the host on which you want to run the action.Let's first check that the communication between the centreon-gorgone processes of the central with the poller at Gorgone level is effective.To do that, we need to make sure that the ZMQ/TCP5556 communication is established between the 2 servers (the poller plays the role of a server: it must listen on the port in question, the central plays the role of client and connects to it):[root@centreon-poller ~]# ss -plantu | grep 5556tcp LISTEN 0 100 *:5556 *:* users:(("gorgone-action",pid=1991,fd=36),("gorgone-engine",pid=1990,fd=36),("gorgone-dbclean",pid=1989,fd=36),("perl",pid=1976,fd=36))tcp ESTAB 0 0 192.168.56.126:5556 192.168.56.125:45960 users:(("perl",pid=1976,fd=41)) If in this case you get a TIME-WAIT or you don't see a socket open on the poller's TCP/5556 port, check the /var/log/centreon-gorgone/gorgoned.log logs on it:[root@centreon-poller ~]# tailf /var/log/centreon-gorgone/gorgoned.log2021-08-19 15:09:45 - ERROR - [core] Client pubkey is not authorized. Thumbprint is 'XzVJ5kbmfxYqktqKLLTF62fbf3_qdHn1fH7HLtPj_a8'In the previous example, the communication can’t be established because of a client (the central server) authentication problem. The Central's thumbprint is not in the poller's trusted client list.The easiest thing to do in this case is to retrieve the gorgone configuration of your poller again using the official documentation available on this link.You can also refer to "Check 3" in the previous article in this series. (Everything is connected in the Centreon Cinematic Universe.)Check 4: Check the pipe file on our pollerJust like the central server, the poller must also load the external module allowing it to read and run external commands, so we can rely on the same check items as for the central server:Check that the externalcmd.so module is loaded at startup; Check that the module is present in the configuration; Otherwise add it to the centreon-engine configuration and then export the configuration with a "restart" of your poller;Ensure the entire chain is working properlyOn the Centreon interface, let's now launch an immediate check on a resource monitored by the poller in order to validate the monitoring action is running properly:As before, if we check the /var/log/centreon-gorgone/centreon-gorgone.log log file on the central, we should be able to see the action in question:[root@centreon-central ~]# tailf /var/log/centreon-gorgone/gorgoned.log2021-08-19 15:43:52 - INFO - [legacycmd] Handling command 'EXTERNALCMD', Target: '3', Parameters: '[1629388009] SCHEDULE_FORCED_SVC_CHECK;HQ-FW-Inet;Ping;1629388009'This time, we can see that the message is slightly different when a poller controls the resource: the Target instance: ‘3' is the target Poller ID, the one to which the central gorgone process will forward the request.Poller side, you can find the external command in the gorgone logs:[root@centreon-poller ~]# tailf /var/log/centreon-gorgone/gorgoned.log2021-08-19 15:44:01 - INFO - [engine] Processing external command '[1629388009] SCHEDULE_FORCED_SVC_CHECK;HQ-FW-Inet;Ping;1629388009'Finally, let's check the centreon-engine log file on the poller:[root@centreon-poller ~]# tailf /var/lib/centreon-engine/centengine.log[1629388012] [2032] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;SV-WINDO-PAR;Ping;1629388009Mission accomplished!You’re now better equipped to understand and troubleshoot monitoring actions.If this still isn’t enough, you can increase the verbosity of the centreon-gorgone log by adjusting the /etc/sysconfig/gorgoned file to change the --severity=info option to --severity=debug. This option can be defined on the different centreon-gorgone processes, both on the central server and on the pollers.You will then need to reload the systemd configuration and restart centreon-gorgone:[root@centreon-poller ~]# systemctl daemon-reload[root@centreon-poller ~]# systemctl restart gorgonedRemember to disable debug when you’ve finished troubleshooting ;-))Finally, feel free to ask your questions on our Slack dedicated to the Centreon Community. We’ll be happy to help!

sims24
Forum|Forum|6 months ago
1300
F.A.Q.

Help! My Poller is Down

This tutorial on troubleshooting poller issues is the first installment of a series devoted to the resolution of common issues reported by clients and managed by our teams.  Poller issues generally take two forms#1: The poller is stated as “not running” on the poller configuration page:#2: The last update time is older than 15 minutes and highlighted in yellow:Solve this issue in Centreon 21.04For the purpose of this tutorial, we will use a simple distributed Centreon platform with the following assets:a central server with an embedded DB instance (IP 192.168.56.125) a poller (IP 192.168.56.126)Note that in the following examples, commands will be shown as executed with the root user. Never forget that with great power comes great responsibilities! Quick tour: Overview of a Centreon typical architectureFor efficient and targeted troubleshooting, you need to know what the different components of a Centreon platform are, and how they interact with each other.  As a quick reminder, here’s a platform example comprising a central server and a poller.The poller’s monitoring engine (centreon-engine) executes a bunch of monitoring scripts (probes) to query the monitored devices. Results are returned by centreon-engine’s cbmod module to the centreon-broker instance on the central (BBDO protocol, TCP 5669). The central server’s centreon-broker module handles and processes the results, populating DB tables or generating graphical RRD files. The web interface (Apache server and PHP backend) displays the monitoring information to the user. The centreon-gorgone module exports to the pollers the configurations made on the interface and launches external commands; centreon-gorgone is a client/server module, active both on the central server and in the pollers (ZMQ protocol TCP 5556).Now that we know who does what in a Centreon architecture, let’s get to the troubleshooting. Check 1 : network connectionsThe poller must be connected to the TCP port 5669 of the Central server (BBDO flows). Conversely, the central server must be connected to the TCP port 5556 of the poller (ZMQ centreon-gorgone flows).The netstat  command is helpful to check this, but ss can also be used.When executing this command on the poller, we should get the following results:[root@centreon-poller ~]# netstat -plant | egrep '5556|5669'tcp 0 0 0.0.0.0:5556 0.0.0.0:* LISTEN 3761/perltcp 0 0 192.168.56.126:5556 192.168.56.125:57466 ESTABLISHED 3761/perltcp 0 0 192.168.56.126:33598 192.168.56.125:5669 ESTABLISHED 3554/centengineFrom the Central, the results will be the same, but in the opposite direction:[root@centreon-central ~]# netstat -plant | egrep '5669|5556'tcp 0 0 0.0.0.0:5669 0.0.0.0:* LISTEN 1436/cbdtcp 0 0 192.168.56.125:57466 192.168.56.126:5556 ESTABLISHED 1781/gorgone-proxytcp 0 0 192.168.56.125:5669 192.168.56.126:33574 ESTABLISHED 1436/cbdtcp 0 0 127.0.0.1:5669 127.0.0.1:58200 ESTABLISHED 1436/cbdtcp 0 0 127.0.0.1:58200 127.0.0.1:5669 ESTABLISHED 1430/centengineShould the status be different from “ESTABLISHED”, checking data flows and firewall logs will usually help locate the problem.Another common reason of the network connection failure is that the Linux firewall may be running on either the central or the poller.This can be easily checked by running the following command:[root@centreon-central ~]# systemctl status firewalldfirewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1)If the firewalld process is still active, stop and disable it:[root@centreon-central ~]# systemctl stop firewalld[root@centreon-central ~]# systemctl disable firewalldIf a configuration error is identified at this stage (for example: an erroneous IP address when creating a Poller), it will be necessary to check and correct the entry at various levels of the Centreon configuration, we will see that in a future article.  Check 2: The centreon-engine processThis step aims to check that the monitoring engine is up and running on the poller. First let’s see if the centengine process (daemon of the centreon-engine module) is acting as it should:[root@centreon-poller ~]# systemctl status centenginecentengine.service - Centreon Engine Loaded: loaded (/usr/lib/systemd/system/centengine.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-02-10 09:56:35 CET; 1h 6min ago Main PID: 4463 (centengine) CGroup: /system.slice/centengine.service └─4463 /usr/sbin/centengine /etc/centreon-engine/centengine.cfgCurrent status should be “active (running)”. Ensuring the “enabled” state is active is also important, as it allows the daemon to automatically start with the system, in case of a power outage or an unexpected reboot (did someone just pull the plug?).If status is “disabled”, activate the service at startup with the following command:[root@centreon-poller ~]# systemctl enable centengineCreated symlink from /etc/systemd/system/centreon.service.wants/centengine.service to /usr/lib/systemd/system/centengine.service.Sometimes the centengine daemon can be reported as dead as in the following example: [root@poller ~]# systemctl status centenginecentengine.service - Centreon Engine Loaded: loaded (/usr/lib/systemd/system/centengine.service; enabled; vendor preset: disabled) Active: inactive (dead) since Wed 2021-02-10 09:56:35 CET; 22s ago Process: 22846 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS) Process: 4547 ExecStart=/usr/sbin/centengine /etc/centreon-engine/centengine.cfg (code=exited, status=0/SUCCESS) Main PID: 4547 (code=exited, status=0/SUCCESS)Just try to force the restart: systemctl restart centengine and check the logs in /var/log/centreon-engine/centengine.log for clues about how it ended up this way. The most common reasons would be:SELinux configuration Rights on folders and files Missing libraries or dependencies…Check 3: The centreon-gorgone processAs you briefly saw above, the centreon-gorgone module (carried by the gorgoned process) was introduced in Centreon 21.04, replacing the former centcore module.The centreon-gorgone module provides a client/server connection between central and pollers whereas centcore only knew how to copy files using SSH (pretty much). A defaulting poller can sometimes be attributed to a fault in the centreon-gorgone module, as it is responsible for collecting the “Is running or not” status of pollers. It may happen, for example, that the monitoring is running normally, returning current and real-time data, but the poller displays as “not running.” Here’s how to run the check in that case.First, identify and save the ID of the problematic poller. Go to Configuration > Pollers and hover the mouse on the poller’s name: On the URL link at the bottom of the page, the related poller’s ID will show. On both sides (central and poller), check that the gorgoned daemon is up and running: [root@centreon-central ~]# systemctl status gorgonedgorgoned.service - Centreon Gorgone Loaded: loaded (/etc/systemd/system/gorgoned.service; enabled; vendor preset: disabled) Active: active (running) since mer. 2021-02-10 09:56:03 CET; 2h 10min ago Main PID: 3413 (perl) CGroup: /system.slice/gorgoned.service ├─3413 /usr/bin/perl /usr/bin/gorgoned --config=/etc/centreon-gorgone/config.yaml --logfile=/var/log/centreon-gorgone/gorgoned.log --severity=info ├─3421 gorgone-nodes ├─3428 gorgone-dbcleaner ├─3435 gorgone-autodiscovery ├─3442 gorgone-cron ├─3443 gorgone-engine ├─3444 gorgone-statistics ├─3445 gorgone-action ├─3446 gorgone-httpserver ├─3447 gorgone-legacycmd ├─3478 gorgone-proxy ├─3479 gorgone-proxy ├─3486 gorgone-proxy ├─3505 gorgone-proxy └─3506 gorgone-proxyfévr. 10 09:56:03 cent7-2010-ems systemd[1]: Started Centreon Gorgone. [root@centreon-poller centreon-engine]# systemctl status gorgonedgorgoned.service - Centreon Gorgone Loaded: loaded (/etc/systemd/system/gorgoned.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2021-02-10 09:53:16 CET; 2h 13min ago Main PID: 4384 (perl) CGroup: /system.slice/gorgoned.service ├─4384 /usr/bin/perl /usr/bin/gorgoned --config=/etc/centreon-gorgone/config.yaml --logfile=/var/log/centreon-gorgone/gorgoned.log --severity=info ├─4398 gorgone-dbcleaner ├─4399 gorgone-engine └─4400 gorgone-action   On the central server, check that messages related to the ID are present and do not throw error messages:On the poller, check that the gorgoned configuration file /etc/centreon-gorgone/config.d/40-gorgoned.yaml exists and is similar to this one : [root@centreon-poller centreon-engine]# cat /etc/centreon-gorgone/config.d/40-gorgoned.yamlname: gorgoned-Pollerdescription: Configuration for poller Pollergorgone: gorgonecore: id: 2 external_com_type: tcp external_com_path: "*:5556" authorized_clients: - key: 3H2jXp7D7PC7OTM1ifosCO0l7iqJkf60lHWGWYnR5qY privkey: "/var/lib/centreon-gorgone/.keys/rsakey.priv.pem" pubkey: "/var/lib/centreon-gorgone/.keys/rsakey.pub.pem" modules: - name: action package: gorgone::modules::core::action::hooks enable: true - name: engine package: gorgone::modules::centreon::engine::hooks enable: true command_file: "/var/lib/centreon-engine/rw/centengine.cmd"   If not, check this link to create it again. Check 4: Managing the centreon-broker processCentreon-broker flows between the central and the poller are essential for a fully operational and efficient Centreon platform.Beyond network issues (lost connection BBDO TCPTCP/5669, real-time data processing can potentially be interrupted, which will display the poller as “Not updated.” Here are the steps to check the Centreon broker.First, check the version consistency between the cbmod module (on the poller) and the centreon-broker module on the central. They should always be the same: [root@centreon-central ~]# rpm -qa | grep centreon-brokercentreon-broker-cbd-21.04.3-5.el7.centos.x86_64centreon-broker-storage-21.04.3-5.el7.centos.x86_64centreon-broker-21.04.3-5.el7.centos.x86_64centreon-broker-cbmod-21.04.3-5.el7.centos.x86_64centreon-broker-core-21.04.3-5.el7.centos.x86_64[root@centreon-poller ~]# rpm -qa | grep cbmodcentreon-broker-cbmod-21.04.3-5.el7.centos.x86_64   On the central server, check that the cbd daemon is up and running: [root@centreon-central ~]# systemctl status cbdcbd.service - Centreon Broker watchdog Loaded: loaded (/usr/lib/systemd/system/cbd.service; enabled; vendor preset: disabled) Active: active (running) since mer. 2021-02-10 09:41:01 CET; 5h 13min ago Main PID: 1529 (cbwd) CGroup: /system.slice/cbd.service ├─1529 /usr/sbin/cbwd /etc/centreon-broker/watchdog.json ├─1537 /usr/sbin/cbd /etc/centreon-broker/central-broker.json └─1538 /usr/sbin/cbd /etc/centreon-broker/central-rrd.json Like the other vital daemons, it should appear as “active (running)” and have its 3 children processes: cbwd, cbd broker et cbd rrd.  Check the logs: they’re located in the /var/log/centreon-broker directory. On the Central, look for the central-broker-master.log file; on the poller, look for the module-poller.log file: [root@centreon-central ~]# ls -ltr /var/log/centreon-broker/total 8-rw-rw-r-- 1 centreon-broker centreon-broker 1039 5 févr. 10:43 central-broker-master.log-20210205-rw-rw-r-- 1 centreon-broker centreon-broker 360 5 févr. 10:43 central-module-master.log-20210205-rw-rw-r-- 1 centreon-broker centreon-broker 240 5 févr. 10:43 central-rrd-master.log-20210205-rw-rw-r-- 1 centreon-broker centreon-broker 3610 5 févr. 10:43 watchdog.log-20210205-rw-rw-r-- 1 centreon-broker centreon-broker 1402 10 févr. 09:41 watchdog.log-rw-rw-r-- 1 centreon-broker centreon-broker 669 10 févr. 09:41 central-broker-master.log-rw-rw-r-- 1 centreon-broker centreon-broker 200 10 févr. 09:41 central-rrd-master.log-rw-rw-r-- 1 centreon-broker centreon-broker 400 10 févr. 10:00 central-module-master.log[root@centreon-poller ~]# ls -ltr /var/log/centreon-broker/total 4-rw-r--r--. 1 centreon-engine centreon-engine 1330 Feb 10 11:12 module-poller.log These files should not have recent error messages. In older versions of Centreon we could find these kind of entries: Error : conflict_manager : error in the main loop If so, simply restart the centreon-broker daemon on the Central server: [root@centreon-central ~]# systemctl restart cbd   Last but not least, on the poller, check that the cbmod module is successfully loaded when centreon-engine starts; this part of information should be in the centengine.log file: [root@centreon-poller ~]# grep -i cbmod.so /var/log/centreon-engine/centengine.log[1612947395] [4463] Event broker module '/usr/lib64/nagios/cbmod.so' initialized successfully   What’s Next?In this tutorial, we did a tour of the primary checks that should be done whenever a poller seems to be in a funny state. Of course, other causes of issues exist and sometimes the solutions described here wouldn’t do the trick. Hopefully, this will however give you clues on how to start investigating.Still blocked and running out of coffee? Keep calm and ask questions! There will always be someone keen to give you a hand (if not running out of coffee). Suggestions are also always welcomed!

Thibault
Forum|Forum|6 months ago
5000

Need more help?

Documentation

All you need to start or enhance your Centreon journey.

Support

Our support team is ready to get you up and running with your Centreon solution.

Resources

A library covering a range of relevant topics in a variety of formats.

Powered by inSided
Terms & ConditionsCookie settings
Back to top

Sign up

Already have an account? Login

Login to the community

No account yet? Create an account

Forgot password?

Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.

Back to overview

Scanning file for viruses.

Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.

OK

This file cannot be downloaded

Sorry, our virus scanner detected that this file isn't safe to download.

OK