On 27.01.2014 20:56, Mark Haney wrote:
Well, I'm halfway there I think. When I setup the additional service like this:services["checkpgsql"] = { templates = [ "generic-service" ], check_command = "check_nrpe", macros = { command = "check_pgsql", logname = "admin", password = "******", } }, Icinga tells me 'NRPE: Command 'check_pgsql' not defined. Am I missing something? I know I need to pass along a username and password, but I can't seem to figure out /where/ that goes. I tried to add the params to the check_nrpe CheckCommand object, but it didn't work. Do I need to do something like this: object CheckCommand "check_nrpe" inherits "plugin-check-command" { command = [ "$plugindir$/check_nrpe", "-H", "$address$", "-c", "$command$", ], command = [ "$plugindir$/check_pgsql", "-H", "$address$", "-l", "$logname$", "-p", "$password$", ], } Or, if not, how do I make those options macros instead of passing them in the Host configuration file? (On a side note, does it make sense to even make those options macros?)
No, no and no. Each CheckCommand object is unique by itself. That does not make any sense to use one object named "check_nrpe" and put multiple command lines into it. How would you reference it by its name inside your service definition? That's the exact same behavior as known from Nagios / Icinga 1.x
What Icinga 2 is telling you now is that you've "successfully" overridden your check_nrpe command, and replaced its command with invoking check_pgsql binary which doesn't exist nor is your required outcome.
-- DI (FH) Michael Friedrich mail: [email protected] twitter: https://twitter.com/dnsmichi jabber: [email protected] irc: irc.freenode.net/icinga dnsmichi icinga open source monitoring position: lead core developer url: https://www.icinga.org _______________________________________________ icinga-users mailing list [email protected] https://lists.icinga.org/mailman/listinfo/icinga-users
