How to Configure Nagios using Hostname Instead of IP Address

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

How to Configure Nagios using Hostname Instead of IP Address

Post by ep7network »

Hi. I would like to know if it's possible to access Nagios via localhost or a different URL name of our choice, instead of entering IP address to run Nagios from web browser?

I'm currently running Apache 2.4.6 on CentOs 7. Nagios web interface is working, and monitoring my Windows server clients. I guess my manager doesn't want to enter IP address to launch Nagios. It would be nice if we can enter a URL into web browser to access Nagios from the web.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to Configure Nagios using Hostname Instead of IP Add

Post by mcapra »

If you're using the standard Apache configuration generated by the make install-webconf step, then all you should need is a domain that resolves to the logical address of the machine hosting your Nagios setup. This has less to do with Nagios and is more of a general Linux/network administration thing.

Here's a simple way to change your machine's hostname in CentOS, but since I don't know your org's network I can't guarantee that will be enough:
https://serverfault.com/questions/36941 ... -in-centos
Former Nagios employee
https://www.mcapra.com/
kyang

Re: How to Configure Nagios using Hostname Instead of IP Add

Post by kyang »

Thanks @mcapra!

@ep7network, the link mcapra shows is a good way of changing the hostname in CentOS.
Take a look at it, and let us know how it goes.
Locked