Change localhost name


#1

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


#2

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


#3

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


#4

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


#5

Yes, i restart the nagios service


#6

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


#7

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?


#8

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:


#9

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


#10

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


#11

before reloading always run the configuration check.

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

:wink:


#12

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

Stefano