Skip to content

Commit

Permalink
Merge branch 'staging' into MON-153475-slack
Browse files Browse the repository at this point in the history
  • Loading branch information
cg-tw authored Dec 13, 2024
2 parents 93ad2a3 + f6af52e commit 096c413
Show file tree
Hide file tree
Showing 1,457 changed files with 34,496 additions and 23,138 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@ concurrency:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 9
run_install: false

- name: Set up Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
uses: borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
with:
cmd: install --frozen-lockfile
run: pnpm install --frozen-lockfile
shell: bash

- name: Redirect pp and cloud links to last documentation
run: |
Expand All @@ -34,10 +42,10 @@ jobs:
shell: bash

- name: Build documentation for ${{ github.event.inputs.version }}
run: ARCHIVED_VERSION="${{ github.event.inputs.version }}" yarn build
run: ARCHIVED_VERSION="${{ github.event.inputs.version }}" pnpm build

- name: Store build archived doc in cache
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: "./build"
key: "${{ github.sha }}-${{ github.run_id }}-build-archived-doc"
Expand All @@ -47,7 +55,7 @@ jobs:
runs-on: [self-hosted, infra]
steps:
- name: Restore built archived doc from cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: "./build"
key: "${{ github.sha }}-${{ github.run_id }}-build-archived-doc"
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/clean-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: clean-cache

on:
pull_request:
types:
- closed

jobs:
clean-cache:
runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Clean cache
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66 changes: 47 additions & 19 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Get changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
Expand Down Expand Up @@ -169,34 +169,60 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 9
run_install: false

- name: Set up Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
cache: yarn
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
uses: borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
run: pnpm install --frozen-lockfile
shell: bash

- name: Restore docusaurus build from cache
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
cmd: install --frozen-lockfile
path: |
.docusaurus
build
key: docusaurus-build-${{ matrix.environment }}-${{ github.head_ref || github.ref_name }}
restore-keys: |
docusaurus-build-${{ matrix.environment }}-staging
- name: Build documentation
run: yarn build
run: pnpm build
env:
PP: ${{ matrix.pp }}
CLOUD: ${{ matrix.cloud }}
VERSIONS: ${{ matrix.environment == 'staging' && matrix.versions || matrix.next_version }}
BASE_URL: ${{ github.event_name == 'pull_request' && format('/previews/pr-{0}/{1}', github.event.pull_request.number, matrix.environment) || '' }}

- name: Store build in cache
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
- name: Clear previous docker image from cache
run: |
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/centreon/centreon-documentation/actions/caches?key=docusaurus-build-${{ matrix.environment }}-${{ github.head_ref || github.ref_name }}
shell: bash

- name: Store docusaurus build cache in cache
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: "./build"
key: "${{ github.sha }}-${{ github.run_id }}-build-doc-${{ matrix.environment }}"
path: |
.docusaurus
build
key: docusaurus-build-${{ matrix.environment }}-${{ github.head_ref || github.ref_name }}

deploy-preview:
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -212,13 +238,15 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Restore build from cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: "./build"
key: "${{ github.sha }}-${{ github.run_id }}-build-doc-${{ matrix.environment }}"
path: |
.docusaurus
build
key: docusaurus-build-${{ matrix.environment }}-${{ github.head_ref || github.ref_name }}
fail-on-cache-miss: true

- name: Setup awscli
Expand Down Expand Up @@ -292,10 +320,10 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Restore build from cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: "./build"
key: "${{ github.sha }}-${{ github.run_id }}-build-doc-staging"
Expand Down Expand Up @@ -324,10 +352,10 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Restore build from cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: "./build"
key: "${{ github.sha }}-${{ github.run_id }}-build-doc-next"
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let you know so that you can rebase it.

To understand how the documentation is structured, you may have a look to the
[Docusaurus project](https://docusaurus.io/).
We're using version 2.
We're using version 3.

### Pull request guidelines

Expand All @@ -57,17 +57,17 @@ set by the existing documentation.

## How to build the documentation locally

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.

### Which branch should I base my PRs on?

Use branch **staging**. We will merge the PR into production once it has gone through the validation process.

### Prerequisites

1. Install **yarn**. On Windows: https://classic.yarnpkg.com/latest.msi
1. Install [**pnpm** (version 9)]: https://pnpm.io/installation

2. Install **node.js** (version 14 minimum): https://nodejs.org/en/download/
2. Install **node.js** (version 18 minimum): https://nodejs.org/en/download/

3. Clone the repository :

Expand All @@ -85,28 +85,28 @@ Use branch **staging**. We will merge the PR into production once it has gone th
git checkout <name_of_branch>
```

4. Install dependencies:
5. Install dependencies:

```
yarn install --frozen-lockfile
pnpm install --frozen-lockfile
```

### Building the documentation website

* Build the EN or FR version of the site (faster)

* EN: ```yarn start```
* FR: ```yarn start --locale=fr```
* EN: ```pnpm start```
* FR: ```pnpm start --locale=fr```

The website opens in your browser at the following address: http://localhost:3000/. Most changes are reflected live without having to restart the server.

* If you really need to build the whole website, use the following command (but be aware it takes a long time to build):

```
yarn build
pnpm build
```

Then use the `npm run serve` command to open the website in your browser.
Then use the `pnpm run serve` command to open the website in your browser.

## Adding files to the table of contents

Expand Down
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

14 changes: 7 additions & 7 deletions cloud/alerts-notifications/notif-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ Resources are checked according to the following parameters:

| Macro | Description | Example |
| ----- | ----------- |-------- |
|{{NOTIFICATIONTYPE}}| **Recovery**, **Warning**, **Critical** or **Unknown** for a service; **Recovery**, **Down** or **Unreachable** for a host. | CRITICAL |
{{NAME}}| The name of the service or host. For a service, the name of the host it is attached to is also given. | central/proc-ntpd |
{{ID}}| An internal ID for the resource. This can be used for API calls. | 41:209 |
{{STATE}}| The [status](./concepts.md) that the resource has just entered. | CRITICAL |
{{SHORTDATETIME}}| Date and time in the following format: MM/DD/YY h:mm:ss | 10/18/23 12:20:42 |
{{LONGDATETIME}}| Date and time, including the day of the week. | Wednesday October 18, 2023, 12:20:42 |
{{OUTPUT}}| The output of the check command, i.e. the text that is displayed in the **Information** column in the **Resources status** page. | CRITICAL: Number of current processes running: 0 |
|\{\{NOTIFICATIONTYPE\}\}| **Recovery**, **Warning**, **Critical** or **Unknown** for a service; **Recovery**, **Down** or **Unreachable** for a host. | CRITICAL |
\{\{NAME\}\}| The name of the service or host. For a service, the name of the host it is attached to is also given. | central/proc-ntpd |
\{\{ID\}\}| An internal ID for the resource. This can be used for API calls. | 41:209 |
\{\{STATE\}\}| The [status](./concepts.md) that the resource has just entered. | CRITICAL |
\{\{SHORTDATETIME\}\}| Date and time in the following format: MM/DD/YY h:mm:ss | 10/18/23 12:20:42 |
\{\{LONGDATETIME\}\}| Date and time, including the day of the week. | Wednesday October 18, 2023, 12:20:42 |
\{\{OUTPUT\}\}| The output of the check command, i.e. the text that is displayed in the **Information** column in the **Resources status** page. | CRITICAL: Number of current processes running: 0 |

3. Click the **Save** button at the top right of the panel. The new notification rule appears in the list. You may have to wait up to 5 minutes before the rule starts being applied.
2 changes: 1 addition & 1 deletion cloud/alerts-notifications/resources-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ Graphs display metric evolution over a given period. This can be defined in the

- A selection of preconfigured periods is available in the graph header: Last Day, Last 7 Days, Last 31 Days
- Datetime pickers are available for Start and End points in time. Whenever the displayed period changes, this element is updated accordingly
- Using the side [<] and [>] buttons that appear upon hovering the graph's border, you can translate in time by half your current timespan (backward and forward in time, respectively)
- Using the side [\<] and [>] buttons that appear upon hovering the graph's border, you can translate in time by half your current timespan (backward and forward in time, respectively)
- Selecting a period of time within the graph will zoom in on this period

![image](../assets/alerts/resources-status/resources-status-graph-time-selection.gif)
Expand Down
5 changes: 5 additions & 0 deletions cloud/installation/_move-resources.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Go to **Configuration > Hosts > Hosts**.
2. Use the **Poller** list to display only the resources monitored by the poller you want.
3. Select all hosts using the check box in the left column header.
4. Select **More actions > Mass change** and edit the **Monitoring server** field in the configuration form.
5. [Deploy the configuration](../monitoring/monitoring-servers/deploying-a-configuration.md) for both pollers.
25 changes: 25 additions & 0 deletions cloud/installation/poller-migrate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
id: poller-migrate
title: Migrating a poller to another host machine
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import MoveResources from './_move-resources.mdx';

In some cases you might want to change the OS of the host machine for your poller. The correct procedure for this is to install a new server and migrate your resources to it.

1. Install a new host machine for your poller as per our [prerequisites](prerequisites.md).
2. [Deploy the poller](deploy-poller.md) to the new machine.
3. Copy the configuration for the following elements from the old poller to the new one:

- Custom plugins (example: community plugins, or custom developments)
- If you are using the **centreon-as400** connector (installation and configuration): **/etc/centreon-as400/**.

4. Move all the resources you want to the new poller.

<MoveResources />

The resources are now monitored by the new poller: the services monitored by this poller are moved to the other poller automatically.

5. [Remove the old poller](poller-remove.md) from your architecture.
19 changes: 19 additions & 0 deletions cloud/installation/poller-monitor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
id: poller-monitor
title: Monitoring your pollers
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

The best practice is to have a poller monitor another poller (i.e. no poller should be monitored by itself).

## Monitoring a Centreon Cloud poller

To monitor a poller in your Centreon platform:

1. Install the [**Centreon Poller** monitoring connector](/pp/integrations/plugin-packs/procedures/applications-monitoring-centreon-poller/).
2. [Create a host](../monitoring/basic-objects/hosts.md):
* Apply the **App-Monitoring-Centreon-Poller-custom** template to it.
* Select another poller from the **Monitoring server** list.
3. [Deploy the configuration](../monitoring/monitoring-servers/deploying-a-configuration.md). Your new host appears in the [Resource status](../alerts-notifications/resources-status.md) page.
20 changes: 20 additions & 0 deletions cloud/installation/poller-remove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
id: poller-remove
title: Removing a poller from your architecture
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import MoveResources from './_move-resources.mdx';

> In order to ensure the stability and integrity of your monitoring environment, do not delete the central poller. The central poller plays a critical role in the overall operation of the Centreon platform. Removing it can lead to unintended disruptions in service. We are in the process of implementing safeguards to prevent the accidental deletion of the central poller.
To remove a poller from your Centreon architecture:

1. If you haven't already done so, move the resources that the poller used to monitor to another poller:

<MoveResources />

The services monitored by this poller are moved to the other poller automatically.
3. On the **Configuration > Pollers > Pollers** page, select the poller you want to remove, then click **Delete**. The poller disappears from the list of pollers.
4. [Deploy the configuration](../monitoring/monitoring-servers/deploying-a-configuration.md) for the central server. The poller is removed for good. This cannot be undone.
Loading

0 comments on commit 096c413

Please sign in to comment.