Page 2 of 3

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

Posted: Mon Aug 03, 2015 3:37 pm
by sinkak
i checked in commands.cfg and nagios.cfg.
i didnt find anywhere.
normally where is it defined?

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

Posted: Mon Aug 03, 2015 5:01 pm
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.

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

Posted: Tue Aug 04, 2015 2:04 pm
by sinkak
i changed the paths in config file.
i no longer see that error

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

Posted: Tue Aug 04, 2015 2:07 pm
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

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

Posted: Tue Aug 04, 2015 2:11 pm
by jdalrymple
not hostgroups aren't allowed. Only not hosts.

New topic please if your old one is solved.

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

Posted: Tue Aug 04, 2015 2:26 pm
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

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

Posted: Tue Aug 04, 2015 3:07 pm
by jdalrymple
OK, what are the current issues? Did your config verify when you didn't have the invalid hostgroup?

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

Posted: Tue Aug 04, 2015 3:13 pm
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

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

Posted: Tue Aug 04, 2015 3:21 pm
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?

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

Posted: Tue Aug 04, 2015 3:24 pm
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."