LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-03-2012, 08:07 AM   #1
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Rep: Reputation: 5
Nagios - host based check_period


Hi,

I want to have different check_periods for different hosts for some common services.

For example, below I have given the service definition applicabale for several hosts:

common-for-hosts.cfg:
Code:
define service{
    use                     generic-service
    name                    my-service
    hostgroup_name          my-hosts
}
define service{
    use                     my-service
    service_description     A common service
    check_command           check_nrpe!check_system_memory
}
And below are two hosts (for example):
host1.cfg:
Code:
define host{
    use                     linux-server
    host_name               host1
    address                 host1.mydomain.com
    hostgroups              my-hosts
    check_period            officehours
}
define service{
    <host specific check(s)>    
}
host2.cfg:
Code:
define host{
    use                     linux-server
    host_name               host2
    address                 host2.mydomain.com
    hostgroups              my-hosts
}
define service{
    <host specific check(s)>    
}
What I expect here is that the memory check service to be run only during office hours for hos1 and 24x7 for host2, as I have defined the check_period for the host1. But what happens is that only the host check ie whether the host is alive or not is done during office hours; but the services are tried 24x7.

On page

http://nagios.sourceforge.net/docs/3...ions.html#host

the explanation for check_period reads as

Quote:
check_period: This directive is used to specify the short name of the time period during which active checks of this host can be made.
If this is not the correct way, can somebody please teach me do it in the correct way?

Please let me know if you have any questions in this regard.

Thanks
 
Old 09-03-2012, 08:47 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
what you're seeing is the correct behaviour, you can't define a service check period on a per host basis. There's nothing stopping you defining a different service for each host though. That'd do the job, albeit in a clunky way. In case you hadn't noticed yet, Nagios is kinda rubbish.
 
Old 09-04-2012, 03:05 AM   #3
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
Hi Chris

I have just started to play with the monitoring tools.
Quote:
There's nothing stopping you defining a different service for each host though.
Well, that is what I want to avoid. I am designing a suite that, when new hosts are added to the infrastructure, will always perform a set of standard tests. And on top of that I will add the host specific tests.

I have just started the Nagios configuration and haven't got enough experience to judge on it yet. But I will be more than happy to know the Nagios alternatives for monitoring mixed platform IT infrastructure.

Thanks
 
Old 09-04-2012, 03:12 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
I can't really suggest a *better* tool in the sandal wearing open source arena really. What does make it more bearable is to use a tool like puppet to automate the configuration of it. Previously I've used puppet with puppet dashboard to build the configs, as puppet can directly configure Nagios, you can define high level config for nagios, rather than generic file maangement. So that angle would still result in mass code duplication, however it would be fundamentally walled off from the world if you never need to directly look at the configs, esp when you can do your "custom" level of config directly through the dashboard UI too. Works well enough.
 
1 members found this post helpful.
Old 09-04-2012, 09:21 AM   #5
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
Hi Chris

So I take that what I am looking for is not achievable in Nagios; but may be able to delegate the ugly job to puppet?

Very helpful Chris.

If nobody comes up with any suggestion I shall close this thread tomorrow.

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios Host Down but Services Up binkocd Linux - Server 4 02-06-2012 09:41 AM
How to add Host in Nagios jeyachandran1988 Linux - Newbie 1 01-10-2012 05:44 AM
[SOLVED] How to add another Host to Nagios anoxxi Linux - Newbie 4 06-16-2011 06:09 AM
max host for nagios/zabbix keong79 Linux - Newbie 4 08-20-2009 01:47 PM
nagios add more host hitesh_linux Linux - Software 0 07-06-2007 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration