Skip to content

Commit

Permalink
Merge branch 'staging' into MON-19915-Update_ACL_filters
Browse files Browse the repository at this point in the history
  • Loading branch information
emgcentreon authored Dec 18, 2024
2 parents bbef210 + 7500285 commit 1b54a22
Show file tree
Hide file tree
Showing 1,702 changed files with 94,561 additions and 38,685 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 }}
78 changes: 55 additions & 23 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,13 +320,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-staging"
path: |
.docusaurus
build
key: docusaurus-build-staging-${{ github.head_ref || github.ref_name }}
fail-on-cache-miss: true

- name: Deploy to https://docs-staging.int.centreon.com
Expand All @@ -324,13 +354,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-next"
path: |
.docusaurus
build
key: docusaurus-build-next-${{ github.head_ref || github.ref_name }}
fail-on-cache-miss: true

- name: Setup awscli
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/set-pull-request-external-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: set-pull-request-external-label

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
pull_request_target:

jobs:
set-pull-request-external-label:
if: |
github.event.pull_request.head.repo.fork &&
! contains(github.event.pull_request.labels.*.name, 'external')
runs-on: ubuntu-24.04

steps:
- name: Set PR external label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const label = 'external';
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: [label]
});
} catch (e) {
core.warning(`failed to add label ${label}: ${e}`);
}
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.
11 changes: 6 additions & 5 deletions cloud/installation/deploy-poller.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ Before deploying a poller, make sure the [prerequisites](prerequisites.md) for y
2. Set the value of SELINUX to disabled (**SELINUX=disabled**).
3. Save the file and reboot the system to apply the change.

3. [On your central server](../getting-started/interface.md#accessing-the-central-servers-interface), click the arrow next to **Pollers** at the left of the header bar.
3. By default, the hostname of the machine will become the name of the poller. If you want to change the machine's hostname, use the following command: `hostnamectl set-hostname your-hostname`.

4. In the pop-up that appears, click **Copy install command**. The command is copied to your clipboard.
4. [On your central server](../getting-started/interface.md#accessing-the-central-servers-interface), click the arrow next to **Pollers** at the left of the header bar.

5. On the server that will become your poller, in your terminal, paste the install command and execute it (this should take about 10 minutes).
5. In the pop-up that appears, click **Copy install command**. The command is copied to your clipboard.

6. When this is finished, on your central server, go to **Configuration > Pollers > Pollers**. The new poller appears in the list of pollers.
* By default, the name of the poller is its hostname (this may be shortened). Click the name to rename it.
6. On the server that will become your poller, in your terminal, paste the install command and execute it (this should take about 10 minutes).

7. When this is finished, on your central server, go to **Configuration > Pollers > Pollers**. The new poller appears in the list of pollers.
* The address in the **IP Address** column is that of the poller as seen by the central server.
* The poller is not running yet (**No** in the **Is running?** column).

Expand Down
Loading

0 comments on commit 1b54a22

Please sign in to comment.