Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds not_built to jenkins build states map #730

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vafhornung
Copy link

General information

Check_MK not handling Jenkins Jobs with build result not_build correct:

Exception:KeyError (not_built)

Traceback

  File "/omd/sites/SITE/lib/python3/cmk/base/agent_based/checking/__init__.py", line 470, in get_aggregated_result
    result = _aggregate_results(
  File "/omd/sites/SITE/lib/python3/cmk/base/agent_based/checking/__init__.py", line 578, in _aggregate_results
    perfdata, results = _consume_and_dispatch_result_types(subresults)
  File "/omd/sites/SITE/lib/python3/cmk/base/agent_based/checking/__init__.py", line 622, in _consume_and_dispatch_result_types
    for subr in subresults:
  File "/omd/sites/SITE/lib/python3/cmk/base/api/agent_based/register/check_plugins.py", line 94, in filtered_generator
    for element in generator(*args, **kwargs):
  File "/omd/sites/SITE/lib/python3/cmk/base/plugins/agent_based/jenkins_jobs.py", line 163, in check_jenkins_jobs
    MAP_BUILD_STATES[job.build_result.lower()],
{'build_duration_key': 'jenkins_build_duration',
 'build_timestamp_key': 'jenkins_last_build',
 'infotext': 'State: Not built',
 'item': 'job-segment-6',
 'item_data': [(None,
                'job-segment-6',
                'notbuilt',
                100,
                1720524699.276,
                7261,
                'NOT_BUILT',
                130.836,
                1720530318)],
 'job': (None,
         'job-segment-6',
         'notbuilt',
         100,
         1720524699.276,
         7261,
         'NOT_BUILT',
         130.836,
         1720530318),
 'job_cleanup': 'notbuilt',
 'job_state': 'notbuilt',
 'now': 1720530577.4863226,
 'params': Parameters({'build_result': {'null': 0},
 'jenkins_last_build': (7200, 10800),
 'jenkins_time_since': (10800, 14400),
 'job_state': {'yellow': 0}}),
 'score_key': 'jenkins_job_score',

Proposed changes

Added state not_build to MAP_BUILD_STATES as State OK.

Copy link

github-actions bot commented Jul 9, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@vafhornung
Copy link
Author

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants