On Monday 18 March 2019 at 21:00:45, Václav Mach wrote: > Hi, > > On 3/18/19 4:30 PM, Antony Stone wrote: > >> You can try to start by running 'get_host("your_host")' and then > >> continue with more complex stuff based on properties you get. > > > > Yes, I can do everything I want to there: > > > > <1> => a=get_host("first.server.com").vars.neighbour > > null > > <2> => a > > "second.server.com" > > <3> => > > b=get_host(get_host("first.server.com").vars.neighbour).display_name > > null > > <4> => b > > "HA Pair: Berlin" > > > > And, "HA Pair: Berlin" is indeed the display_name for > > "second.server.com", which you can see is the value in vars.neighbour > > for "first.server.com" > > > > So, I can get what I want in the console; it just doesn't work inside the > > code. > > I've not seen a thing that worked on console and not in the actual > configuration. What output do you get when you try step by step (like > above) while using log function?
If I could get the log() function to actually put anything into /var/log/icinga2/icinga2.log, I'd be rather happier than I am now... Can anyone give me a concrete example of parameters to pass to log() which will result in something going into /var/log/icinga2/icinga2.log, given that I do have the feature "mainlog" enabled? # icinga2 feature list Disabled features: compatlog debuglog elasticsearch gelf graphite influxdb livestatus opentsdb statusdata syslog Enabled features: api checker command ido-mysql mainlog notification perfdata I've tried the suggestion from Ivo earlier: log(LogInformation, "get_display_name", "Display name found!") Nothing appears in the log file. > If there is nothing that makes sense, I'd try to report this as an > unexcepted behavior or bug in icinga. Yes. I'd hoped it was just me not understanding the language syntax correctly. Antony. -- Tinned food was developed for the British Navy in 1813. The tin opener was not invented until 1858. Please reply to the list; please *don't* CC me. _______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users