Skip to content

Commit 36b29b3

Browse files
authored
Merge branch 'develop' into new-centreon-log-management-plugin
2 parents c77c20a + ce4a7b7 commit 36b29b3

File tree

23 files changed

+250
-116
lines changed

23 files changed

+250
-116
lines changed

.github/workflows/nrpe.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
needs.get-environment.outputs.skip_workflow == 'false' &&
3333
needs.get-environment.outputs.stability != 'stable'
3434
runs-on: ubuntu-24.04
35+
env:
36+
nrpe_official_version: "4.1.3"
37+
3538
strategy:
3639
fail-fast: false
3740
matrix:
@@ -69,8 +72,10 @@ jobs:
6972

7073
- name: Download nrpe sources
7174
run: |
72-
curl -sLo - "https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-${{ needs.get-environment.outputs.version }}/nrpe-${{ needs.get-environment.outputs.version }}.tar.gz" | tar zxpf -
73-
mv nrpe-${{ needs.get-environment.outputs.version }} nrpe-src
75+
# Pinning latest known release assets here instead of using get-environment output version
76+
# since NRPE versioning is not in line with standard centreon plugins versioning
77+
curl -sLo - "https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-${{ env.nrpe_official_version }}/nrpe-${{ env.nrpe_official_version }}.tar.gz" | tar zxpf -
78+
mv nrpe-${{ env.nrpe_official_version }} nrpe-src
7479
shell: bash
7580

7681
- name: Compile sources

.github/workflows/plugins-robot-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262

6363
- name: Load image
6464
run: |
65+
docker image prune -af
6566
docker pull ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{inputs.image}}
6667
shell: bash
6768

.github/workflows/plugins.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ jobs:
244244
fail-on-cache-miss: true
245245

246246
- name: Prepare FatPacker
247-
uses: shogo82148/actions-setup-perl@f9f0bf89e0d19ddbabb2f40d43db2e944bce7d2f # v1.36.0
247+
uses: shogo82148/actions-setup-perl@b6cfc127f1b0a63ac98797800f641494d80f42f8 # v1.37.1
248248
with:
249249
perl-version: '5.34'
250250
install-modules-with: cpm

.github/workflows/spellchecker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- added|modified: 'src/**/*.pm'
3535
3636
- name: Install CPAN Libraries
37-
uses: shogo82148/actions-setup-perl@f9f0bf89e0d19ddbabb2f40d43db2e944bce7d2f # v1.36.0
37+
uses: shogo82148/actions-setup-perl@b6cfc127f1b0a63ac98797800f641494d80f42f8 # v1.37.1
3838
with:
3939
perl-version: '5.34'
4040
install-modules-with: cpm

nrpe/packaging/centreon-nrpe3-daemon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "centreon-nrpe3-daemon"
22
arch: "amd64"
33
platform: "linux"
44
version_schema: "none"
5-
version: "4.1.0"
5+
version: "4.1.3"
66
release: "${RELEASE}${DIST}"
77
section: "default"
88
priority: "optional"

nrpe/packaging/centreon-nrpe3-plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "centreon-nrpe3-plugin"
22
arch: "amd64"
33
platform: "linux"
44
version_schema: "none"
5-
version: "4.1.0"
5+
version: "4.1.3"
66
release: "${RELEASE}${DIST}"
77
section: "default"
88
priority: "optional"

nrpe/packaging/centreon-nrpe4-daemon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "centreon-nrpe4-daemon"
22
arch: "amd64"
33
platform: "linux"
44
version_schema: "none"
5-
version: "4.1.0"
5+
version: "4.1.3"
66
release: "${RELEASE}${DIST}"
77
section: "default"
88
priority: "optional"

src/apps/apache/serverstatus/mode/slotstates.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2024 Centreon (http://www.centreon.com/)
2+
# Copyright 2026-Present Centreon (http://www.centreon.com/)
33
#
44
# Centreon is a full-fledged industry-strength solution that meets
55
# the needs in IT infrastructure and application monitoring for
@@ -25,6 +25,7 @@ use base qw(centreon::plugins::templates::counter);
2525
use strict;
2626
use warnings;
2727
use centreon::plugins::http;
28+
use centreon::plugins::constants qw/:values :counters/;
2829

2930
sub custom_value_threshold {
3031
my ($self, %options) = @_;
@@ -79,7 +80,7 @@ sub custom_value_calc {
7980
$self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'};
8081
if ($self->{result_values}->{total} == 0) {
8182
$self->{error_msg} = "skipped";
82-
return -2;
83+
return NOT_PROCESSED;
8384
}
8485
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}};
8586
$self->{result_values}->{prct} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total};
@@ -92,7 +93,7 @@ sub set_counters {
9293
my ($self, %options) = @_;
9394

9495
$self->{maps_counters_type} = [
95-
{ name => 'global', type => 0, cb_prefix_output => 'prefix_global_output', skipped_code => { -2 => 1 } }
96+
{ name => 'global', type => COUNTER_TYPE_GLOBAL, cb_prefix_output => 'prefix_global_output', skipped_code => { NOT_PROCESSED() => 1 } }
9697
];
9798

9899
$self->{maps_counters}->{global} = [

src/apps/backup/backupexec/local/mode/jobs.pm

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2024 Centreon (http://www.centreon.com/)
2+
# Copyright 2026-Present Centreon (http://www.centreon.com/)
33
#
44
# Centreon is a full-fledged industry-strength solution that meets
55
# the needs in IT infrastructure and application monitoring for
@@ -27,6 +27,7 @@ use warnings;
2727
use centreon::common::powershell::backupexec::jobs;
2828
use apps::backup::backupexec::local::mode::resources::types qw($job_status $job_substatus $job_type);
2929
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
30+
use centreon::plugins::constants qw(:values :counters);
3031
use centreon::plugins::misc;
3132
use JSON::XS;
3233

@@ -57,9 +58,9 @@ sub custom_long_calc {
5758
$self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'};
5859
$self->{result_values}->{isActive} = $options{new_datas}->{$self->{instance} . '_isActive'};
5960

60-
return -11 if ($self->{result_values}->{isActive} != 1);
61+
return NOT_PROCESSED if ($self->{result_values}->{isActive} != 1);
6162

62-
return 0;
63+
return RUN_OK;
6364
}
6465

6566
sub prefix_job_output {
@@ -72,8 +73,8 @@ sub set_counters {
7273
my ($self, %options) = @_;
7374

7475
$self->{maps_counters_type} = [
75-
{ name => 'global', type => 0 },
76-
{ name => 'jobs', type => 1, cb_prefix_output => 'prefix_job_output', message_multiple => 'All jobs are ok', skipped_code => { -11 => 1, -10 => 1 } }
76+
{ name => 'global', type => COUNTER_TYPE_GLOBAL },
77+
{ name => 'jobs', type => COUNTER_TYPE_INSTANCE, cb_prefix_output => 'prefix_job_output', message_multiple => 'All jobs are ok', skipped_code => { NOT_PROCESSED() => 1, NO_VALUE() => 1 } }
7778
];
7879

7980
$self->{maps_counters}->{global} = [
@@ -88,7 +89,7 @@ sub set_counters {
8889
];
8990

9091
$self->{maps_counters}->{jobs} = [
91-
{ label => 'status', type => 2, critical_default => 'not %{status} =~ /succeeded/i', set => {
92+
{ label => 'status', type => COUNTER_KIND_TEXT, critical_default => 'not %{status} =~ /succeeded/i', set => {
9293
key_values => [
9394
{ name => 'name' }, { name => 'type' },
9495
{ name => 'status' }, { name => 'subStatus' },
@@ -99,7 +100,7 @@ sub set_counters {
99100
closure_custom_threshold_check => \&catalog_status_threshold_ng
100101
}
101102
},
102-
{ label => 'long', type => 2, set => {
103+
{ label => 'long', type => COUNTER_KIND_TEXT, set => {
103104
key_values => [
104105
{ name => 'name' }, { name => 'type' },
105106
{ name => 'status' }, { name => 'subStatus' },

src/apps/backup/commvault/commserve/restapi/mode/jobs.pm

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use warnings;
2727
use Digest::MD5 qw(md5_hex);
2828
use centreon::plugins::misc qw/is_excluded/;
2929
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
30+
use centreon::plugins::constants qw(:values :counters);
3031

3132
sub custom_status_output {
3233
my ($self, %options) = @_;
@@ -70,22 +71,22 @@ sub custom_long_calc {
7071
$self->{result_values}->{elapsed} = $options{new_datas}->{$self->{instance} . '_elapsed'};
7172
$self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'};
7273

73-
return -11 if ($self->{result_values}->{status} !~ /running|queued|waiting/i);
74+
return NOT_PROCESSED if ($self->{result_values}->{status} !~ /running|queued|waiting/i);
7475

75-
return 0;
76+
return RUN_OK;
7677
}
7778

7879
sub set_counters {
7980
my ($self, %options) = @_;
8081

8182
$self->{maps_counters_type} = [
82-
{ name => 'global', type => 0 },
83-
{ name => 'policy', type => 2,
83+
{ name => 'global', type => COUNTER_TYPE_GLOBAL },
84+
{ name => 'policy', type => COUNTER_TYPE_GROUP,
8485
cb_prefix_output => 'prefix_policy_output',
8586
cb_long_output => 'policy_long_output',
8687
display_counter_problem => { nlabel => 'jobs.problems.current.count', min => 0 },
8788
message_multiple => 'All policies are ok',
88-
group => [ { name => 'job', cb_prefix_output => 'prefix_job_output', skipped_code => { -11 => 1 } } ]
89+
group => [ { name => 'job', cb_prefix_output => 'prefix_job_output', skipped_code => { NOT_PROCESSED() => 1 } } ]
8990
}
9091
];
9192

@@ -103,7 +104,7 @@ sub set_counters {
103104
$self->{maps_counters}->{job} = [
104105
{
105106
label => 'status',
106-
type => 2,
107+
type => COUNTER_KIND_TEXT,
107108
warning_default => '%{status} =~ /abnormal/i',
108109
critical_default => '%{status} =~ /errors|failed/i',
109110
set => {
@@ -114,7 +115,7 @@ sub set_counters {
114115
closure_custom_threshold_check => \&catalog_status_threshold_ng
115116
}
116117
},
117-
{ label => 'long', type => 2, set => {
118+
{ label => 'long', type => COUNTER_KIND_TEXT, set => {
118119
key_values => [
119120
{ name => 'status' }, { name => 'display' }, { name => 'elapsed' }, { name => 'type' }, { name => 'client_name' }
120121
],

0 commit comments

Comments
 (0)