Am 28.05.2015 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?

I do, but I did not yet have the time to look into your request.

And your "joke" isn't helping at all.

Kind regards,
Michael




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


-- 
Michael Friedrich, DI (FH)
Application Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]

** OSBConf 2015 - September - osbconf.org **
** OSMC 2015 - November - netways.de/osmc **
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to