(advanced) service check scheduling question

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
sagionaras
Posts: 2
Joined: Wed Dec 21, 2016 4:27 am

(advanced) service check scheduling question

Post by sagionaras »

I need some ideas how to schedule a service:
Once per day nagios asks VCenter (the vmware management server) if there are outdated snapshots on host level, eg on server's host template.. Now with 300 hosts, vcenter can't handle the load and returns service check timeout - I need to somehow run this specific check with a 5min delay between hosts (when I schedule the check manually for only one host, eg there is no other same checks at the on the Vcenter, then it works perfect). So I need to somehow configure Nagios to run this check once per day and not faster than 5 minutes between hosts.

My configuration:

Service definition :

Code: Select all

define service{
        name                                  Snapshot-Service
        check_period                       24x7            
        normal_check_interval         1440          
        retry_interval                       60               
        max_check_attempts           3             
        notification_period                24x7             
        notification_interval              0                
        notification_options              w,c,r
        notifications_enabled            1               
        passive_checks_enabled      0           
        register                                0
        contact_groups                    admins


command

Code: Select all

define command {
command_name check_vmi_snap
command_line $USER1$/check_vmware_snapshots.pl --server vcenter  --username xxvcenter  --password xxpassword  --mode age  --warning 3 --critical 5 --whitelist $HOSTADDRESS$
v_server template

Code: Select all

define service{
        hostgroup_name             v_servers 
        use                                Snapshot-Service
        service_description         Snapshot
        check_command            check_vmi_snap
}
and finally a sample host configuration

Code: Select all

define host{
        host_name      v_server01
        use                 v_servers
        alias               Virtual Server01 
        address          192.168.0.1
} 
Any help or idea would be greatly appreciated.

Kind regards,

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

Re: (advanced) service check scheduling question

Post by avandemore »

Timeouts are generally configured at 3 levels. The Nagios global timeouts in nagios.cfg, the plugin itself, and the remote side.

Where is your timeout occurring?

No amount of Nagios tuning will make a heavy plugin return any faster. That falls on the plugin and remote side and anything in-between eg network.
Previous Nagios employee
sagionaras
Posts: 2
Joined: Wed Dec 21, 2016 4:27 am

Re: (advanced) service check scheduling question

Post by sagionaras »

hi avandemore,

thank you for your interest - the timeout occurs when nagios run at the same time the service for 2 or more hosts - yes, it is a heavy plugin and need approx 60sec to return results from vcenter - I am happy with nagios overall behavior and I am not planning to change something on the main configuration file that might fix this and create other issues..
I guess there is no easy solution - a workaround is to run it on vcenter, send the results for all hosts (nsca), passive check, and filter the results on hosts level - it will take me a while but will solve the problem for sure..
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: (advanced) service check scheduling question

Post by avandemore »

https://github.com/NagiosEnterprises/ncpa also may be of interest for you.
Previous Nagios employee
Locked