sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
406 stars 147 forks source link

Service parents are not validated correctly #1376

Closed imre-sidn closed 1 month ago

imre-sidn commented 2 months ago

Describe the bug Service parents are documented in the service object type definition. According to that documentation, it should be possible to configure the child service with one or more parent service tuples in the form _hostname,servicedescription. This works, I can create a parent-child relation between a service on host A and another service on host B, and Thruk correctly displays this in the Service Information page of the child service. Naemon correctly disables checks of the child service if the parent service is unavailable.

The problem is that the validation logic in Thruk does not recognize this as a valid reference. The Cross Reference Check for example lists such a reference as an improvement with message 'referenced service 'ams-ix.net,PING' does not exist'. The same error is seen in the Config Parse Errors overview in the Apply tab of the Config Tool.

Thruk Version 3.14.2

To Reproduce Steps to reproduce the behavior:

  1. Check that the ams-ix.net,PING service exists: https://demo.thruk.org/demo/thruk/cgi-bin/extinfo.cgi?type=2&host=ams-ix.net&service=PING&backend=40863
  2. Go to https://demo.thruk.org/demo/thruk/cgi-bin/conf.cgi?sub=objects&tools=ObjectReferences, or https://demo.thruk.org/demo/thruk/cgi-bin/conf.cgi?sub=objects&apply=yes
  3. See error 'referenced service 'ams-ix.net,PING' does not exist'

Expected behavior Thruk should recognize the _hostname,servicedescription tuple format and not display the error described above.

Screenshots image image image

sni commented 1 month ago

thanks for reporting this, should be fine now.

imre-sidn commented 1 month ago

Tried your patch on a test system and reloaded httpd, works perfectly now. Thanks a lot!