Skip to content

Commit

Permalink
Fix no_checks_in_passive_mode condition (#100)
Browse files Browse the repository at this point in the history
* docs: update README.md

* fix: return the accidentally removed no_checks_in_passive_mode condition
  • Loading branch information
phsmith authored Sep 1, 2024
1 parent 8ce4a72 commit 89662a5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 96 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.8.1] - 2024-09-01
### Fixed

- Return the accidentally removed `no_checks_in_passive_mode` condition.

## [2.8.0] - 2024-08-31
### Added

Expand Down Expand Up @@ -298,7 +303,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release

[unreleased]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.0...HEAD
[unreleased]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.1...HEAD
[2.8.1]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.0...v2.8.1
[2.8.0]: https://github.com/phsmith/rundeck_exporter/compare/v2.7.1...v2.8.0
[2.7.1]: https://github.com/phsmith/rundeck_exporter/compare/v2.7.0...v2.7.1
[2.7.0]: https://github.com/phsmith/rundeck_exporter/compare/v2.6.5...v2.7.0
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This exporter uses the prometheus_client and requests Python module to expose Ru
This code was tested on Rundeck API version 31+.

> [!Warning]
> - Since version 4.x.x. the `/api/V/metrics` endpoint is disabled, so you need to enable it in `rundeck-config.properties` to get the exporter to work. See [config-file-reference.html#metrics-capturing](https://docs.rundeck.com/docs/administration/configuration/config-file-reference.html#metrics-capturing)
> - Since version 4.x.x, the `/api/<version>/metrics` endpoint is disabled, so you need to enable it in `rundeck-config.properties` or by setting the environment variable `RUNDECK_METRICS_ENABLED=true` for the exporter to work. See [config-file-reference.html#metrics-capturing](https://docs.rundeck.com/docs/administration/configuration/config-file-reference.html#metrics-capturing)
> - If audit logs are enabled, consider changing the default `INFO` log level to prevent excessive log growth.
## Metrics
Expand Down Expand Up @@ -58,11 +58,11 @@ The ACL associated with the token/user must have the following policy rules as a
* `project:read` (system context)
* `events:read` (project context)

Example ACL Policy allowing a user named "exporter" to get system metrics as well as execution metrics for any project:
Example ACL Policy allowing a user named `exporter` to get system metrics as well as execution metrics for any project:

```yaml
by:
username: user
username: exporter
description: system:read
for:
resource:
Expand All @@ -74,7 +74,7 @@ Example ACL Policy allowing a user named "exporter" to get system metrics as wel
application: rundeck
---
by:
username: user
username: exporter
description: project:read
for:
project:
Expand All @@ -86,7 +86,7 @@ context:
application: rundeck
---
by:
username: user
username: exporter
description: events:read
for:
resource:
Expand All @@ -102,7 +102,7 @@ context:
project: .*
---
by:
username: user
username: exporter
description: Allow [read] for node
for:
node:
Expand All @@ -115,7 +115,7 @@ context:

---
by:
username: user
username: exporter
description: Allow [read] for (All) node
for:
resource:
Expand Down

This file was deleted.

5 changes: 4 additions & 1 deletion rundeck_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
__author__ = 'Phillipe Smith'
__author_email__ = '[email protected]'
__app__ = 'rundeck_exporter'
__version__ = '2.8.0'
__version__ = '2.8.1'

# Disable InsecureRequestWarning
requests.urllib3.disable_warnings()
Expand Down Expand Up @@ -460,6 +460,9 @@ def collect(self):
"""
logging.debug(f'Rundeck execution mode: {execution_mode}.')

if self.args.no_checks_in_passive_mode and execution_mode == 'passive':
return

rundeck_execution_mode_active = GaugeMetricFamily(
'rundeck_execution_mode_active',
f'Rundeck Active Execution Mode Status',
Expand Down

0 comments on commit 89662a5

Please sign in to comment.