Change localhost name

Hi,
you can change the name “localhost” in nagios? I have two server and when receive the notification e-mail i do not know from which server arrives, i tried but I always get configuration errors…i have the default configuration.

Thanks

Stefano

change the alias in the localhost configuration… anyway localhost for nagios is the server it runs on… :slight_smile:

I tried to change the alias in localhost.cfg, but both in web and the notification mail remained localhost…any other ideas?

did you run /etc/init.d/nagios reload after applying the changes?

Yes, i restart the nagios service

do not restart, reload only. or use stop followed by start.

stop nagios, run “ps -ef | grep nagios” and kill any running nagios processes, restart the nagios process and cehck if the configuration updated.

Luca

Does not work, I did the reload and restart, I also killed the process, nothing. Remains only to reboot the server…but i can not.
Just change the alias?

either changing host_name or the alias you should be able to change the host indentification in the emails.

if yuou change the host_name you will need to cvhenge the services associations… :slight_smile:

If i change “host_name”, the nagios service don’t start, i have a configuration error…and in the notification emails appear localhost… :x

OK, i changed host_name in all services…work’s :shock:

before reloading always run the configuration check.

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

:wink:

Yes, i know…i solved it by changing the host name in the services, thank’s Luca!

Stefano