Results 1 to 10 of 10

Thread: Multiple problems - custom macros, flapping, logs

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    27

    Multiple problems - custom macros, flapping, logs

    Hello!

    Long-time Nagios user from a 100-node/1,000-service environment now building a Shinken 0.6.5 installation for much larger environment. For now everything is running on RHEL 5.2 with the default shinken-specific.cfg config (with PickleRetention modules enabled), following the Shinken 10-Minute Start guide.

    I've come across a few problems that contradict the documentation and my previous Nagios experience:

    1. Notifications are never run if the notification command references a custom host macro. For instance, the following command definition works:
    [tt] command_line /bin/echo "The host name is $HOSTNAME$" > /tmp/alert[/tt]
    The nagios.log confirms it, with an entry for "SERVICE NOTIFICATION".

    But this does not:
    [tt] command_line /bin/echo "The host country is $_HOSTCOUNTRY$" > /tmp/alert[/tt]
    Nothing appears in the nagios.log to indicate that the command was attempted.

    The host definition includes the following macro definition:
    [tt] _country USA[/tt]

    2. In the default Thruk UI, all of the links in the "Reports" group are empty. Event Logs, Notifications, and Alerts all claim "0 Matching Log Entries Displayed" even when the /var/lib/shinken/nagios.log file has lots of these recorded.

    3. Services are entering Flapping status, even though I have it disabled in the main nagios.cfg file with "enable_flap_detection=0". I even added "flap_detection_enabled 0" to my global service template definition, and still services are entering Flapping status.

    I'm excited about Shinken, and hope I can get everything working!

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

    Re: Multiple problems - custom macros, flapping, logs

    Hi,

    Let start

    1: strange, I cannot see why, so I'm trying to reproduce it

    2: The Thruk UI is not using the nagios.log file in fact, but the LiveStatus module. Can you look in the broker.log file if this module is reporting something strange? You can also check if you got the python-sqlite module installed (it's need by this reporting queries).

    3: it was a real bug I just fixed it in the git version (cf https://github.com/naparuba/shinken/...794269d7b098c4). Thanks for reporting this I put "grim" in the Thanks file. Do you prefer that I use your real name?


    Jean
    No direct support by personal message. Please open a thread so everyone can see the solution

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

    Re: Multiple problems - custom macros, flapping, logs

    Hi again,

    I tried to wrote a test case, but I cannot reproduce the macro problem, I always got the macro updated and the command launched. I'll try on an installed system to see if it's still ok or not.


    Jean
    No direct support by personal message. Please open a thread so everyone can see the solution

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

    Re: Multiple problems - custom macros, flapping, logs

    Hum... even with an installation it's ok... Can you try with a recent git version?
    No direct support by personal message. Please open a thread so everyone can see the solution

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    27

    Re: Multiple problems - custom macros, flapping, logs

    "Grim" is fine for the Thanks file. You're welcome!

    I retrieved and installed the latest code from git, but the new Shinken init.d script doesn't work for me; "start-stop-daemon" and "log_progress_msg" are not available on RHEL5. If I use the init.d scripts from the 0.6.5 release it starts OK.

    My 2nd problem is resolved with the latest code - I am seeing alerts and events in Thruk under the "Reports" section now.

    Unfortunately, the 1st problem still persists - if I try to invoke a custom host macro in my notification command, the command never runs.

    Here are the relevant configurations:
    Code:
    define command {
    	command_name	create_snc_incident
    	# Works fine
    	command_line	$USER2$/snc-create-incident.pl --host $HOSTNAME$ --hoststate $HOSTSTATE$ --hosteventid "$HOSTEVENTID$" --service "$SERVICEDESC$" --servicestate "$SERVICESTATE$" --serviceeventid "$SERVICEEVENTID$" --serviceoutput "$SERVICEOUTPUT$"
    
    	# Never runs
    	#command_line	$USER2$/snc-create-incident.pl --host "$_HOSTSYSID$" --hoststate $HOSTSTATE$ --hosteventid "$HOSTEVENTID$" --service "$SERVICEDESC$" --servicestate "$SERVICESTATE$" --serviceeventid "$SERVICEEVENTID$" --serviceoutput "$SERVICEOUTPUT$"
    }
    define contact{
    	contact_name          sncticket
    	alias             SnC Incident queue
    	host_notifications_enabled   1
    	service_notifications_enabled 1
    	host_notification_period    24x7
    	service_notification_period  24x7
    	host_notification_options   d,r,s
    	service_notification_options  w,u,c,r,s
    	host_notification_commands   create_snc_incident
    	service_notification_commands create_snc_incident
    	can_submit_commands      1
    }
    define contactgroup{
    	contactgroup_name       normal-events
    	members            sncticket
    }
    define host {
    	check_command     check_nothing
    	checks_enabled    1
    	max_check_attempts  2
    	active_checks_enabled 1
    	passive_checks_enabled 1
    	check_period     24x7
    	check_interval    60
    	retry_interval    1
    	notification_interval 30
    	notification_period  24x7
    	notification_options d,u,r
    	contact_groups    normal-events
    	name         genericHost
    	register       0
    }
    define host{
    		use genericHost
    		host_name xxxhost
    		_sysid c918f25e0a0a3c4701cdc279b17c0cb5
    		alias Windows 2003 Standard
    		address ustca129
    }
    define service{
    	max_check_attempts   3
    	check_interval     5
    	retry_interval     2
    	check_period      24x7
    	notification_interval 10
    	notification_period  24x7
    	notification_options  w,u,c,r
    	notifications_enabled 1
    	retain_status_information 1
    	retain_nonstatus_information 1
    	flap_detection_enabled 0
    	contact_groups     normal-events
    	name          genericService
    	register        0
    }
    define service{
    		use genericService
    		register 0
    		name f8ebf8855b89904021fae3114f4254b4
    		service_description win_default_services
    	check_command check_wmi_service!Spooler,TermService,SNMP,LanmanServer
    }
    define service{
    		use f8ebf8855b89904021fae3114f4254b4
    	hostgroup_name Windows_Default
    }
    define hostgroup{
    		hostgroup_name Windows_Default
    		alias d2bc24525bc5d04021fae3114f4254a9
    		members xxxhost
    }

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

    Re: Multiple problems - custom macros, flapping, logs

    Hi,


    Are you sure you got the lastest init.d script? I can't find such functions in it
    No direct support by personal message. Please open a thread so everyone can see the solution

  7. #7
    Junior Member
    Join Date
    Sep 2011
    Posts
    27

    Re: Multiple problems - custom macros, flapping, logs

    I think I was using the wrong repository - I followed the Shinken download page (git://shinken.git.sourceforge.net/gitroot/shinken/shinken) instead of the repo on Github (git://github.com/naparuba/shinken.git).

    I will try the Github version now.

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

    Re: Multiple problems - custom macros, flapping, logs

    Outch , yes the soruceforge is very very old

    Where did you get this link? I need to fix it :
    No direct support by personal message. Please open a thread so everyone can see the solution

  9. #9
    Junior Member
    Join Date
    Sep 2011
    Posts
    27

    Re: Multiple problems - custom macros, flapping, logs

    The SourceForge link came from this page, under "Get the Sources":
    http://www.shinken-monitoring.org/download/

    I'm running with the latest git code now, and all three of my original problems are now resolved.

    Thank you very much!


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

    Re: Multiple problems - custom macros, flapping, logs

    Arg! Damn it, I forgot this link ;D

    Thanks, and good monitoring
    No direct support by personal message. Please open a thread so everyone can see the solution

Posting Permissions

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