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

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

Post by sinkak »

i checked in commands.cfg and nagios.cfg.
i didnt find anywhere.
normally where is it defined?
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 »

sinkak wrote: cfg_file=/etc/nagios3/commands.cfg
cfg_dir=/etc/nagios-plugins/config
cfg_dir=/etc/nagios3/conf.d

Code: Select all

grep check_nrpe_args /etc/nagios3/commands.cfg
grep -R check_nrpe_args /etc/nagios-plugins/config
grep -R check_nrpe_args /etc/nagios3/conf.d
If you don't find it in one of those 3 commands then the configuration shouldn't validate on your old server either.
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 changed the paths in config file.
i no longer see that error
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 am having the error while loading config file

Code: Select all

sudo service nagios reload
Error: Could not find member group '!all-elbs' specified in hostgroup 'all_hosts' (config file '/usr/local/nagios/etc/conf.d/hostgroups_nagios2.cfg', starting on line 115)
   Error processing object config files!
I checked the config file. Valid member group exits

Code: Select all

define hostgroup{
        hostgroup_name  all-rds
        alias           rds
        members         db[0-9]+.*
}

define hostgroup {
        hostgroup_name  all-elbs
        members         (LB.*)
}

define hostgroup {
        hostgroup_name  all_hosts
        alias           all
        hostgroup_members       !all-elbs,!all-rds
Last edited by sinkak on Tue Aug 04, 2015 2:20 pm, edited 2 times in total.
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 »

not hostgroups aren't allowed. Only not hosts.

New topic please if your old one is solved.
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 »

still in the process of migration.
migrated config files and edited the paths for plugins, scripts and config files.
still have some errors while starting new config
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 »

OK, what are the current issues? Did your config verify when you didn't have the invalid hostgroup?
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 »

same config files exist on old server. it doenst have error.

on new server it shows error

Error: Could not find member group '!all-elbs' specified in hostgroup 'all_hosts' (config file '/usr/local/nagios/etc/conf.d/hostgroups_nagios2.cfg', starting on line 115)

member group is clearly defined in that config file

Code: Select all

define hostgroup {
        hostgroup_name  all-elbs
        members         (LB.*)
}

define hostgroup {
        hostgroup_name  all_hosts
        alias           all
        hostgroup_members       all_web_and_sched,cacheservers,prod_linux_server
s,weblinux-servers,windows-servers,!all-elbs
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 »

if i remove ! before !all-elbs,!all-rds
changed from

Code: Select all

define hostgroup {
        hostgroup_name  all_hosts
        alias           all
        hostgroup_members       !all-elbs,!all-rds
to

Code: Select all

define hostgroup {
        hostgroup_name  all_hosts
        alias           all
        hostgroup_members       all-elbs,all-rds
it works.

Previou admin added that.
does it mean exclude all that hosts? or anything else?
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 »

I understand. What I'm trying to say is that you can not NOT hostgroups in a hostgroup definition. For example:

Code: Select all

     hostgroup_members          hostgroup
is fine

Code: Select all

     hostgroup_members          !hostgroup
is invalid.

I'm surprised it worked on your old system. I doubt it actually *worked*, it probably just passed validation silently even though it's not valid. Something similar can be done in services, but that is for definition objects "host_groups," not "hostgroup_members."
Locked