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

nagios module: Can't apply downtime due to failed type check #53150

Closed
silverwizard opened this issue Feb 28, 2019 · 3 comments
Closed

nagios module: Can't apply downtime due to failed type check #53150

silverwizard opened this issue Feb 28, 2019 · 3 comments
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bot_closed bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work module This issue/PR relates to a module. monitoring Monitoring category needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community.

Comments

@silverwizard
Copy link
Contributor

SUMMARY

The Python cast to int returns class(int) when checking if nagios module is receiving a valid number. Unfortunately there is a check to confirm that the cast worked correctly checks for type(int). This means, that, since the code is running in a try/catch, and there is a cast, the only function of the type check is to fail due to forward upgrades in python.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

nagios

ANSIBLE VERSION
ansible 2.5.1
  config file = /home/seanhoward/src/devops/ansible/ansible.cfg
  configured module search path = [u'/home/seanhoward/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0]

CONFIGURATION
ANSIBLE_PIPELINING(/home/seanhoward/src/devops/ansible/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/seanhoward/src/devops/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=60s
ANSIBLE_SSH_CONTROL_PATH(/home/seanhoward/src/devops/ansible/ansible.cfg) = %(directory)s/%%h-%%p-%%r
ANSIBLE_SSH_RETRIES(/home/seanhoward/src/devops/ansible/ansible.cfg) = 5
DEFAULT_FORKS(/home/seanhoward/src/devops/ansible/ansible.cfg) = 50
DEFAULT_MANAGED_STR(/home/seanhoward/src/devops/ansible/ansible.cfg) = This file is managed by Ansible. Manual c
DEFAULT_ROLES_PATH(/home/seanhoward/src/devops/ansible/ansible.cfg) = [u'/home/seanhoward/src/devops/ansible/gal
DEFAULT_STRATEGY(/home/seanhoward/src/devops/ansible/ansible.cfg) = free
DEFAULT_TIMEOUT(/home/seanhoward/src/devops/ansible/ansible.cfg) = 40
HOST_KEY_CHECKING(/home/seanhoward/src/devops/ansible/ansible.cfg) = False

OS / ENVIRONMENT

Replicated on
Linux seanhoward-ThinkPad-P51s 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
MacOS Mojave
Linux ast59-chartreuse-app.dev.roadmunk.com 4.14.88-88.76.amzn2.x86_64 #1 SMP Mon Jan 7 18:43:26 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

STEPS TO REPRODUCE
$check ansible -u $user -i ec2.sh -b -m nagios -a "action=downtime service=all minutes=2880 cmdfile=/var/lib/nagios3/rw/nagios.cmd host=$deployment-4-$oldcolour comment=release" "tag_primary_role_nagios"
$check ansible -u $user -i ec2.sh -b -m nagios -a "action=downtime service=host minutes=2880 cmdfile=/var/lib/nagios3/rw/nagios.cmd host=$deployment-4-$oldcolour comment=release" "tag_primary_role_nagios"
EXPECTED RESULTS

Downtime created in Nagios

ACTUAL RESULTS
nagios | FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "action": "downtime",
            "author": "Ansible",
            "cmdfile": "/var/lib/nagios3/rw/nagios.cmd",
            "command": null,
            "comment": "Scheduling downtime",
            "host": "localhost",
            "minutes": "30",
            "service": "host",
            "servicegroup": null,
            "services": "host"
        }
    },
    "msg": "invalid entry for minutes"
}
@silverwizard
Copy link
Contributor Author

#49568

Trying to get this PR looked at

@ansibot
Copy link
Contributor

ansibot commented Feb 28, 2019

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. module This issue/PR relates to a module. monitoring Monitoring category needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Feb 28, 2019
@ansibot ansibot added collection Related to Ansible Collections work collection:community.general needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 29, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 16, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this as completed Aug 16, 2020
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Aug 17, 2020
@ansible ansible locked and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bot_closed bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work module This issue/PR relates to a module. monitoring Monitoring category needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

3 participants