I want to monitor services over http running on multiple ports other than 80.
Services are running on port 8083, 8086 and some other ports. I created server.cfg file as follows:
define host {
use linux-server
host_name cfbase-prod
alias cfbase-prod
address x.x.x.x
contacts admin
}
define service {
use generic-service
host_name cfbase-prod
service_description HTTP
check_command check_http
contacts admin
check_interval 1
}
But it is not working in my nagios console it still shows as the http on port 80, which is not the case. Can somebody please help.
Best Answer
You can specify the port number directly in the command but you will must create one command per tested port.
Or you can create a custom variable to store the port number , with your example:
And on your command you can inherite of this variable like this :
You must prepend
_service
for a service or_host
for a host to use your variable in a command. source :https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/customobjectvars.html