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

[dev.icinga.com #13421] API max_check_attempts validation #4832

Closed
icinga-migration opened this issue Dec 6, 2016 · 0 comments
Closed

[dev.icinga.com #13421] API max_check_attempts validation #4832

icinga-migration opened this issue Dec 6, 2016 · 0 comments
Assignees
Labels
area/api REST API area/configuration DSL, parser, compiler, error handling bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/13421

Created by andyb2000 on 2016-12-06 10:39:03 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-12-06 10:39:03 +00:00 (in Redmine)

Icinga Version: r2.5.4-1
Backport?: Not yet backported
Include in Changelog: 1

I believe this could do with input validation when creating a service via the API.
Creating it using the command:

/usr/bin/curl -k -s -u myuser:mypass -H 'Accept: application/json' -X  PUT  "https://localhost:5665/v1/objects/services/HOSTNAME!SVC-ID1234" -d '{ "templates" : [ "linux-nonessential-server" ] ,  "attrs" : { "check_command" : "dummy" , "display_name" : "$in_service", "enable_active_checks" : "0", "max_check_attempts" : "0" }}'

Is accepted by the API and doesn't cause any issues on icingaweb2, etc, however for any classic interfaces (those that use /var/cache/icinga2/objects.cache) the value of 0 for max_check_attempts appears invalid and causes them to fail to load.
Changing this posted value to 1 solves this issue, however I believe the service shouldn't be created/should be rejected with an invalid value error.

See discussion at: https://monitoring-portal.org/index.php?thread/39184-dynamic-service-creation-api-and-classicui-json-errors/

Thank you

@icinga-migration icinga-migration added bug Something isn't working area/api REST API labels Jan 17, 2017
@dnsmichi dnsmichi self-assigned this Feb 6, 2017
@dnsmichi dnsmichi added the area/configuration DSL, parser, compiler, error handling label Feb 6, 2017
@dnsmichi dnsmichi added this to the 2.7.0 milestone Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API area/configuration DSL, parser, compiler, error handling bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants