Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/naparuba/master' into WebU…
Browse files Browse the repository at this point in the history
…I_doc
  • Loading branch information
mohierf committed Jan 15, 2016
2 parents 15e029b + 3ff5040 commit 30076f4
Show file tree
Hide file tree
Showing 17 changed files with 235 additions and 125 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
@@ -1,4 +1,11 @@
language: python

# Allow shinken to run on new travis infra
sudo: False

# Allow cache of downloads
cache: pip

python:
- "2.6"
- "2.7"
Expand Down
10 changes: 5 additions & 5 deletions doc/source/07_advanced/objectinheritance.rst
Expand Up @@ -163,13 +163,13 @@ It is possible to use incomplete object definitions as templates for use by othe
define host{
host_name bighost1
address 192.168.1.3
use generichosthosttemplate
use generichosttemplate
}

define host{
host_name bighost2
address 192.168.1.4
use generichosthosttemplate
use generichosttemplate
}

Notice that the first host definition is incomplete because it is missing the required "host_name" variable. We don't need to supply a host name because we just want to use this definition as a generic host template. In order to prevent this definition from being registered with Shinken as a normal host, we set the "register" variable to 0.
Expand Down Expand Up @@ -218,7 +218,7 @@ Any :ref:`custom object variables <configuration/customobjectvars>` that you def
define host{
host_name bighost1
address 192.168.1.3
use generichosthosttemplate
use generichosttemplate
}

The host *bighost1* will inherit the custom host variables "_customvar1" and "_snmp_community", as well as their respective values, from the *generichosttemplate* definition. The effective result is a definition for *bighost1* that looks like this:
Expand Down Expand Up @@ -254,7 +254,7 @@ In some cases you may not want your host, service, or contact definitions to inh
host_name bighost1
address 192.168.1.3
event_handler null
use generichosthosttemplate
use generichosttemplate
}

In this case, the host *bighost1* will not inherit the value of the "event_handler" variable that is defined in the *generichosttemplate*. The resulting effective definition of *bighost1* is the following:
Expand Down Expand Up @@ -291,7 +291,7 @@ This "additive inheritance" can be accomplished by prepending the local variable
define host{
host_name linuxserver1
hostgroups +linux-servers,web-servers
use generichosthosttemplate
use generichosttemplate
}

In this case, the host *linuxserver1* will append the value of its local "hostgroups" variable to that from generichosttemplate. The resulting effective definition of *linuxserver1* is the following:
Expand Down
22 changes: 6 additions & 16 deletions doc/source/10_troubleshooting/troubleshooting-shinken.rst
Expand Up @@ -26,9 +26,9 @@ Frequently asked questions
---------------------------

* :ref:`How to set my daemons in debug mode to review the logs? <troubleshooting/troubleshooting-shinken#FAQ-1>`
* :ref:`I am getting an OSError read-only filesystem <troubleshooting/troubleshooting-shinken#FAQ-4>`
* :ref:`I am getting an OSError [Errno 24] Too many open files <troubleshooting/troubleshooting-shinken#FAQ-5>`
* :ref:`Notification emails have generic-host instead of host_name <troubleshooting/troubleshooting-shinken#FAQ-6>`
* :ref:`I am getting an OSError read-only filesystem <troubleshooting/troubleshooting-shinken#FAQ-3>`
* :ref:`I am getting an OSError [Errno 24] Too many open files <troubleshooting/troubleshooting-shinken#FAQ-4>`
* :ref:`Notification emails have generic-host instead of host_name <troubleshooting/troubleshooting-shinken#FAQ-5>`



Expand Down Expand Up @@ -92,16 +92,6 @@ The log file will contain information on the Shinken process and any problems th

.. _troubleshooting/troubleshooting-shinken#FAQ-2:

Changing the log level during runtime
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

shinken-admin is a command line script that can change the logging level of a running daemon.

''linux-server# ./shinken-admin ...''


.. _troubleshooting/troubleshooting-shinken#FAQ-3:

Changing the log level in the configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -112,7 +102,7 @@ Possible values: DEBUG,INFO,WARNING,ERROR,CRITICAL
Re-start the Shinken process.


.. _troubleshooting/troubleshooting-shinken#FAQ-4:
.. _troubleshooting/troubleshooting-shinken#FAQ-3:

OSError read-only filesystem error
----------------------------------
Expand All @@ -125,7 +115,7 @@ Execute a 'mount' and verify if /tmp or /tmpfs is set to 'ro' (Read-only).
As root modify your /etc/fstab to set the filesystem to read-write.


.. _troubleshooting/troubleshooting-shinken#FAQ-5:
.. _troubleshooting/troubleshooting-shinken#FAQ-4:

OSError too many files open
---------------------------
Expand All @@ -146,7 +136,7 @@ This typically changing a system wide file limit and potentially user specific f
ulimit -n xxxxx now


.. _troubleshooting/troubleshooting-shinken#FAQ-6:
.. _troubleshooting/troubleshooting-shinken#FAQ-5:

Notification emails have generic-host instead of host_name
----------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions etc/discovery/discovery.cfg
Expand Up @@ -9,6 +9,9 @@ log_file=/var/log/shinken/discovery.log
# like discoveryrules or runners
cfg_dir=../packs

# Then some useful templates
cfg_dir=../templates

# Default discovery rules and runners. Should be AFTER
# the packs ones ;)
cfg_file=discovery_rules.cfg
Expand Down
90 changes: 65 additions & 25 deletions etc/templates/time_templates.cfg
@@ -1,13 +1,13 @@
##############################################################################
##############################################################################
#
# Different Time Check Interval Services
#
#
# Different Time Check Interval for services and hosts
#
##############################################################################
##############################################################################

##############################################################################
# Purpose of time templates :
# Purpose of services time templates :
# Simply define checks behavior of services with time template to avoid
# false alerts.
# There are three time template type : short, medium, long
Expand All @@ -22,7 +22,7 @@ define service{
name 5min_short
use generic-service
max_check_attempts 1
normal_check_interval 5
check_interval 5
retry_interval 2
register 0
}
Expand All @@ -32,7 +32,7 @@ define service{
name 5min_medium
use generic-service
max_check_attempts 2
normal_check_interval 5
check_interval 5
retry_interval 3
register 0
}
Expand All @@ -42,7 +42,7 @@ define service{
name 5min_long
use generic-service
max_check_attempts 6
normal_check_interval 5
check_interval 5
retry_interval 5
register 0
}
Expand All @@ -52,7 +52,7 @@ define service{
name 10min_short
use generic-service
max_check_attempts 1
normal_check_interval 10
check_interval 10
retry_interval 5
register 0
}
Expand All @@ -62,7 +62,7 @@ define service{
name 10min_medium
use generic-service
max_check_attempts 2
normal_check_interval 10
check_interval 10
retry_interval 10
register 0
}
Expand All @@ -72,7 +72,7 @@ define service{
name 10min_long
use generic-service
max_check_attempts 6
normal_check_interval 10
check_interval 10
retry_interval 10
register 0
}
Expand All @@ -82,7 +82,7 @@ define service{
name 20min_short
use generic-service
max_check_attempts 1
normal_check_interval 20
check_interval 20
retry_interval 1
register 0
}
Expand All @@ -92,7 +92,7 @@ define service{
name 20min_medium
use generic-service
max_check_attempts 2
normal_check_interval 20
check_interval 20
retry_interval 20
register 0
}
Expand All @@ -102,7 +102,7 @@ define service{
name 20min_long
use generic-service
max_check_attempts 6
normal_check_interval 20
check_interval 20
retry_interval 20
register 0
}
Expand All @@ -112,7 +112,7 @@ define service{
name 30min_short
use generic-service
max_check_attempts 1
normal_check_interval 30
check_interval 30
retry_interval 15
register 0
}
Expand All @@ -122,7 +122,7 @@ define service{
name 30min_medium
use generic-service
max_check_attempts 2
normal_check_interval 30
check_interval 30
retry_interval 30
register 0
}
Expand All @@ -132,7 +132,7 @@ define service{
name 30min_long
use generic-service
max_check_attempts 6
normal_check_interval 30
check_interval 30
retry_interval 30
register 0
}
Expand All @@ -142,7 +142,7 @@ define service{
name 1hour_short
use generic-service
max_check_attempts 1
normal_check_interval 60
check_interval 60
retry_interval 20
register 0

Expand All @@ -153,7 +153,7 @@ define service{
name 1hour_medium
use generic-service
max_check_attempts 2
normal_check_interval 60
check_interval 60
retry_interval 60
register 0

Expand All @@ -164,7 +164,7 @@ define service{
name 1hour_long
use generic-service
max_check_attempts 6
normal_check_interval 60
check_interval 60
retry_interval 60
register 0

Expand All @@ -175,7 +175,7 @@ define service{
name 12hours_short
use generic-service
max_check_attempts 1
normal_check_interval 720
check_interval 720
retry_interval 360
register 0
}
Expand All @@ -185,7 +185,7 @@ define service{
name 12hours_medium
use generic-service
max_check_attempts 2
normal_check_interval 720
check_interval 720
retry_interval 720
register 0
}
Expand All @@ -195,7 +195,7 @@ define service{
name 12hours_long
use generic-service
max_check_attempts 6
normal_check_interval 720
check_interval 720
retry_interval 720
register 0
}
Expand All @@ -205,7 +205,7 @@ define service{
name 1week_short
use generic-service
max_check_attempts 1
normal_check_interval 10080
check_interval 10080
retry_interval 10
register 0
}
Expand All @@ -215,7 +215,7 @@ define service{
name 1week_medium
use generic-service
max_check_attempts 2
normal_check_interval 10080
check_interval 10080
retry_interval 10080
register 0
}
Expand All @@ -225,7 +225,47 @@ define service{
name 1week_long
use generic-service
max_check_attempts 6
normal_check_interval 10080
check_interval 10080
retry_interval 10080
register 0
}

##############################################################################
# Purpose of hosts time templates :
# Simply define checks behavior for hosts with time template to allow more or
# less fast polling.
# There are three time templates:
# - poll_short, every minute with 1 retry
# - poll_medium, let a time period in soft state for service that can have peak load
# - poll_long, let a greater time period in soft state, meant to service where
# great variation and long charge time period are usual.
##############################################################################

# Check every 1min with immediate hard state
define host{
name poll_short
use generic-host
max_check_attempts 2
check_interval 1
retry_interval 0
register 0
}

define host{
name poll_medium
use generic-host
max_check_attempts 2
check_interval 5
retry_interval 1
register 0
}

define host{
name poll_long
use generic-host
max_check_attempts 3
check_interval 15
retry_interval 3
register 0
}

4 changes: 2 additions & 2 deletions libexec/discovery/nmap_discovery_runner.py
Expand Up @@ -36,9 +36,9 @@
VERSION = '0.1.1'
# Fred : command launched depending on os detection
if os.name != 'nt':
DEFAULT_CMD = "sudo nmap %s -sU -sT --min-rate %d --max-retries %d -T4 -O -oX %s"
DEFAULT_CMD = "sudo nmap %s -sU -sS --min-rate %d --max-retries %d -T4 -O -oX %s"
else:
DEFAULT_CMD = "nmap %s -sU -sT --min-rate %d --max-retries %d -T4 -O -oX %s"
DEFAULT_CMD = "nmap %s -sU -sS --min-rate %d --max-retries %d -T4 -O -oX %s"

parser = optparse.OptionParser(
"%prog [options] -t nmap scanning targets",
Expand Down

0 comments on commit 30076f4

Please sign in to comment.