Results 1 to 10 of 10

Thread: [RESOLVED] Should notification be sent with this configuration?

  1. #1
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    [RESOLVED] Should notification be sent with this configuration?

    I am getting notifications, when I unplug print server.
    I host configuration I use two host configurations from templates, generic_host and no_importance.
    One has notications_enabled=1, the other notifications_enabled=0.
    Is this concept totaly wrong, and I should use only one host configuration from templates (perhaps create a new template with specific settings for print servers), or what?
    If not, is order of parameters in "use" line of my host configuration important?

    templates.cfg:
    Code:
    # 0 is for no importance at all, and no notification
    define host{
    	business_impact			0
    	name				no-importance
    	notifications_enabled		0
    	register			0
    }
    
    # Generic host definition template - This is NOT a real host, just a template!
    # Most hosts should inherit from this one
    define host{
    	name				generic-host
    	alias				generic-host
    
    	# Checking part
    	# Check_command by default is check_ping. Check each 5 min when all is OK/UP
    	# and make 5 checks (one bad then 4 others) in one minute intervals for going HARD and so
    	# raise notifications
    	check_command			check_ping
    	max_check_attempts		4
    	check_interval			5
    	retry_interval			1			; Re-check the host every one minute until a hard state can be determined
    #	max_check_attempts		1
    #	check_interval			1
    
    	# Check every time
    	active_checks_enabled		1
    	check_period			24x7
    
    	# Notification part
    	# One notification each day (1440 = 60min* 24h)
    	# every time, and for all 'errors'
    	# notify the admins contactgroups by default
    	#contact_groups			admins
    	notification_interval		1440
    #	notification_interval		1
    	notification_period		24x7
    	notification_options		d,u,r,f,s
    	notifications_enabled		1
    
    	# Advanced option. Look at the wiki for more informations
    	event_handler_enabled		0
    	flap_detection_enabled		1
    	process_perf_data		1
    
    	# Maintenance period
    	#maintenance_period		workhours
    
    	# Dispatching
    	#poller_tag			DMZ
    	#realm				All
    
    	# This said that it's a template
    	register			0
    }
    My test printserver host config:
    Code:
    define host {
    	alias			HP printer AOP
    	address			172.20.1.210
    	check_command		check_ping
    	contact_groups		etaadmins
    	host_name		172.20.1.210
    	hostgroups		printers-eta
    	use			http,generic-host,no-importance
    }





  2. #2
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Should notification be sent with this configuration?

    Hi,

    The template order is important, and they are read from left to right. The first value read is keep. So the "generic" should always be the last one, and so if you want to use no-importance values, you should put it before
    No direct support by personal message. Please open a thread so everyone can see the solution

  3. #3
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: Should notification be sent with this configuration?

    Ok, modified that, but I still get notifications.
    Maby it's just some caching problem?
    After I modified host definition to:
    Code:
    define host {
    	alias			HP printer AOP
    	address			172.20.1.210
    	check_command		check_ping
    	contact_groups		etaadmins
    	host_name		172.20.1.210
    	hostgroups		printers-eta
    	use			http,no-importance,generic-host
    }
    I have restarted shinken, and also deleted livelogs.db and tmp/retention* (perhaps unnecessary steps?), just in case..
    Should I do something else?

  4. #4
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Should notification be sent with this configuration?

    Hum... can you set no-importance before http?
    No direct support by personal message. Please open a thread so everyone can see the solution

  5. #5
    Administrator
    Join Date
    Jun 2011
    Posts
    216

    Re: Should notification be sent with this configuration?

    [quote author=naparuba link=topic=355.msg1878#msg1878 date=1334562132]
    Hi,

    The template order is important, and they are read from left to right. The first value read is keep. So the "generic" should always be the last one, and so if you want to use no-importance values, you should put it before
    [/quote]

    => Added a Warning on the Wiki here.
    If you see somwhere else to put it, just tell me

  6. #6
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: Should notification be sent with this configuration?

    Will try that now

    By the way, what does the is_admin parameter in contact definition mean? Does it have any influence on notifying?

  7. #7
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Should notification be sent with this configuration?

    It got for the WebUI, if is_admin is true, then the user got access to all objects, not only the one where he is a contact
    No direct support by personal message. Please open a thread so everyone can see the solution

  8. #8
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: Should notification be sent with this configuration?

    Ok, I have tried to move no-importance to left side, so the order is now no-importance,http,generic-host.
    As it seems at the moment, that solved the problem.
    But why?
    Hm, what about use http:
    Code:
    #:/usr/local/shinken/etc/packs/network/services/http/services# cat http.cfg 
    define service{
      service_description      Http
      use      generic-service
      register    0
      host_name	 http
      check_command check_http
    }
    Nope, it seems, that if notications_enabled isn't defined in host definition or in the first "use" place, it is automaticaly enabled (or perhaps it is automatically used from generic-host, that I haven't tried).

  9. #9
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Should notification be sent with this configuration?

    And in fact you find it

    The template system will first "complete" the template, then call them for standard hosts. So here, html is inheriting from generic that got the good value, so the generic value will be put into html, and so the no-importane value wll not be used. Maybe I should remove all "default" value from generic so ther will be less problems in the future
    No direct support by personal message. Please open a thread so everyone can see the solution

  10. #10
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: Should notification be sent with this configuration?

    Aha, now I understand ;D

    Maby it would be better from this point of view, but then again it would maby raise questions like "Why isn't notification being sent".
    If you remove it from generic and I don't define it in my definition, what's the default value (it isn't specified in wiki pages, so I assume 0).

    My suggestion, leave it as it is. It should just be well explained somwhere in wiki.

    Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •