Common check for multiple Hosts

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.
Locked
Vincent.L
Posts: 4
Joined: Wed Jan 25, 2017 10:49 am

Common check for multiple Hosts

Post by Vincent.L »

Hello,

I close to new with Nagios, and I m working on an nagios installed and configured by someone else before me.
My nagios looks like that. Each clients got his own folder in "object". Each folder come with his own configuration file like templates, linux server, windows servers, ups, printer....
Now I 'd like to create a pool of common services that can be reached automatically by each host added in the right .cfg file.

I've tried all day long, and the best way I've found is to use inheritance in each configs files. But I really want to to make this common pool more easier to use.

Something like that in fact : I add a new host in my Google/Google-linux.cfg, I eventually add this new host as members in my hostgroup and voilà, all common check are available for the new host.
I tomorrow, I need to add a new host in my Deb/deb-linux.cfg, common check will be applied automatically too.

Sorry for my bad English. I hope to be clear enough.
Thanks,

Vincent
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Common check for multiple Hosts

Post by dwhitfield »

I'm not 100% sure I understand what you are trying to do. Hostgroups and inheritance were my first two thoughts. Have you looked at service groups? https://assets.nagios.com/downloads/nag ... rvicegroup

Also, what version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use.
Vincent.L
Posts: 4
Joined: Wed Jan 25, 2017 10:49 am

Re: Common check for multiple Hosts

Post by Vincent.L »

Thanks for your answer,

I m using a Debian 7 on a Citrix Xenserver 7. Nagios is 4.08.
I ll try to be more clear :
I 'd like to define a pool of services applicable to each new host added in a .cfg of any client's directory with a minimal configuration.
Most of server I monitoring are under linux, so I 'd to have something like that in a cfg in "object" for example:

define servicepool {
use generic_host
name common_check
services check_load, check_ssh, check_user, check_mount
}

and in a, for example, linux.cfg of one of my client

define service{
use_servicepool common_check
hostgroup_name myhostgroup
}

It's just an example of what I m trying to do. I know that there is no servicepool command. Maybe that servicegroup is the best answer for me. I 've read it, but didn't understand how does it work, and even if it's what I need.

Thanks again

Vincent
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Common check for multiple Hosts

Post by avandemore »

I think you want to use templates. You can find more documentation on them here:
https://assets.nagios.com/downloads/nag ... tions.html
https://assets.nagios.com/downloads/nag ... tance.html
Previous Nagios employee
Vincent.L
Posts: 4
Joined: Wed Jan 25, 2017 10:49 am

Re: Common check for multiple Hosts

Post by Vincent.L »

Thanks for your answser :D
I ll continue with hostgroup and inheritance for the moment, and I ll test new ways to make monitoring easier as much as I can.

Vincent
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Common check for multiple Hosts

Post by dwhitfield »

Did you want to lock this up or leave it open as you test?
Vincent.L
Posts: 4
Joined: Wed Jan 25, 2017 10:49 am

[LOCKED]Re: Common check for multiple Hosts

Post by Vincent.L »

We can lock this thread. I ll open a new one if I find what I m looking for.
Thanks you.

Vincent
Locked