Comments (5)
Icinga2 should error and not add the service causing icinga2 to fail.
What exactly do you mean by fail?
{"results":[{"code":500.0,"errors":["Error: Validation failed for object 'hostname.com!ssh' of type 'Service'; Attribute 'host_name': Object 'hostname.com' of type 'Host' does not exist.\nLocation: in /var/lib/icinga2/api/packages/_api/localhost-1495214738-1/conf.d/services/hostname.com!ssh.conf: 6:2-6:37"],"status":"Object could not be created."}]
That looks like an error you'll receive as an API response when attempting to create a service on a non-existing host. What behavior would you expect instead?
from icinga2.
That is the error I received on an older version of icinga2 (icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.5-1)). I expected the new version to behave the same.
from icinga2.
So what exactly is the behavior with 2.14.2? I'm missing a description of that behavior, that's probably why I overlooked that you wrote this under "expected behavior".
from icinga2.
You should be able to recreate the bug if you run the following 2 commands:
- Create a host via the API to a hostgroup that does not exist
curl -k -u user:password -X PUT 'https://localhost:5665/v1/objects/hosts/hostname1' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"attrs":{"groups":["NoGroup"],"display_name":"hostname1","vars":{"host_name":"hostname1"}}, "templates":["generic-host"]}'
{"results":[{"code":500,"errors":["Error: Validation failed for object 'hostname1' of type 'Host'; Attribute 'groups': Object 'NoGroup' of type 'HostGroup' does not exist.\nLocation: in /var/lib/icinga2/api/packages/_api/e55a066a-19ab-4f1a-aa62-b2304fb5d858/conf.d/hosts/hostname1.conf: 5:2-5:23"],"status":"Object could not be
- Create a service on the host above hostname1 even though it is not in icinga2
curl -k -u user:password -X PUT 'https://localhost:5665/v1/objects/services/hostname1!ssh' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"templates":["generic-service"],"attrs":{"check_command":"ssh","display_name":"SSH"}}'
curl: (56) OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0
The service file is created in icinga2 even though host does not exist. This causes the icinga2 service to fail.
[development] /var/lib/icinga2/api/packages/_api/e55a066a-19ab-4f1a-aa62-b2304fb5d858/conf.d/services # ls
'hostname1!ssh.conf'
from icinga2.
Related Issues (20)
- Missing argument for ITL command `mysql_query`
- Missing argument "-X" for ITL command mail-host-notification
- icinga2 API call example error in documentation
- Missing notification contacts for objects/hosts and object/services query endpoint HOT 2
- Custom variable "var.max_check_attempts" don't apply anymore HOT 1
- Runtime created objects don't get synced
- Child host becomes unreachable in redundant group when parent is unreachable HOT 2
- The version of the master is not the latest release
- Plugin-Output "Output unavailable" on Windows, if antiVirus-software kills process (e.g. PowerShell) HOT 1
- [ITL] to extend the output of "icinga" check command
- API object deletion unreliable if HA zone is not connected
- Add an option for node setup to remove the default global zones
- CSR Auto sign in multi domain Setup failes with stacktrace HOT 3
- Missing notification after recovery outside the time period HOT 6
- Icinga APİ execution command bug HOT 3
- IDO isn't updating host contacts if new contact is added to contact group
- Endpoints may miss events during initial config sync/replay logs
- Icinga2 fails to build against LibreSSL 3.8.3 HOT 1
- Checks executed twice and no recovery notifications are sent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icinga2.