Best practice recommendation on Service reuse

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
AGray
Posts: 15
Joined: Wed May 29, 2013 1:34 pm

Best practice recommendation on Service reuse

Post by AGray »

I have about 300 servers and Nagios Core 4.2.4
At one point I did have a small number of services, and utilized groups. The problem I ran in to is that a vast majority of these servers desire different thresholds. So having say 90% use of "/app" for Warning and 95% for Critical, doesnt apply to all servers. It became easier for me to just have a unique service for each "/app" check (I use ncpa) for each host, each stored in their own separate hostname.cfg file. I know this is large and cumbersome, but otherwise, individual tweaking of a specific host was a hassle.

Can you please provide some SME best practice recommendation? Am I doing this wrong? Making life harder on myself? Is there a way to define one service for "/app" monitoring for example, but yet specify unique thresholds for each host?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Best practice recommendation on Service reuse

Post by rkennedy »

Is using custom variables to store it an option for you? This would allow dynamic configuration, and allow you to continue to use templates for your checks.

https://assets.nagios.com/downloads/nag ... tvars.html
Former Nagios Employee
AGray
Posts: 15
Joined: Wed May 29, 2013 1:34 pm

Re: Best practice recommendation on Service reuse

Post by AGray »

Yes, these look like they would work perfectly. It would mean that I could reduce the # of services down to probably 1 for each type. I would need to define similar custom variables though for each host. I dont know if this is simply a different way of doing what I am already doing or a better way at doing it. If it is simply a different way, then having say 300 services all that check the same filesystem, but different thresholds (not every one is different, but this approach allowed flexibility) for each.

This approach may possibly be a little easier in the long run if changes needed to be made to the service, for example a real custom scripted one that I later on enhanced and didnt want to make that change 300 different places. You know?

Thank you.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Best practice recommendation on Service reuse

Post by rkennedy »

Yup - that brings up another thought over here. You could develop wrappers around your plugins, that dynamically checked what thresholds should be set based on any string of data you want. (perhaps, hostnames, or IP address) Then, depending how it matches up, have it run the thresholds accordingly.

If you have any thoughts for something that could be built into NCPA, feel free to bring it up here - https://github.com/NagiosEnterprises/ncpa/issues
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Best practice recommendation on Service reuse

Post by tmcdonald »

Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up or has the issue otherwise been resolved?
Former Nagios employee
AGray
Posts: 15
Joined: Wed May 29, 2013 1:34 pm

Re: Best practice recommendation on Service reuse

Post by AGray »

It makes sense. I haven't done anything yet. Just other priorities. You can resolve it. Thanks a lot guys
Locked