how to rename the hostname without affecting current time in nagios
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to rename the hostname without affecting current time in nagios
Dear Friends,
How to change the hostname without affecting current status ie i dont need to change the already having time, just rename the hostname.. what is the command to refresh
If you already have changed all the necessary configuration files to show the new hostname you can reset the hostname just by executing:
Code:
hostname <newhostname>
Then when you log out and back in again, the new hostname will be shown at the prompt. If the hostname is to be used by services like Nagios, then restart the service itself. There's no need whatsoever to reboot an entire server to change the hostname. Also, restarting a service or resetting the hostname for as far as I know has nothing to do and should not affect your date and time settings. Why do you refer to date and time? Does your server show the correct time after a reboot?
If you already have changed all the necessary configuration files to show the new hostname you can reset the hostname just by executing:
Code:
hostname <newhostname>
Then when you log out and back in again, the new hostname will be shown at the prompt. If the hostname is to be used by services like Nagios, then restart the service itself. There's no need whatsoever to reboot an entire server to change the hostname. Also, restarting a service or resetting the hostname for as far as I know has nothing to do and should not affect your date and time settings. Why do you refer to date and time? Does your server show the correct time after a reboot?
Kind regards,
Eric
Dear Eric,
I am asking how to change hostname without any updates in log, because i have changed the hostname, I lost the logs of changed old hostname. how can i keep the old logs in Nagios.
Hi guys, has the probelm been solved !? I'm facing almost the same problem with my Nagios 4 core monitoring server, where i've renamed many hostnames and i'm getting the availibilty time only from the day i renamed the host, from was i've understood ndoutils is not updating the host name from the configuration files it has , any solution please!?
Are you wanting to change the hostname of the machine, or what you have named it in nagios, or both?
If you're asking how to maintain the history in nagios with a new hostname, I can't help there as I haven't used nagios in a number of years. I would suggest asking on a nagios forum.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.