Skip to content

Commit

Permalink
Remove the perfdata data_source
Browse files Browse the repository at this point in the history
Fix #3

The üerformance data with the label data_source can not be evaluated by icinga.
  • Loading branch information
Josef-Friedrich committed Feb 19, 2024
1 parent d089418 commit 62fd828
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- Remove performance data `data_source`

## [3.1.0] - 2024-01-04

### Added
Expand Down
8 changes: 0 additions & 8 deletions check_systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,13 +1038,6 @@ def probe(self) -> typing.Generator[Metric, None, None]:
)


class PerformanceDataDataSourceResource(Resource):
def probe(self) -> typing.Generator[Metric, None, None]:
yield Metric(
name="data_source", value=opts.data_source, context="performance_data"
)


class PerformanceDataContext(Context):
def __init__(self):
super(PerformanceDataContext, self).__init__("performance_data")
Expand Down Expand Up @@ -1464,7 +1457,6 @@ def main():
if opts.performance_data:
tasks += [
PerformanceDataResource(),
PerformanceDataDataSourceResource(),
PerformanceDataContext(),
]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_option_ignore_inactive_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_with(self) -> None:
result.assert_ok()
result.assert_first_line(
"SYSTEMD OK - ansible-pull.service: inactive | "
"count_units=2 data_source=cli startup_time=12.345;60;120 "
"count_units=2 startup_time=12.345;60;120 "
"units_activating=0 units_active=1 units_failed=0 units_inactive=1"
)

Expand All @@ -24,7 +24,7 @@ def test_ok(self) -> None:
result.assert_ok()
result.assert_first_line(
"SYSTEMD OK - ansible-pull.service: inactive | "
"count_units=2 data_source=cli startup_time=12.345;60;120 "
"count_units=2 startup_time=12.345;60;120 "
"units_activating=0 units_active=1 units_failed=0 units_inactive=1"
)

Expand Down
5 changes: 2 additions & 3 deletions tests/test_performance_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_ok(self) -> None:
result.assert_ok()
result.assert_first_line(
"SYSTEMD OK - all "
"| count_units=386 data_source=cli startup_time=12.345;60;120 "
"| count_units=386 startup_time=12.345;60;120 "
"units_activating=0 "
"units_active=275 units_failed=0 units_inactive=111"
)
Expand All @@ -26,7 +26,7 @@ def test_dead_timers(self) -> None:
result.assert_critical()
result.assert_first_line(
"SYSTEMD CRITICAL - phpsessionclean.timer "
"| count_units=3 data_source=cli startup_time=12.345;60;120 "
"| count_units=3 startup_time=12.345;60;120 "
"units_activating=0 "
"units_active=3 units_failed=0 units_inactive=0"
)
Expand All @@ -42,7 +42,6 @@ def test_options_exclude(self) -> None:
result.assert_critical()
result.assert_first_line(
"SYSTEMD CRITICAL - smartd.service: failed | count_units=3 "
"data_source=cli "
"startup_time=12.345;60;120 "
"units_activating=0 units_active=1 units_failed=1 "
"units_inactive=1"
Expand Down

0 comments on commit 62fd828

Please sign in to comment.