Skip to content

Commit 180da92

Browse files
authored
Merge branch 'develop' into MON-155920
2 parents 70f4e5e + 8c2c91d commit 180da92

415 files changed

Lines changed: 56507 additions & 2684 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
* @centreon/owners-connectors
1+
* @centreon/owners-connectors
22

3-
*.md @centreon/owners-doc
4-
*.mdx @centreon/owners-doc
3+
*.md @centreon/owners-doc
4+
*.mdx @centreon/owners-doc
55

6-
*.cmake @centreon/owners-cpp
7-
CMakeLists.txt @centreon/owners-cpp
8-
Makefile @centreon/owners-cpp
6+
*.cmake @centreon/owners-cpp
7+
CMakeLists.txt @centreon/owners-cpp
8+
Makefile @centreon/owners-cpp
99

10-
*.pm @centreon/owners-perl
11-
*.pl @centreon/owners-perl
12-
*.t @centreon/owners-perl
10+
*.pm @centreon/owners-perl
11+
*.pl @centreon/owners-perl
12+
*.t @centreon/owners-perl
1313

14-
*.py @centreon/owners-python
14+
*.py @centreon/owners-python
1515

16-
*.sh @centreon/owners-bash
16+
*.sh @centreon/owners-bash
1717

18-
tests/** @centreon/owners-robot-e2e
18+
tests/** @centreon/owners-robot-e2e
1919

20-
.github/** @centreon/owners-pipelines
21-
packaging/** @centreon/owners-perl
22-
selinux/** @centreon/owners-pipelines
23-
.github/scripts/pod_spell_check.t @centreon/owners-perl
20+
.github/** @centreon/owners-pipelines
21+
packaging/** @centreon/owners-perl
22+
selinux/** @centreon/owners-pipelines
23+
.github/scripts/pod_spell_check.t @centreon/owners-perl
24+
25+
.gitleaks.toml @centreon/owners-security
26+
.gitleaksignore @centreon/owners-security
27+
**/checkmarx-analysis.yml @centreon/owners-security
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug report
3+
about: Create a report for an issue or a bug
4+
title: '[path::to::the::plugin]: <title>'
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Thank you for using Centreon plugins!
11+
12+
Please use this form for actual **bugs** only. See the **Other requests** form for more details.
13+
All existing and future issues related to questions, new plugins or enhancements will be closed.
14+
15+
# Bug report
16+
17+
If you are certain it is a bug, please ensure that there aren't any [similar issues already open](https://github.com/centreon/centreon-plugins/issues) on the same bug.
18+
If the same bug has already been logged, please close your issue and add a comment pointing to the existing one instead.
19+
20+
**For the sake of clarity, please remove the explanations from the issue template before submitting your issue.**
21+
22+
## Quick description
23+
24+
*In one or two sentences, what is your bug about?*
25+
26+
## How to reproduce
27+
28+
*Please provide the initial conditions to reproduce the bug down below*
29+
30+
- **Environment**: result of `uname -a ; cat /etc/redhat-release /etc/debian_version`.
31+
- **Version of the plugin**: version of the package or last commit date if using a clone of this repository.
32+
- **Information about the monitored resource**: the exact model and version of the device, software or product you are trying to monitor.
33+
- **Command line**: the command line that is used.
34+
35+
## Expected result
36+
37+
*What you were expecting to have as a result (output, exit return)?*
38+
39+
## Actual result
40+
41+
*What you actually got. Please put emphasis on what seems wrong to you.*
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Other requests
3+
about: For other requests such as questions or enhancement requests, take a look at this form.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Thank you for using Centreon plugins!
11+
12+
# Other requests
13+
14+
## Questions
15+
16+
If you have trouble using our plugins, but are not sure whether it's due to a bug or a misuse, please take the time to ask for help on [The Watch, Data Collection section](https://thewatch.centreon.com/data-collection-6) and become certain that it is a bug before submitting it here.
17+
18+
## New Plugins and modes
19+
20+
There is high demand for new plugins and new functionalities on existing plugins, so we have to rely on our community to help us prioritize them.
21+
How? Post your suggestion on [The Watch Ideas](https://thewatch.centreon.com/ideas) with as much detail as possible and we will pick the most voted topics to add them to our product roadmap.
22+
23+
To develop a plugin/mode, we need the following information, depending on the protocol:
24+
* **SNMP**: MIB files and full snmpwalk of enterprise branch (`snmpwalk -ObentU -v 2c -c public address .1.3.6.1.4.1 > equipment.snmpwalk`) or [SNMP collections](https://thewatch.centreon.com/product-how-to-21/snmp-collection-tutorial-132).
25+
* **HTTP API (SOAP, Rest/Json, XML-RPC)**: the documentation and some curl examples or HTTP [collections](https://thewatch.centreon.com/data-collection-6/centreon-plugins-discover-collection-modes-131).
26+
* **CLI**: command line examples (command + result).
27+
* **SQL**: queries + results + column types or [SQL collections](https://thewatch.centreon.com/product-how-to-21/sql-collection-tutorial-134).
28+
* **JMX**: mbean names and attributes.
29+
30+
If some information is confidential, such as logins or IP addresses, obfuscate them in what is sent publicly and we'll get in touch with you by private message if this information is needed.
31+
32+
Please note that all the developments are open source, we will not commit to a release date. If it is an emergency for you, please contact [Centreon's sales team](https://www.centreon.com/contact/).
File renamed without changes.

.github/actions/merge-artifacts/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ runs:
1818
using: 'composite'
1919
steps:
2020
- name: Download Artifacts
21-
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
21+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
2222
with:
2323
pattern: ${{ inputs.source_name_pattern }}*
2424
path: ${{ inputs.target_name }}
2525
merge-multiple: true
2626

2727
- name: Upload the Regrouped Artifact
28-
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
28+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
2929
with:
3030
name: ${{ inputs.target_name }}
3131
path: |

.github/actions/package-delivery/action.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ runs:
7777
7878
- if: ${{ inputs.stability != 'stable' }}
7979
name: Restore packages from cache
80-
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
80+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
8181
with:
8282
path: ./*.${{ steps.parse-distrib.outputs.package_extension }}
8383
key: ${{ inputs.cache_key }}
@@ -107,7 +107,7 @@ runs:
107107
}
108108
109109
- name: Download packages from testing
110-
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' && inputs.distrib != 'jammy' }}
110+
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' }}
111111
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
112112
with:
113113
script: |
@@ -170,13 +170,18 @@ runs:
170170
- name: Publish packages to ${{ inputs.stability }}
171171
if: |
172172
contains(fromJson('["testing", "unstable"]'), inputs.stability) ||
173-
(inputs.stability == 'stable' && github.event_name == 'push' && inputs.distrib != 'jammy')
173+
(inputs.stability == 'stable' && github.event_name == 'push')
174174
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
175175
with:
176176
script: |
177177
const path = require('path');
178178
const globber = await glob.create('*.${{ steps.parse-distrib.outputs.package_extension }}');
179179
180+
let stableRpmSubdirectory = '';
181+
if ('${{ inputs.stability }}' === 'stable') {
182+
stableRpmSubdirectory = 'RPMS/';
183+
}
184+
180185
const debTargetProps = '${{ inputs.stability }}' == 'testing' ? '--target-props "release_type=${{ inputs.release_type }}"' : '';
181186
182187
for await (const file of globber.globGenerator()) {
@@ -188,7 +193,7 @@ runs:
188193
arch = 'x86_64';
189194
}
190195
await exec.exec(
191-
`jf rt upload "${fileName}" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/${arch}/${{ inputs.module_name }}/" --flat`
196+
`jf rt upload "${fileName}" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/${arch}/${stableRpmSubdirectory}${{ inputs.module_name }}/" --flat`
192197
);
193198
} else if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'deb') {
194199
let arch = 'all';

.github/actions/package-nfpm/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ runs:
122122
done
123123
shell: bash
124124

125-
- uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
125+
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
126126
with:
127127
path: ./*.${{ inputs.package_extension }}
128128
key: ${{ inputs.cache_key }}
129129

130130
# Add to your PR the label upload-artifacts to get packages as artifacts
131131
- if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
132132
name: Upload package artifacts
133-
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
133+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
134134
with:
135135
name: packages-${{ inputs.distrib }}
136136
path: ./*.${{ inputs.package_extension}}

.github/actions/parse-distrib/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ runs:
5454
PACKAGE_DISTRIB_NAME="0ubuntu.22.04"
5555
PACKAGE_EXTENSION="deb"
5656
DISTRIB_FAMILY="ubuntu"
57+
elif [[ "${{ inputs.distrib }}" == "noble" ]]; then
58+
PACKAGE_DISTRIB_SEPARATOR="-"
59+
PACKAGE_DISTRIB_NAME="0ubuntu.24.04"
60+
PACKAGE_EXTENSION="deb"
61+
DISTRIB_FAMILY="ubuntu"
5762
else
5863
echo "::error::Distrib ${{ inputs.distrib }} cannot be parsed"
5964
exit 1

.github/actions/promote-to-stable/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ runs:
6666
shell: bash
6767

6868
- name: Promote DEB package to stable
69-
if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy"]'), inputs.distrib) }}
69+
if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy", "noble"]'), inputs.distrib) }}
7070
run: |
7171
set -eux
7272
7373
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
7474
echo "[DEBUG] - Distrib: ${{ inputs.module }}"
7575
76-
if [[ "${{ inputs.distrib }}" == "jammy" ]]; then
76+
if [[ "${{ inputs.distrib }}" == "jammy" || "${{ inputs.distrib }}" == "noble" ]]; then
7777
repo="ubuntu-plugins"
7878
else
7979
repo="apt-plugins"
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: "test-cpan-libs"
2+
description: "Test packaged CPAN libraries"
3+
inputs:
4+
package_extension:
5+
description: "The package extension (deb or rpm)"
6+
required: true
7+
distrib:
8+
description: "The distribution name"
9+
required: true
10+
arch:
11+
description: "The architecture (amd64 or arm64)"
12+
required: true
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
18+
- if: ${{ inputs.package_extension == 'rpm' }}
19+
name: Install zstd, perl and Centreon repositories
20+
run: |
21+
dnf install -y zstd perl epel-release 'dnf-command(config-manager)' perl-App-cpanminus
22+
dnf config-manager --set-enabled powertools || true # alma 8
23+
dnf config-manager --set-enabled crb || true # alma 9
24+
# Import Centreon GPG key
25+
GPG_KEY_URL="https://yum-gpg.centreon.com/RPM-GPG-KEY-CES"
26+
curl -sSL $GPG_KEY_URL -o RPM-GPG-KEY-CES
27+
rpm --import RPM-GPG-KEY-CES
28+
shell: bash
29+
30+
- if: ${{ inputs.package_extension == 'deb' }}
31+
name: Install zstd, perl and Centreon repositories
32+
run: |
33+
export DEBIAN_FRONTEND=noninteractive
34+
apt-get update
35+
apt-get install -y zstd perl wget gpg apt-utils procps build-essential cpanminus
36+
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
37+
# Avoid apt to clean packages cache directory
38+
rm -f /etc/apt/apt.conf.d/docker-clean
39+
apt-get update
40+
shell: bash
41+
42+
- name: Restore packages from cache
43+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
44+
with:
45+
path: ./*.${{ inputs.package_extension }}
46+
key: ${{ github.sha }}-${{ github.run_id }}-${{ inputs.package_extension }}-${{ inputs.distrib }}
47+
fail-on-cache-miss: true
48+
49+
- if: ${{ inputs.package_extension == 'rpm' }}
50+
name: Check packages installation / uninstallation
51+
run: |
52+
error_log="install_error_${{ inputs.distrib }}_${{ inputs.arch }}.log"
53+
for package in ./*.rpm; do
54+
echo "Installing package: $package"
55+
# List dependencies, and remove version and comparison operators
56+
dependencies=$(rpm -qpR $package | sed 's/ [0-9.-]*\(\s\|$\)/ /g' | sed 's/ [<>!=]*\(\s\|$\)/ /g')
57+
for dependency in $dependencies; do
58+
# Skip non-perl dependencies
59+
if [[ $dependency != perl* ]]; then
60+
continue
61+
else
62+
echo "Check dependency: $dependency"
63+
# Update the dependency name to match the package name
64+
dependency=$(echo $dependency | sed 's/(/-/g' | sed 's/)//g' | sed 's/::/-/g')
65+
fi
66+
# If the dependency has been built in the same workflow, install it
67+
if [[ -n $(find . -maxdepth 1 -regex "\.\/$dependency-[0-9v].*\.rpm") ]]; then
68+
echo "Installing dependency: $dependency"
69+
error_output=$(dnf install -y ./$dependency*.rpm 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the dependency $dependency" >> $error_log; true; }
70+
fi
71+
done
72+
# Install package, then uninstall it with all his dependencies
73+
echo "Package installation..."
74+
error_output=$(dnf install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
75+
echo "Package installation done."
76+
script_name=$(echo $package | tr '[:upper:]' '[:lower:]' | sed 's/\.\/perl-//' | sed 's/-[0-9\.-]*.el[0-9]..*.rpm//')
77+
if [[ -f ./tests/cpan-libraries/$script_name.pl ]]; then
78+
echo "Testing package..."
79+
error_output=$(perl tests/cpan-libraries/$script_name.pl 2>&1) || { echo "$error_output" >> $error_log; echo "Error during the usage test of the package $package" >> $error_log; true; }
80+
echo "Testing done."
81+
else
82+
echo "No test script found for the package $package"
83+
fi
84+
echo "Package uninstallation..."
85+
error_output=$(dnf autoremove --setopt=keepcache=True -y $(echo $package | sed 's/_[0-9].*\.rpm//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
86+
echo "Package uninstallation done."
87+
done
88+
# If the file error_log exists and is not empty, the workflow is in error
89+
if [[ -s $error_log ]]; then
90+
cat $error_log
91+
exit 1
92+
fi
93+
shell: bash
94+
95+
- if: ${{ inputs.package_extension == 'deb' }}
96+
name: Check packages installation / uninstallation
97+
run: |
98+
error_log="install_error_${{ inputs.distrib }}_${{ inputs.arch }}.log"
99+
for package in ./*.deb; do
100+
# If the debian package name ends with amd64 or arm64, we only install it if the tested architecture is the same, otherwise we skip it
101+
if [[ $package == *amd64.deb && ${{ inputs.arch }} != "amd64" || $package == *arm64.deb && ${{ inputs.arch }} != "arm64" ]]; then
102+
continue
103+
fi
104+
echo "Installing package: $package"
105+
# List dependencies
106+
dependencies=$(dpkg-deb -I $package | grep Depends | sed 's/Depends: //' | sed 's/,//g' | sed 's/(\(.*\)//g') || { echo "$error_output" >> $error_log; echo "Error while listing dependencies of the package $package" >> $error_log; true; }
107+
for dependency in $dependencies; do
108+
# If the dependency exists in the Debian repository, don't check the local dependencies
109+
dependency_info=$(apt-cache policy $dependency)
110+
if [[ -n $dependency_info ]]; then
111+
echo "Dependency $dependency exists in debian repository."
112+
else
113+
# If the dependency has been built in the same workflow, install it
114+
for dependency_package in $(find . -maxdepth 1 -regex "\.\/${dependency}_[0-9].*all\.deb" -o -regex "\.\/${dependency}_[0-9].*${{ inputs.arch }}\.deb"); do
115+
echo "Installing dependency: $dependency_package"
116+
error_output=$(apt-get install -y ./$dependency_package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the dependency $dependency" >> $error_log; true; }
117+
done
118+
fi
119+
done
120+
# Install package, then uninstall it with all his dependencies
121+
echo "Package installation..."
122+
error_output=$(apt-get install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
123+
echo "Package installation done."
124+
script_name=$(echo $package | sed 's/.\/lib//' | sed 's/-perl_[0-9\.-]*-deb.*\.deb//')
125+
if [[ -f ./tests/cpan-libraries/$script_name.pl ]]; then
126+
echo "Testing package..."
127+
error_output=$(perl tests/cpan-libraries/$script_name.pl 2>&1) || { echo "$error_output" >> $error_log; echo "Error during the usage test of the package $package" >> $error_log; true; }
128+
echo "Testing done."
129+
else
130+
echo "No test script found for the package $package"
131+
fi
132+
echo "Package uninstallation..."
133+
error_output=$(apt-get autoremove -y --purge $(echo $package | sed 's/_[0-9].*\.deb//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
134+
echo "Package uninstallation done."
135+
done
136+
# If the file error_log exists and is not empty, the workflow is in error
137+
if [[ -s $error_log ]]; then
138+
cat $error_log
139+
exit 1
140+
fi
141+
shell: bash

0 commit comments

Comments
 (0)