how to migrate nagios from one server to another server

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.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

how to migrate nagios from one server to another server

Post by sinkak »

i installed
sudo apt-get install nagios-nrpe-server

sudo apt-get install nagios3 nagios-nrpe-plugin

on new server then scp all config files from old server to new server scp -r nagios3 ubuntu@newserver:/etc/nagios3

scp -r nagios_api_app ubuntu@newserver:/usr/local/

i changed password sudo htpasswd -c /etc/nagios3/htpasswd.users admin

and changed permissions

drwxr-xr-x 2 nagios nagios nagios

drwxr-x--x 4 nagios nagios nagios3

grep nag /etc/group nagios:x:111:www-data

sudo service apache2 restart

sudo /etc/init.d/nagios3 stop

sudo /etc/init.d/nagios3 start

getting error

Warning: Duplicate definition found for service 'SSH' on host 'cacheserver20.wsa. local' (config file '/etc/nagios3/conf.d/services_nagios2.cfg', starting on line
11)

Warning: Duplicate definition found for service 'HTTP' on host 'webserver01.wsa.l ocal' (config file '/etc/nagios3/conf.d/services_nagios2.cfg', starting on line 2
)

Warning: Duplicate definition found for service 'Check time offset with DC01' on host 'weblinux01.wsa.local' (config file '/etc/nagios3/conf.d/weblinux-servers/we blinuxes.cfg', starting on line 75)

Warning: Duplicate definition found for service 'SSH' on host 'monitoring02.wsa.l ocal' (config file '/etc/nagios3/conf.d/services.cfg', starting on line 30)

Warning: Duplicate definition found for service 'SSH' on host 'cacheserver23.wsa. local' (config file '/etc/nagios3/conf.d/services.cfg', starting on line 30) Warning: Duplicate definition found for service 'SSH' on host 'cacheserver11.wsa. local' (config file '/etc/nagios3/conf.d/services.cfg', starting on line 30) Warning: Duplicate definition found for service 'SSH' on host 'cacheserver10.wsa. local' (config file '/etc/nagios3/conf.d/services.cfg', starting on line 30) Warning: Duplicate definition found for service 'SSH' on host 'cacheserver21.wsa. local' (config file '/etc/nagios3/conf.d/services.cfg', starting on line 30) Warning: Duplicate definition found for service 'Check time offset with DC01' on host 'webserver09.wsa.local' (config file '/etc/nagios3/conf.d/services.cfg', sta rting on line 38)

Error: Service check command 'check_nrpe_args' specified in service 'Free memory' for host 'ips06.wsa.local' no t defined anywhere!

Error: Service check command 'check_nrpe_args' specified in service 'Swap Usage' for host 'ips06.wsa.local' not defined anywhere! Error: Service check command 'check_nrpe_args' specified in service 'Total Processes' for host 'ips06.wsa.local
' not defined anywhere! Error: Service check command 'check_nrpe_args' specified in service 'Check SYN Flood' for host 'logs.wsa.local'
not defined anywhere! Error: Service check command 'check_nrpe_args' specified in service 'Check_auditd' for host 'logs.wsa.local' no
t defined anywhere! Error: Service check command 'check_nrpe_args' specified in service 'Current Load' for host 'logs.wsa.local' not defined anywhere!

dont know why

please help
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: how to migrate nagios from one server to another server

Post by jdalrymple »

Sounds like you didn't grab some command definitions from your old install. Also this is clearly not a NagiosXI problem but a Core problem, can we move it to the appropriate forum?

You can find all of the included config files from your old setup by doing a

Code: Select all

[root@localhost etc]# grep ^cfg_ nagios.cfg
cfg_dir=/usr/local/nagios/etc/static
cfg_file=/usr/local/nagios/etc/contacttemplates.cfg
cfg_file=/usr/local/nagios/etc/contactgroups.cfg
cfg_file=/usr/local/nagios/etc/contacts.cfg
cfg_file=/usr/local/nagios/etc/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/commands.cfg
cfg_file=/usr/local/nagios/etc/hostgroups.cfg
cfg_file=/usr/local/nagios/etc/servicegroups.cfg
cfg_file=/usr/local/nagios/etc/hosttemplates.cfg
cfg_file=/usr/local/nagios/etc/servicetemplates.cfg
cfg_file=/usr/local/nagios/etc/servicedependencies.cfg
cfg_file=/usr/local/nagios/etc/serviceescalations.cfg
cfg_file=/usr/local/nagios/etc/hostdependencies.cfg
cfg_file=/usr/local/nagios/etc/hostescalations.cfg
cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg
cfg_dir=/usr/local/nagios/etc/hosts
cfg_dir=/usr/local/nagios/etc/services
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: how to migrate nagios from one server to another server

Post by sinkak »

Sorry. Couldnt find the appropriate forum. thats y i posted here.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: how to migrate nagios from one server to another server

Post by jdalrymple »

That's no problem, we can move it to Core easy enough.

Was my advice useful in solving your problem? Did you find your missing command definitions?
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: how to migrate nagios from one server to another server

Post by sinkak »

i have problems connecting to the server.
as soon i connect i will post the result here.

Thank You
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: how to migrate nagios from one server to another server

Post by jolson »

Sounds good - let us know what you find out.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: how to migrate nagios from one server to another server

Post by sinkak »

both have same files

old server
monitoring:/etc/nagios3$ grep ^cfg_ nagios.cfg
cfg_file=/etc/nagios3/commands.cfg
cfg_dir=/etc/nagios-plugins/config
cfg_dir=/etc/nagios3/conf.d


new server
@ip-new:/etc/nagios3$ grep ^cfg_ nagios.cfg
cfg_file=/etc/nagios3/commands.cfg
cfg_dir=/etc/nagios-plugins/config
cfg_dir=/etc/nagios3/conf.d
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: how to migrate nagios from one server to another server

Post by jdalrymple »

Well, the validation output is pretty clear about the problem:
sinkak wrote:

Code: Select all

Error: Service check command 'check_nrpe_args' specified in service 'Free memory' for host 'ips06.wsa.local' no t defined anywhere!
Can you find this command definition anywhere?
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: how to migrate nagios from one server to another server

Post by sinkak »

i couldnt find that command.
i gave up this method, deleted this files.
i am installing from scratch again.
may be add each host individually to config files.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: how to migrate nagios from one server to another server

Post by jdalrymple »

Adding the command definition should be trivial, 4 lines. In addition if your old server still exists it should be easy to find. Unless you really really need to I wouldn't rebuild from scratch.
Locked