naemon / naemon-core

Networks, Applications and Event Monitor
http://www.naemon.io/
GNU General Public License v2.0
154 stars 63 forks source link

Unable to exclude the first service within a service escalation #385

Open nook24 opened 2 years ago

nook24 commented 2 years ago

Hi folks,

I noticed an issue with the parsing of service escalations. If I exclude the first service (first define service in the config files) from a service escalation, the Naemon config validation will fail with

Error: Service escalation host name or description is NULL
Error: Could not register service escalation (config file '/opt/naemon/etc/config/test.cfg', starting on line 184)
   Error processing object config files!

It is possible to "resolve" the issue, by simply moving the define service block in the config files. I have created a config file, which shows my issue: https://gist.github.com/nook24/7f6be82ac51c62750a928bfb33a89fdf

roelvanmeer commented 2 years ago

Hi! I've looked at this a bit. As far as I can see, "!CHECK_PING_1" expands into this list: CHECK_PING_4, CHECK_PING_3, CHECK_PING_2, CHECK_PING The last item in that list is the template of the service definition, which does not have a host_name set, which triggers the error. I haven't gotten any further though, because the list expansion code isn't easily digestible.. :)