Hi Klaus
I'm a beginner regarding icinga2; however, it would be more helpful also
for me to understand your code by using real words instead of 'bla' and
'blubb' ...
Kind regards
Daniel
Am 28.05.15 um 14:35 schrieb Klaus Muth:
> Oh come on! Nobody?
> Is nobody ever using functions?
> Are there functions in icinga2 config just to play Hangman over IRC?
>
> Am 27.05.2015 um 07:27 schrieb Klaus Muth:
>> Hi
>>
>> I'm trying to define and use a global function in icinga2 and failing
>> miserable:
>>
>> in functions.conf:
>> function test(str) {
>> str = str.replace("X", "u")
>> return "bla"+str.replace("bla", "blubb")
>> }
>>
>> this does reload without error.
>>
>> In host object:
>> object Host "gnarf" {
>> import "generic-host"
>> # more config [...]
>> action_url = "bla" + test("XXbrrrm bla")
>> }
>>
>> gives me a
>> critical/config: Error: Invalid field access (for value of type 'Host'):
>> 'test'
>>
>> while using {{ test("ökjsöldfk") }} compiles, but gives me an url of "Object
>> of type 'icinga::Function'" which is not what expected.
>>
>> Would you please point me in the right direction?
>>
>> BTW: looking at the hangman example didn't help
>>
>> Cheers,
>>
>
> Freundliche Grüße
--
PGP Key: 0x3C54FCDF
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users