0

I have hostgroups.cfg file in which i have different hosts with different port no. I want to pass port no for every host to services.cfg file where i have put check_http command.

As my different hosts have different http processes with different port no, so I want to pass port no directly from hosts.cfg file. Is it possible?

0

You can use custom object variables

You declare a variable in your host definition starting with an underscore (e.g._http_port1 81) and reference it in your service/command/contact/etc. with $_HOSTHTTP_PORT1. Note THE _HOST prefix and the fact that the var has its leading _ stripped off and was capitalized.

You can read more http://nagios.sourceforge.net/docs/3_0/customobjectvars.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.