How to duplicate configuration from old server to new server


#1

Hi guys,

I used nagios 3.0.3 (stable) to monitoring my network but for now I just install nagios 3.0.3 to another one machine for replace the old server.

I have many configuration inside an old server.
Which files or how to duplicate whole of details from old to new?

Please help…!!

Thanks for your kindness.
Pummy
Bangkok, Thailand.


#2

You only need to really worry about 2 directories. The most important is the /usr/local/nagios/etc directory. This contains all your cfg files. The other you may need to move is the /usr/local/nagios/libexec this directory contains all your plug-ins. If you have developed your own plug-ins there may be more in this directory on your old server than on your new server.

Please note that you need to copy all directories under the 2 I listed above. Also, the /usr/local/nagios directory is the default directory if you installed Nagios from source. These directories may be different on your old server. If those directories do not exist look for a file called nagios.cfg. This is the default Nagios configuration file.


#3

Also you may want to consider…
Logs (for historical information):
/usr/local/nagios/var/nagios.log
/usr/local/nagios/var/archives/.
Host/Service Status at last nagios shutdown:
/usr/local/nagios/var/retention.dat
Make sure your rights and permissions are identical after copying from the source to the target server :wink:

HTH

/S


#4

Thanks for your both recommends…!!

Is that means if I copy whole files from

  1. /usr/local/nagios/etc/.
  2. /usr/local/nagios/libexec/.
  3. /usr/local/nagios/var/nagios.log
  4. /usr/local/nagios/var/archives/.
  5. /usr/local/nagios/var/retention.dat
    Nagios system in new computer will be working, right?

In choice No.2 it’s some plug-in for nagios.
But if my old and new is the same plug-in version.
Is it necessary to copy from old server to new server?

and another files in /usr/local/nagios/var/.
is that necessary to transfer to the new one?

If I didn’t copy any files from choice no.3 - no.5
to new server, is that means the new server can working without history?

Thanks for your helper…!!

Pummy


#5

[blockquote]In choice No.2 it’s some plug-in for nagios.
But if my old and new is the same plug-in version.
Is it necessary to copy from old server to new server?[/blockquote]nope… in fact it is better to compile and install the plugins as you have done in case there are any differences in the system architecture such as paths etc., as long as you make sure any custom checks that may have been created are copied across

[blockquote]and another files in /usr/local/nagios/var/.
is that necessary to transfer to the new one?[/blockquote]nope

[blockquote]If I didn’t copy any files from choice no.3 - no.5
to new server, is that means the new server can working without history?[/blockquote]Yes, it’ll be like starting afresh from day 1.

Also, don’t forget to consider the config files and suchlike for addons like NRPE, NDOUtils, pnp4nagios, nagvis, rrdtool/mrtg etc. etc. etc. should you have any of those installed :wink: