Page 1 of 3
Setting up Service Dependencies
Posted: Wed Jul 24, 2013 10:24 pm
by Fred Kroeger
I've had a situation where even though the nrpe agent is running, the server is too busy to respond to any nrpe requests from the Nagios server.
This then sets all the monitors using nrpe to Critical (Connection timed out) beacuse the Host is till up and pingable.
The solution was to create another monitor to check connectivity to the nrpe agent and then setup Service dependency for the 20 nrpe services.
This worked fine with one server, however when I did the same with a Hostgroup (~25hosts) then I noticed that it takes about 5minutes to apply the configuration now.
If I add any another hostgroup (~30 hosts) then the Applying config never ends.
Is there a limitation on dependencies? Or should I be doing this differently.
Basically all I want to do is that id the nrpe agent is not contactable, then stop monitoring all the services using nrpe.
BTW I picked up a typo on the screen when you select the <Service Dependencies> link in CCM - It displays "Service Dependencys"
regards... Fred
Re: Setting up Service Dependencies
Posted: Thu Jul 25, 2013 11:13 am
by lmiltchev
If I add any another hostgroup (~30 hosts) then the Applying config never ends.
Did you try increasing the "max_execution_time" in the "/etc/php.ini" file?
Re: Setting up Service Dependencies
Posted: Mon Jul 29, 2013 12:32 am
by Fred Kroeger
Yes I looked at that, but I guess the issue is that taking > 30mins to apply a config is not acceptable.
Would lots of dependency rules work better than grouping them all together?
eg:
At the Moment I have 1 rule for a Hostgroup where Service_1 -> Service_12 depend on Service_0
Would it be better to make it 12 individual rules instead?
regards... Fred
Re: Setting up Service Dependencies
Posted: Mon Jul 29, 2013 9:52 am
by abrist
Follow the steps to generate a reconfig.txt and a cmd.txt log files found in the following link and post them here.
http://support.nagios.com/wiki/index.ph ... n_Problems
Re: Setting up Service Dependencies
Posted: Mon Jul 29, 2013 11:25 pm
by Fred Kroeger
This config takes about 3minutes to complete
It takes 1min to get to the Running Config Check line in reconfig.txt
Then another minute to the Starting Nagios line
Prior to implementing the Service dependencies, it took about 30sec to apply a config.
regards Fred
reconfig.txt
cmd.txt
Re: Setting up Service Dependencies
Posted: Tue Jul 30, 2013 9:26 am
by yancy
Fred,
Would it be possible to just increase the NRPE timeout in the command definition? That would be a simpler solution to your original issue I believe. I'm not sure how long it could potentially take for the NRPE request to be answered in your environment however.
-Yancy
Re: Setting up Service Dependencies
Posted: Wed Jul 31, 2013 9:10 pm
by Fred Kroeger
Hi Yancy
The issue is the amount of time taken to Apply a Configuration now that I have added all these Service Dependencies - not the execution of NRPE commands.
At the moment the little dots advancing across the screen during the Apply are over 1 screens worth. If I add any more service dependencies, then it never ends up applying the config. Even now, I consider +3minutes too long to wait
Fred
Re: Setting up Service Dependencies
Posted: Thu Aug 01, 2013 10:01 am
by yancy
Fred,
That does seem way way to long to apply config.
Could you run the database repair script to fix any possible corruption
http://assets.nagios.com/downloads/nagi ... tabase.pdf
Thanks for pointing out the typo. It has been fixed for the next release.
-Yancy
Re: Setting up Service Dependencies
Posted: Thu Aug 08, 2013 3:05 am
by Fred Kroeger
Yancy
I have done the repair before, but I did it again immediately before a reconfigure.
Still no difference - it still takes a long time to reconfigure.
time ./reconfigure_nagios.sh &> reconfig.txt
real 3m51.731s
user 2m42.055s
sys 0m3.274s
At the moment, I have all the services for a host (~15) dependent on whether a check_nrpe_version is successful.
Would it be more efficent to group all these services in a Service Group and then make that Service group dependent on the check_nrep_version ?
regards... Fred
Re: Setting up Service Dependencies
Posted: Fri Aug 09, 2013 7:34 am
by scottwilkerson
I'm not sure how you have this setup, but somehow you have
415 hosts
4019 services
25604 service dependencies
That seems like an awful lot of dependencies setup. If you can find a way to reduce this down ti certainly would improve the verify step