diff --git a/src/core_plugins/kibana/common/tutorials/tutorial_beats_instructions.js b/src/core_plugins/kibana/common/tutorials/tutorial_beats_instructions.js new file mode 100644 index 0000000000000..32971df986b46 --- /dev/null +++ b/src/core_plugins/kibana/common/tutorials/tutorial_beats_instructions.js @@ -0,0 +1,103 @@ +export const FILEBEAT_INSTRUCTIONS = { + INSTALL: { + OSX: { + title: 'Download and install Filebeat', + textPre: 'Download and install Filebeat by running the commands below.' + + ' Skip this step if you already have Filebeat installed.' + + ' If you are installing Filebeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-darwin-x86_64.tar.gz', + 'tar xzvf filebeat-{config.kibana.version}-darwin-x86_64.tar.gz' + ], + textPost: 'Edit the `filebeat-{config.kibana.version}-darwin-x86_64/filebeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + DEB: { + title: 'Download and install Filebeat', + textPre: 'Download and install Filebeat by running the commands below.' + + ' Skip this step if you already have Filebeat installed.' + + ' If you are installing Filebeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-amd64.deb', + 'sudo dpkg -i filebeat-{config.kibana.version}-amd64.deb' + ], + textPost: 'Edit the `/etc/filebeat/filebeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + RPM: { + title: 'Download and install Filebeat', + textPre: 'Download and install Filebeat by running the commands below.' + + ' Skip this step if you already have Filebeat installed.' + + ' If you are installing Filebeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-x86_64.rpm', + 'sudo rpm -vi filebeat-{config.kibana.version}-x86_64.rpm' + ], + textPost: 'Edit the `/etc/filebeat/filebeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + WINDOWS: { + title: 'Download and install Filebeat', + textPre: 'Skip this step if you already have Filebeat installed.' + + ' If you are installing Filebeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation\n' + + '1. Download the Filebeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats) page.\n' + + '2. Extract the contents of the zip file into `C:\\Program Files`.\n' + + '3. Rename the filebeat-{config.kibana.version}-windows directory to Filebeat.\n' + + '4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' + + ' Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.\n' + + '5. From the PowerShell prompt, run the following commands to install Filebeat as a Windows service.', + commands: [ + 'PS > cd C:\\Program Files\\Filebeat', + 'PS C:\\Program Files\\Filebeat> .\\install-service-filebeat.ps1' + ], + textPost: 'Edit the `C:\\Program Files\\Filebeat\\filebeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + } + }, + START: { + OSX: { + title: 'Start Filebeat', + textPre: 'Setup the Kibana dashboards and start Filebeat with the following commands.' + + ' Skip this step if you already have Filebeat installed.', + commands: [ + './filebeat -e --setup', + ], + textPost: 'The `--setup` flag loads the Kibana dashboards. If the dashboards are already setup, ' + + 'you don\'t need to use this flag.' + }, + DEB: { + title: 'Start Filebeat', + textPre: 'Setup the Kibana dashboards and start Filebeat with the following commands.', + commands: [ + 'sudo filebeat setup -e', + 'sudo service filebeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + }, + RPM: { + title: 'Start Filebeat', + textPre: 'Setup the Kibana dashboards and start Filebeat with the following commands.', + commands: [ + 'sudo filebeat setup -e', + 'sudo service filebeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + }, + WINDOWS: { + title: 'Start Filebeat', + textPre: 'Setup the Kibana dashboards and start Filebeat as a service with the following commands.', + commands: [ + 'PS C:\\Program Files\\Filebeat> filebeat.exe setup -e', + 'PS C:\\Program Files\\Filebeat> Service-Start filebeat', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + } +}; diff --git a/src/core_plugins/kibana/server/tutorials/apache/index.js b/src/core_plugins/kibana/server/tutorials/apache/index.js deleted file mode 100644 index f6fdb8a7edf27..0000000000000 --- a/src/core_plugins/kibana/server/tutorials/apache/index.js +++ /dev/null @@ -1,129 +0,0 @@ -import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; -import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; - -export function apacheSpecProvider() { - return { - id: 'apache', - name: 'Apache logs', - category: TUTORIAL_CATEGORY.LOGGING, - shortDescription: 'This module parses access and error logs created by the Apache HTTP server.', - longDescription: 'This module parses access and error logs created by the Apache HTTP server.', - //iconPath: '', TODO - completionTimeMinutes: 10, - previewImagePath: 'kibana-apache2.png', - instructionSets: [ - { - title: 'Getting Started', - instructionVariants: [ - { - id: INSTRUCTION_VARIANT.OSX, - instructions: [ - { - title: 'Download and install Filebeat', - textPre: 'Download and install Filebeat by running the commands below.', - commands: [ - 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-darwin-x86_64.tar.gz', - 'tar xzvf filebeat-{config.kibana.version}-darwin-x86_64.tar.gz' - ] - }, - { - title: 'Enable and configure the Apache module', - textPre: `In the Filebeat install directory, run the following commands to enable the Apache module, - to setup the module, and to start Filebeat.`, - commands: [ - 'cd filebeat-{config.kibana.version}-darwin-x86_64/', - './filebeat modules enable apache2', - ], - textPost: 'Optional: Modify the module settings in the `modules.d/apache2.yml` file.' - }, - { - title: 'Start Filebeat', - textPre: 'Setup the Kibana dashboards and start Filebeat with the following commands.', - commands: [ - './filebeat setup -e', - './filebeat -e', - ], - } - ] - }, - { - id: INSTRUCTION_VARIANT.DEB, - instructions: [ - { - title: 'Download and install Filebeat', - textPre: 'Download and install Filebeat by running the commands below.', - commands: [ - 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-amd64.deb', - 'sudo dpkg -i filebeat-{config.kibana.version}-amd64.deb' - ] - }, - { - title: 'Enable and configure the Apache module', - textPre: 'Run the following commands to enable the Apache module, to setup the module, and to start Filebeat.', - commands: [ - 'sudo filebeat modules enable apache2', - ], - textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/apache2.yml` file.' - }, - { - title: 'Start Filebeat', - textPre: 'Setup the Kibana dashboards and start Filebeat with the following commands.', - commands: [ - 'sudo filebeat setup -e', - 'sudo filebeat -e', - ], - } - ] - }, - { - id: INSTRUCTION_VARIANT.RPM, - instructions: [ - { - title: 'Download and install Filebeat', - textPre: 'Download and install Filebeat by running the commands below.', - commands: [ - 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-x86_64.rpm', - 'sudo rpm -vi filebeat-{config.kibana.version}-x86_64.rpm' - ] - }, - { - title: 'Enable and configure the Apache module', - textPre: 'Run the following commands to enable the Apache module, to setup the module, and to start Filebeat.', - commands: [ - 'sudo filebeat modules enable apache2', - ], - textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/apache2.yml` file.' - }, - { - title: 'Start Filebeat', - textPre: 'Setup the Kibana dashboards and start Filebeat with the following commands.', - commands: [ - 'sudo filebeat setup -e', - 'sudo filebeat -e', - ], - } - ] - }, - { - id: INSTRUCTION_VARIANT.WINDOWS, - instructions: [ - { - title: 'Download and install Filebeat', - textPre: `1. Download the Filebeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats) page. - 2. Extract the contents of the zip file into C:\Program Files. - 3. Rename the filebeat-{config.kibana.version}-windows directory to Filebeat. - 4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select - Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell. - 5. From the PowerShell prompt, run the following commands to install Filebeat as a Windows service:`, - commands: [ - 'PS > cd C:\\Program Files\\Filebeat', - 'PS C:\\Program Files\\Filebeat> .\\install-service-filebeat.ps1' - ] - }, - ] - } - ] - } - ] - }; -} diff --git a/src/core_plugins/kibana/server/tutorials/apacheLogs/index.js b/src/core_plugins/kibana/server/tutorials/apacheLogs/index.js new file mode 100644 index 0000000000000..af1307147b96f --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/apacheLogs/index.js @@ -0,0 +1,84 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; +import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/tutorial_beats_instructions'; + +export function apacheLogsSpecProvider() { + return { + id: 'apacheLogs', + name: 'Apache logs', + category: TUTORIAL_CATEGORY.LOGGING, + shortDescription: 'This module parses access and error logs created by the Apache HTTP server.', + longDescription: 'This module parses access and error logs created by the Apache 2 HTTP server.' + + ' You can read more about the Filebeat Apache module in the [documentation].', + //iconPath: '', TODO + completionTimeMinutes: 10, + previewImagePath: 'kibana-apache2.png', + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.OSX, + { + title: 'Enable and configure the Apache module', + textPre: 'In the Filebeat install directory, run the following commands to enable the Apache module.', + commands: [ + './filebeat modules enable apache2', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.OSX + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.DEB, + { + title: 'Enable and configure the Apache module', + textPre: 'Run the following commands to enable the Apache module.', + commands: [ + 'sudo filebeat modules enable apache2', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.DEB + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.RPM, + { + title: 'Enable and configure the Apache module', + textPre: 'Run the following commands to enable the Apache module.', + commands: [ + 'sudo filebeat modules enable apache2', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.RPM + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.WINDOWS, + { + title: 'Enable and configure the Apache module', + textPre: 'In the `C:\\Program Files\\Filebeat` folder, run the following commands to enable the Apache module.', + commands: [ + 'PS C:\\Program Files\\Filebeat> filebeat.exe modules enable apache2', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.WINDOWS + ] + } + ] + } + ] + }; +} diff --git a/src/core_plugins/kibana/server/tutorials/apacheMetrics/index.js b/src/core_plugins/kibana/server/tutorials/apacheMetrics/index.js new file mode 100644 index 0000000000000..292f223db2e1a --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/apacheMetrics/index.js @@ -0,0 +1,200 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; + +export function apacheMetricsSpecProvider() { + return { + id: 'apacheMetrics', + name: 'Apache metrics', + category: TUTORIAL_CATEGORY.METRICS, + shortDescription: 'This module fetches internal metrics from the Apache HTTP server.', + longDescription: 'This module fetches internal metrics from the Apache 2 HTTP server.' + + ' You can read more about the Metricbeat Apache module in the [documentation].', + //iconPath: '', TODO + completionTimeMinutes: 10, + //previewImagePath: 'kibana-apache.png', TODO + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz', + 'tar xzvf metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz' + ], + textPost: 'Edit the `metricbeat-{config.kibana.version}-darwin-x86_64/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Apache module', + textPre: 'In the Metricbeat install directory, run the following commands to enable the Apache module.', + commands: [ + './metricbeat modules enable apache', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/apache.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + './metricbeat test modules apache' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.' + + ' Skip this step if you already have Metricbeat installed.', + commands: [ + './metricbeat -e --setup', + ], + textPost: 'The `--setup` flag loads the Kibana dashboards. If the dashboards are already setup, ' + + 'you don\'t need to use this flag.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-amd64.deb', + 'sudo dpkg -i metricbeat-{config.kibana.version}-amd64.deb' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Apache module', + textPre: 'Run the following commands to enable the Apache module.', + commands: [ + 'sudo metricbeat modules enable apache', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/apache.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'sudo metricbeat test modules apache' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-x86_64.rpm', + 'sudo rpm -vi metricbeat-{config.kibana.version}-x86_64.rpm' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Apache module', + textPre: 'Run the following commands to enable the Apache module.', + commands: [ + 'sudo metricbeat modules enable apache', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/apache.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'sudo metricbeat test modules apache' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation\n' + + '1. Download the Metricbeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats) page.\n' + + '2. Extract the contents of the zip file into `C:\\Program Files`.\n' + + '3. Rename the metricbeat-{config.kibana.version}-windows directory to Metricbeat.\n' + + '4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' + + ' Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.\n' + + '5. From the PowerShell prompt, run the following commands to install Metricbeat as a Windows service.', + commands: [ + 'PS > cd C:\\Program Files\\Metricbeat', + 'PS C:\\Program Files\\Metricbeat> .\\install-service-metricbeat.ps1' + ], + textPost: 'Edit the `C:\\Program Files\\Metricbeat\\metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Apache module', + textPre: 'In the `C:\\Program Files\\Metricbeat` folder, run the following commands to enable the Apache module.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe modules enable apache', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/apache.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe test modules apache' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat as a service with the following commands.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe setup -e', + 'PS C:\\Program Files\\Metricbeat> Service-Start metricbeat', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + } + ] + } + ] + }; +} diff --git a/src/core_plugins/kibana/server/tutorials/mysqlLogs/index.js b/src/core_plugins/kibana/server/tutorials/mysqlLogs/index.js new file mode 100644 index 0000000000000..512aff600790b --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/mysqlLogs/index.js @@ -0,0 +1,84 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; +import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/tutorial_beats_instructions'; + +export function mysqlLogsSpecProvider() { + return { + id: 'mysqlLogs', + name: 'MySQL logs', + category: TUTORIAL_CATEGORY.LOGGING, + shortDescription: 'This module parses slow logs and error logs created by MySQL.', + longDescription: 'This module parses slow logs and error logs created by MySQL.' + + ' You can read more about the Filebeat MySQL module in the [documentation].', + //iconPath: '', TODO + completionTimeMinutes: 10, + //previewImagePath: '', TODO + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.OSX, + { + title: 'Enable and configure the MySQL module', + textPre: 'In the Filebeat install directory, run the following commands to enable the MySQL module.', + commands: [ + './filebeat modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/mysql.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.OSX + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.DEB, + { + title: 'Enable and configure the MySQL module', + textPre: 'Run the following commands to enable the MySQL module.', + commands: [ + 'sudo filebeat modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/mysql.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.DEB + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.RPM, + { + title: 'Enable and configure the MySQL module', + textPre: 'Run the following commands to enable the MySQL module.', + commands: [ + 'sudo filebeat modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/mysql.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.RPM + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.WINDOWS, + { + title: 'Enable and configure the MySQL module', + textPre: 'In the `C:\\Program Files\\Filebeat` folder, run the following commands to enable the MySQL module.', + commands: [ + 'PS C:\\Program Files\\Filebeat> filebeat.exe modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/mysql.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.WINDOWS + ] + } + ] + } + ] + }; +} diff --git a/src/core_plugins/kibana/server/tutorials/mysqlMetrics/index.js b/src/core_plugins/kibana/server/tutorials/mysqlMetrics/index.js new file mode 100644 index 0000000000000..ad95e0f56547a --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/mysqlMetrics/index.js @@ -0,0 +1,200 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; + +export function mysqlMetricsSpecProvider() { + return { + id: 'mysqlMetrics', + name: 'MySQL metrics', + category: TUTORIAL_CATEGORY.METRICS, + shortDescription: 'This module fetches internal metrics from MySQL.', + longDescription: 'This module fetches internal metrics from MySQL.' + + ' You can read more about the Metricbeat MySQL module in the [documentation].', + //iconPath: '', TODO + completionTimeMinutes: 10, + //previewImagePath: 'kibana-mysql.png', TODO + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz', + 'tar xzvf metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz' + ], + textPost: 'Edit the `metricbeat-{config.kibana.version}-darwin-x86_64/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the MySQL module', + textPre: 'In the Metricbeat install directory, run the following commands to enable the MySQL module.', + commands: [ + './metricbeat modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/mysql.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + './metricbeat test modules mysql' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.' + + ' Skip this step if you already have Metricbeat installed.', + commands: [ + './metricbeat -e --setup', + ], + textPost: 'The `--setup` flag loads the Kibana dashboards. If the dashboards are already setup, ' + + 'you don\'t need to use this flag.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-amd64.deb', + 'sudo dpkg -i metricbeat-{config.kibana.version}-amd64.deb' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the MySQL module', + textPre: 'Run the following commands to enable the MySQL module.', + commands: [ + 'sudo metricbeat modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/mysql.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'sudo metricbeat test modules mysql' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-x86_64.rpm', + 'sudo rpm -vi metricbeat-{config.kibana.version}-x86_64.rpm' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the MySQL module', + textPre: 'Run the following commands to enable the MySQL module.', + commands: [ + 'sudo metricbeat modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/mysql.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'sudo metricbeat test modules mysql' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation\n' + + '1. Download the Metricbeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats) page.\n' + + '2. Extract the contents of the zip file into `C:\\Program Files`.\n' + + '3. Rename the metricbeat-{config.kibana.version}-windows directory to Metricbeat.\n' + + '4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' + + ' Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.\n' + + '5. From the PowerShell prompt, run the following commands to install Metricbeat as a Windows service.', + commands: [ + 'PS > cd C:\\Program Files\\Metricbeat', + 'PS C:\\Program Files\\Metricbeat> .\\install-service-metricbeat.ps1' + ], + textPost: 'Edit the `C:\\Program Files\\Metricbeat\\metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the MySQL module', + textPre: 'In the `C:\\Program Files\\Metricbeat` folder, run the following commands to enable the MySQL module.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe modules enable mysql', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/mysql.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe test modules mysql' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat as a service with the following commands.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe setup -e', + 'PS C:\\Program Files\\Metricbeat> Service-Start metricbeat', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + } + ] + } + ] + }; +} diff --git a/src/core_plugins/kibana/server/tutorials/nginxLogs/index.js b/src/core_plugins/kibana/server/tutorials/nginxLogs/index.js new file mode 100644 index 0000000000000..e459e6c69441d --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/nginxLogs/index.js @@ -0,0 +1,84 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; +import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/tutorial_beats_instructions'; + +export function nginxLogsSpecProvider() { + return { + id: 'nginxLogs', + name: 'Nginx logs', + category: TUTORIAL_CATEGORY.LOGGING, + shortDescription: 'This module parses access and error logs created by the Nginx HTTP server.', + longDescription: 'This module parses access and error logs created by the Nginx HTTP server.' + + ' You can read more about the Filebeat Nginx module in the [documentation].', + //iconPath: '', TODO + completionTimeMinutes: 10, + //previewImagePath: '', TODO + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.OSX, + { + title: 'Enable and configure the Nginx module', + textPre: 'In the Filebeat install directory, run the following commands to enable the Nginx module.', + commands: [ + './filebeat modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/nginx.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.OSX + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.DEB, + { + title: 'Enable and configure the Nginx module', + textPre: 'Run the following commands to enable the Nginx module.', + commands: [ + 'sudo filebeat modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/nginx.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.DEB + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.RPM, + { + title: 'Enable and configure the Nginx module', + textPre: 'Run the following commands to enable the Nginx module.', + commands: [ + 'sudo filebeat modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/nginx.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.RPM + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.WINDOWS, + { + title: 'Enable and configure the Nginx module', + textPre: 'In the `C:\\Program Files\\Filebeat` folder, run the following commands to enable the Nginx module.', + commands: [ + 'PS C:\\Program Files\\Filebeat> filebeat.exe modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/nginx.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.WINDOWS + ] + } + ] + } + ] + }; +} diff --git a/src/core_plugins/kibana/server/tutorials/nginxMetrics/index.js b/src/core_plugins/kibana/server/tutorials/nginxMetrics/index.js new file mode 100644 index 0000000000000..22c659d804563 --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/nginxMetrics/index.js @@ -0,0 +1,202 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; + +export function nginxMetricsSpecProvider() { + return { + id: 'nginxMetrics', + name: 'Nginx metrics', + category: TUTORIAL_CATEGORY.METRICS, + shortDescription: 'This module fetches internal metrics from the Nginx HTTP server.', + longDescription: 'This module fetches internal metrics from the Nginx HTTP server.' + + ' You can read more about the Metricbeat Nginx module in the [documentation].' + + ' The module scrapes the server status data from the web page generated by the' + + ' [ngx_http_stub_status] module, which needs to be enabled in you Nginx installation', + //iconPath: '', TODO + completionTimeMinutes: 10, + //previewImagePath: 'kibana-nginx.png', TODO + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz', + 'tar xzvf metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz' + ], + textPost: 'Edit the `metricbeat-{config.kibana.version}-darwin-x86_64/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Nginx module', + textPre: 'In the Metricbeat install directory, run the following commands to enable the Nginx module.', + commands: [ + './metricbeat modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/nginx.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + './metricbeat test modules nginx' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.' + + ' Skip this step if you already have Metricbeat installed.', + commands: [ + './metricbeat -e --setup', + ], + textPost: 'The `--setup` flag loads the Kibana dashboards. If the dashboards are already setup, ' + + 'you don\'t need to use this flag.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-amd64.deb', + 'sudo dpkg -i metricbeat-{config.kibana.version}-amd64.deb' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Nginx module', + textPre: 'Run the following commands to enable the Nginx module.', + commands: [ + 'sudo metricbeat modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/nginx.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'sudo metricbeat test modules nginx' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-x86_64.rpm', + 'sudo rpm -vi metricbeat-{config.kibana.version}-x86_64.rpm' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Nginx module', + textPre: 'Run the following commands to enable the Nginx module.', + commands: [ + 'sudo metricbeat modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/nginx.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'sudo metricbeat test modules nginx' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation\n' + + '1. Download the Metricbeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats) page.\n' + + '2. Extract the contents of the zip file into `C:\\Program Files`.\n' + + '3. Rename the metricbeat-{config.kibana.version}-windows directory to Metricbeat.\n' + + '4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' + + ' Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.\n' + + '5. From the PowerShell prompt, run the following commands to install Metricbeat as a Windows service.', + commands: [ + 'PS > cd C:\\Program Files\\Metricbeat', + 'PS C:\\Program Files\\Metricbeat> .\\install-service-metricbeat.ps1' + ], + textPost: 'Edit the `C:\\Program Files\\Metricbeat\\metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the Nginx module', + textPre: 'In the `C:\\Program Files\\Metricbeat` folder, run the following commands to enable the Nginx module.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe modules enable nginx', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/nginx.yml` file.' + }, + { + title: 'Optional: Test the module', + textPre: 'You can do a dry-run fetch by running the following command.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe test modules nginx' + ] + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat as a service with the following commands.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe setup -e', + 'PS C:\\Program Files\\Metricbeat> Service-Start metricbeat', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + } + ] + } + ] + }; +} diff --git a/src/core_plugins/kibana/server/tutorials/register.js b/src/core_plugins/kibana/server/tutorials/register.js index 342d0d1db89be..d79e1ed869ac6 100644 --- a/src/core_plugins/kibana/server/tutorials/register.js +++ b/src/core_plugins/kibana/server/tutorials/register.js @@ -1,5 +1,19 @@ -import { apacheSpecProvider } from './apache'; +import { systemLogsSpecProvider } from './systemLogs'; +import { systemMetricsSpecProvider } from './systemMetrics'; +import { apacheLogsSpecProvider } from './apacheLogs'; +import { apacheMetricsSpecProvider } from './apacheMetrics'; +import { nginxLogsSpecProvider } from './nginxLogs'; +import { nginxMetricsSpecProvider } from './nginxMetrics'; +import { mysqlLogsSpecProvider } from './mysqlLogs'; +import { mysqlMetricsSpecProvider } from './mysqlMetrics'; export function registerTutorials(server) { - server.registerTutorial(apacheSpecProvider); + server.registerTutorial(systemLogsSpecProvider); + server.registerTutorial(systemMetricsSpecProvider); + server.registerTutorial(apacheLogsSpecProvider); + server.registerTutorial(apacheMetricsSpecProvider); + server.registerTutorial(nginxLogsSpecProvider); + server.registerTutorial(nginxMetricsSpecProvider); + server.registerTutorial(mysqlLogsSpecProvider); + server.registerTutorial(mysqlMetricsSpecProvider); } diff --git a/src/core_plugins/kibana/server/tutorials/systemLogs/index.js b/src/core_plugins/kibana/server/tutorials/systemLogs/index.js new file mode 100644 index 0000000000000..e6951c24be5dd --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/systemLogs/index.js @@ -0,0 +1,70 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; +import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/tutorial_beats_instructions'; + +export function systemLogsSpecProvider() { + return { + id: 'systemLogs', + name: 'System logs', + category: TUTORIAL_CATEGORY.LOGGING, + shortDescription: 'This module parses logs written by the local Syslog server.', + longDescription: 'This module collects and parses logs created by the system logging service of common' + + ' Unix/Linux based distributions. This module is not available on Windows.' + + ' You can read more about the Filebeat System module in the [documentation].', + //iconPath: '', TODO + completionTimeMinutes: 10, + //previewImagePath: '', TODO + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.OSX, + { + title: 'Enable and configure the System module', + textPre: 'In the Filebeat install directory, run the following commands to enable the System module.', + commands: [ + './filebeat modules enable system', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/system.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.OSX + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.DEB, + { + title: 'Enable and configure the System module', + textPre: 'Run the following commands to enable the System module.', + commands: [ + 'sudo filebeat modules enable system', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/system.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.DEB + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + FILEBEAT_INSTRUCTIONS.INSTALL.RPM, + { + title: 'Enable and configure the System module', + textPre: 'Run the following commands to enable the System module.', + commands: [ + 'sudo filebeat modules enable system', + ], + textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/system.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.RPM + ] + } + ] + } + ] + }; +} diff --git a/src/core_plugins/kibana/server/tutorials/systemMetrics/index.js b/src/core_plugins/kibana/server/tutorials/systemMetrics/index.js new file mode 100644 index 0000000000000..35176ba653cb9 --- /dev/null +++ b/src/core_plugins/kibana/server/tutorials/systemMetrics/index.js @@ -0,0 +1,177 @@ +import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; +import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; + +export function systemMetricsSpecProvider() { + return { + id: 'systemMetrics', + name: 'System metrics', + category: TUTORIAL_CATEGORY.METRICS, + shortDescription: 'This module collects CPU, memory, network, and disk statistics from the host.', + longDescription: 'This module CPU, memory, network, and disk statistics from the host.' + + ' It collects system wide statistics as well as per process and per filesystem statistics.' + + ' You can read more about the Metricbeat System module in the [documentation].', + //iconPath: '', TODO + completionTimeMinutes: 10, + //previewImagePath: 'kibana-system.png', TODO + instructionSets: [ + { + title: 'Getting Started', + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz', + 'tar xzvf metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz' + ], + textPost: 'Edit the `metricbeat-{config.kibana.version}-darwin-x86_64/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the System module', + textPre: 'In the Metricbeat install directory, run the following commands to enable the System module.' + + ' Note that the System module is enabled by default.', + commands: [ + './metricbeat modules enable system', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/system.yml` file.' + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.' + + ' Skip this step if you already have Metricbeat installed.', + commands: [ + './metricbeat -e --setup', + ], + textPost: 'The `--setup` flag loads the Kibana dashboards. If the dashboards are already setup, ' + + 'you don\'t need to use this flag.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-amd64.deb', + 'sudo dpkg -i metricbeat-{config.kibana.version}-amd64.deb' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the System module', + textPre: 'Run the following commands to enable the System module.' + + ' Note that the System module is enabled by default.', + commands: [ + 'sudo metricbeat modules enable system', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/system.yml` file.' + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Download and install Metricbeat by running the commands below.' + + ' Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation.', + commands: [ + 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-x86_64.rpm', + 'sudo rpm -vi metricbeat-{config.kibana.version}-x86_64.rpm' + ], + textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the System module', + textPre: 'Run the following commands to enable the System module.' + + ' Note that the System module is enabled by default.', + commands: [ + 'sudo metricbeat modules enable system', + ], + textPost: 'Optional: Modify the module settings in the `/etc/metricbeat/modules.d/system.yml` file.' + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat with the following commands.', + commands: [ + 'sudo metricbeat setup -e', + 'sudo service metricbeat start', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + { + title: 'Download and install Metricbeat', + textPre: 'Skip this step if you already have Metricbeat installed.' + + ' If you are installing Metricbeat for the first time, we recommend reading the [Getting Started]' + + ' guide in the online documentation\n' + + '1. Download the Metricbeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats) page.\n' + + '2. Extract the contents of the zip file into `C:\\Program Files`.\n' + + '3. Rename the metricbeat-{config.kibana.version}-windows directory to Metricbeat.\n' + + '4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' + + ' Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.\n' + + '5. From the PowerShell prompt, run the following commands to install Metricbeat as a Windows service.', + commands: [ + 'PS > cd C:\\Program Files\\Metricbeat', + 'PS C:\\Program Files\\Metricbeat> .\\install-service-metricbeat.ps1' + ], + textPost: 'Edit the `C:\\Program Files\\Metricbeat\\metricbeat.yml` file and ' + + 'adjust the `output.elasticsearch` settings if needed.' + }, + { + title: 'Enable and configure the System module', + textPre: 'In the `C:\\Program Files\\Metricbeat` folder, run the following commands to enable the System module.' + + ' Note that the System module is enabled by default.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe modules enable system', + ], + textPost: 'Optional: Modify the module settings in the `modules.d/system.yml` file.' + }, + { + title: 'Start Metricbeat', + textPre: 'Setup the Kibana dashboards and start Metricbeat as a service with the following commands.', + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe setup -e', + 'PS C:\\Program Files\\Metricbeat> Service-Start metricbeat', + ], + textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' + + 'you don\'t need to run it again.' + } + ] + } + ] + } + ] + }; +}