Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:naparuba/shinken

  • Loading branch information...
commit 38dd6f9166ff35afbdca1134d5c302e04620f9f6 2 parents 4e9ca47 + 0f0a081
@naparuba authored
View
10 bin/shinken-discovery
@@ -53,19 +53,19 @@ parser.add_option('-c', '--cfg-input',
parser.add_option('-o', '--dir-output', dest="output_dir",
help="Directory output for results")
parser.add_option('-w', '--overwrite', dest="overwrite", action='store_true',
- help="Allow overwithing xisting file (disabled by default)")
+ help="Allow overwriting an existing file (disabled by default)")
parser.add_option('-r', '--runners', dest="runners",
help="List of runners you allow to run, (like nmap,vsphere)")
parser.add_option('-m', '--macros', dest="macros",
help="List of macros (like NMAPTARGETS=192.168.0.0/24). Should be the last argument")
parser.add_option('--db', dest="dbmod",
- help="Optionnal : Name of the database module to use.")
+ help="Optional : Name of the database module to use")
parser.add_option('--backend', dest="backend",
- help="Optionnal : Name of a module that will totally manage the object writing/update thing. If you don't know what it means, maybe you should not use this option :)")
+ help="Optional : Name of a module that will totally manage the object writing/update thing. If you don't know what it means, maybe you should not use this option :)")
parser.add_option('--modules_path', dest="modules_path",
- help="Optionnal : Path for the module loading. If you don't know what it means, maybe you should not use this option :)")
+ help="Optional : Path for the module loading. If you don't know what it means, maybe you should not use this option :)")
parser.add_option('--merge', dest="merge", action='store_true',
- help="Optionnal : In multiple discovery level, it is the final host name which wins. Make possible merge of multiple IP but same final device")
+ help="Optional : In multiple discovery level, it is the final host name which wins. Make possible merge of multiple IP but same final device")
View
2  doc/man/shinken-poller.8shinken
@@ -44,3 +44,5 @@ Enable debug logging to \f[I]DEBUGFILE\f[]
.RE
.SH AUTHORS
Arthur Gautier.
+David Hannequin
+Michael Leinartas.
View
8 etc/nagios.cfg
@@ -125,10 +125,10 @@ enable_environment_macros=0
# If not need, don't dump initial states
log_initial_states=0
-# User that will be used by the arbiter. shinken/shinken
-# by default
-#shinken_user=shinken
-#shinken_group=shinken
+# User that will be used by the arbiter.
+# If commented, run as current user (root?)
+shinken_user=shinken
+shinken_group=shinken
View
8 etc/shinken-specific.cfg
@@ -551,6 +551,14 @@ define module {
module_name mongologs
module_type logstore_mongodb
mongodb_uri mongodb://localhost/?safe=true ; Set to your value
+ # If you are running a MongoDB cluster (called a “replica set” in MongoDB),
+ # you need to specify it's name here.
+ # With this option set, you can also write the mongodb_uri as a comma-separated
+ # list of host:port items. (But one is enough, it will be used as a “seed”)
+ #replica_set
+ #database
+ #collection
+ #max_logs_age
}
## Module: nulllogs
View
99 for_fedora/init.d/shinken-arbiter.init
@@ -0,0 +1,99 @@
+#!/bin/sh
+#
+# shinken-arbiter - Startup script for the Shinken Arbiter Daemon
+#
+# chkconfig: - 20 80
+# description: Shinken is a monitoring tool and the Arbiter \
+# is one of its daemon. This one reads the configuration, \
+# cuts it into parts and dispatches it. Then it waits \
+# for orders from the users to dispatch them too.
+
+### BEGIN INIT INFO
+# Provides: shinken-arbiter
+# Required-Start: $all
+# Required-Stop: $all
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Shinken arbiter daemon
+# Description: Shinken is a monitoring tool and the Arbiter
+# is one of its daemon. This one reads the configuration,
+# cuts it into parts and dispatches it. Then it waits
+# for orders from the users to dispatch them too.
+### END INIT INFO
+
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+
+daemon_args="-d -c /etc/shinken/nagios.cfg -c /etc/shinken/shinken-specific.cfg" # Arguments to run the daemon with
+pidfile=/var/run/shinken/arbiterd.pid
+
+exec="/usr/sbin/shinken-arbiter"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+
+ directory=$(dirname $pidfile)
+ [ ! -d $directory ] && mkdir -p $directory
+ chown nagios:root $directory
+
+ echo -n $"Starting $prog: "
+ $exec $daemon_args
+ # if not running, start it up here, usually something like "daemon $exec"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile}
+ # stop it here, often "killproc $prog"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ $1
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ status $prog
+ ;;
+ try-restart|condrestart)
+ if status $prog >/dev/null ; then
+ restart
+ fi
+ ;;
+ reload)
+ # If config can be reloaded without restarting, implement it here,
+ # remove the "exit", and add "reload" to the usage message below.
+ # For example:
+ # status $prog >/dev/null || exit 7
+ # killproc $prog -HUP
+ action $"Service ${0##*/} does not support the reload action: " /bin/false
+ exit 3
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
+esac
View
100 for_fedora/init.d/shinken-broker.init
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# shinken-broker - Startup script for the Shinken Broker Daemon
+#
+# chkconfig: 2345 20 80
+# Description: Shinken is a monitoring tool and the Broker \
+# is one of its daemon. This one gets the configuration \
+# from the arbiter. His purpose is to get the broks from \
+# the schedulers specified in the configuration.
+
+### BEGIN INIT INFO
+# Provides: shinken-broker
+# Required-Start: $all
+# Required-Stop: $all
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Shinken broker daemon
+# Description: Shinken is a monitoring tool and the Broker
+# is one of its daemon. This one gets the configuration
+# from the arbiter. His purpose is to get the broks from
+# the schedulers specified in the configuration
+### END INIT INFO
+
+
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+
+daemon_args="-d -c /etc/shinken/brokerd.ini" # Arguments to run the daemon with
+pidfile=/var/run/shinken/brokerd.pid
+
+exec="/usr/sbin/shinken-broker"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+
+ directory=$(dirname $pidfile)
+ [ ! -d $directory ] && mkdir -p $directory
+ chown nagios:root $directory
+
+ echo -n $"Starting $prog: "
+ $exec $daemon_args
+ # if not running, start it up here, usually something like "daemon $exec"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile}
+ # stop it here, often "killproc $prog"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ $1
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ status $prog
+ ;;
+ try-restart|condrestart)
+ if status $prog >/dev/null ; then
+ restart
+ fi
+ ;;
+ reload)
+ # If config can be reloaded without restarting, implement it here,
+ # remove the "exit", and add "reload" to the usage message below.
+ # For example:
+ # status $prog >/dev/null || exit 7
+ # killproc $prog -HUP
+ action $"Service ${0##*/} does not support the reload action: " /bin/false
+ exit 3
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
+esac
View
104 for_fedora/init.d/shinken-poller.init
@@ -0,0 +1,104 @@
+#!/bin/sh
+#
+# shinken-poller - Startup script for the Shinken Poller Daemon
+#
+# chkconfig: 2345 20 80
+# description: Shinken is a monitoring tool and the Poller \
+# is one of its daemon. This one gets the \
+# configuration from the arbiter his purpose \
+# is to actually do the checks ordered by the \
+# schedulers, and then sends the results to \
+# the schedulers specified in the configuration \
+
+### BEGIN INIT INFO
+# Provides: shinken-poller
+# Required-Start: $all
+# Required-Stop: $all
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Shinken poller daemon
+# Description: Shinken is a monitoring tool and the Poller
+# is one of its daemon. This one gets the
+# configuration from the arbiter his purpose
+# is to actually do the checks ordered by the
+# schedulers, and then sends the results to
+# the schedulers specified in the configuration
+
+### END INIT INFO
+
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+
+daemon_args="-d -c /etc/shinken/pollerd.ini" # Arguments to run the daemon with
+pidfile=/var/run/shinken/pollerd.pid
+
+exec="/usr/sbin/shinken-poller"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+
+ directory=$(dirname $pidfile)
+ [ ! -d $directory ] && mkdir -p $directory
+ chown nagios:root $directory
+
+ echo -n $"Starting $prog: "
+ $exec $daemon_args
+ # if not running, start it up here, usually something like "daemon $exec"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile}
+ # stop it here, often "killproc $prog"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ $1
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ status $prog
+ ;;
+ try-restart|condrestart)
+ if status $prog >/dev/null ; then
+ restart
+ fi
+ ;;
+ reload)
+ # If config can be reloaded without restarting, implement it here,
+ # remove the "exit", and add "reload" to the usage message below.
+ # For example:
+ # status $prog >/dev/null || exit 7
+ # killproc $prog -HUP
+ action $"Service ${0##*/} does not support the reload action: " /bin/false
+ exit 3
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
+esac
View
100 for_fedora/init.d/shinken-reactionner.init
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# shinken-reactionner - Startup script for the Shinken Reactionner Daemon
+#
+# chkconfig: 2345 20 80
+# description: Shinken is a monitoring tool and the Reactionner \
+# is one of its daemon. This one gets the configuration \
+# from the arbiter His purpose is to get the actually \
+# do the actions like sending an email ordered by the \
+# schedulers specified in the configuration. \
+
+### BEGIN INIT INFO
+# Provides: shinken-reactionner
+# Required-Start: $all
+# Required-Stop: $all
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Shinken reactionner daemon
+# Description: Shinken is a monitoring tool and the Reactionner
+# is one of its daemon. This one gets the configuration from the arbiter
+# His purpose is to get the actually do the actions like sending an email
+# ordered by the schedulers specified in the configuration
+### END INIT INFO
+
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+
+daemon_args="-d -c /etc/shinken/reactionnerd.ini" # Arguments to run the daemon with
+pidfile=/var/run/shinken/reactionnerd.pid
+
+exec="/usr/sbin/shinken-reactionner"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+
+ directory=$(dirname $pidfile)
+ [ ! -d $directory ] && mkdir -p $directory
+ chown nagios:root $directory
+
+ echo -n $"Starting $prog: "
+ $exec $daemon_args
+ # if not running, start it up here, usually something like "daemon $exec"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile}
+ # stop it here, often "killproc $prog"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ $1
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ status $prog
+ ;;
+ try-restart|condrestart)
+ if status $prog >/dev/null ; then
+ restart
+ fi
+ ;;
+ reload)
+ # If config can be reloaded without restarting, implement it here,
+ # remove the "exit", and add "reload" to the usage message below.
+ # For example:
+ # status $prog >/dev/null || exit 7
+ # killproc $prog -HUP
+ action $"Service ${0##*/} does not support the reload action: " /bin/false
+ exit 3
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
+esac
View
99 for_fedora/init.d/shinken-receiver.init
@@ -0,0 +1,99 @@
+#!/bin/sh
+#
+# shinken-receiver - Startup script for the Shinken Receiver Daemon
+#
+# chkconfig: 2345 20 80
+# description: Shinken is a monitoring tool and the Receiver \
+# is one of its daemon. This one gets the configuration \
+# from the arbiter His purpose is to get the broks from \
+# the schedulers specified in the configuration.
+
+### BEGIN INIT INFO
+# Provides: shinken-receiver
+# Required-Start: $all
+# Required-Stop: $all
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Shinken receiver daemon
+# Description: Shinken is a monitoring tool and the Receiver
+# is one of its daemon. This one gets the configuration from the arbiter
+# His purpose is to get the broks from the schedulers specified in the
+# configuration
+### END INIT INFO
+
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+
+daemon_args="-d -c /etc/shinken/receiverd.ini" # Arguments to run the daemon with
+pidfile=/var/run/shinken/receiverd.pid
+
+exec="/usr/sbin/shinken-receiver"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+
+ directory=$(dirname $pidfile)
+ [ ! -d $directory ] && mkdir -p $directory
+ chown nagios:root $directory
+
+ echo -n $"Starting $prog: "
+ $exec $daemon_args
+ # if not running, start it up here, usually something like "daemon $exec"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile}
+ # stop it here, often "killproc $prog"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ $1
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ status $prog
+ ;;
+ try-restart|condrestart)
+ if status $prog >/dev/null ; then
+ restart
+ fi
+ ;;
+ reload)
+ # If config can be reloaded without restarting, implement it here,
+ # remove the "exit", and add "reload" to the usage message below.
+ # For example:
+ # status $prog >/dev/null || exit 7
+ # killproc $prog -HUP
+ action $"Service ${0##*/} does not support the reload action: " /bin/false
+ exit 3
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
+esac
View
100 for_fedora/init.d/shinken-scheduler.init
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# shinken-scheduler - Startup script for the Shinken Scheduler Daemon
+#
+# chkconfig: 2345 20 80
+# description: Shinken is a monitoring tool and the Scheduler \
+# is one of its daemon. This one get configuration \
+# from the arbiter His purpose is only to schedule \
+# do the checks and actions specified in the \
+# configuration received from the arbiter.
+
+### BEGIN INIT INFO
+# Provides: shinken-scheduler
+# Required-Start: $all
+# Required-Stop: $all
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Shinken scheduler daemon
+# Description: Shinken is a monitoring tool and the Scheduler
+# is one of its daemon. This one get configuration from the arbiter
+# His purpose is only to schedule do the checks and actions specified
+# in the configuration received from the arbiter
+### END INIT INFO
+
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+
+daemon_args="-d -c /etc/shinken/schedulerd.ini" # Arguments to run the daemon with
+pidfile=/var/run/shinken/schedulerd.pid
+
+exec="/usr/sbin/shinken-scheduler"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+
+ directory=$(dirname $pidfile)
+ [ ! -d $directory ] && mkdir -p $directory
+ chown nagios:root $directory
+
+ echo -n $"Starting $prog: "
+ $exec $daemon_args
+ # if not running, start it up here, usually something like "daemon $exec"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile}
+ # stop it here, often "killproc $prog"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ $1
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ status $prog
+ ;;
+ try-restart|condrestart)
+ if status $prog >/dev/null ; then
+ restart
+ fi
+ ;;
+ reload)
+ # If config can be reloaded without restarting, implement it here,
+ # remove the "exit", and add "reload" to the usage message below.
+ # For example:
+ # status $prog >/dev/null || exit 7
+ # killproc $prog -HUP
+ action $"Service ${0##*/} does not support the reload action: " /bin/false
+ exit 3
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
+esac
View
14 install
@@ -381,18 +381,20 @@ function prerequisites(){
cecho " > $EPELPKG already installed" green
fi
;;
-# 6)
-# PACKAGES=$YUMPKGS
-# QUERY="rpm -q "
-# ;;
- ;;
+ *)
+ cecho " > Unsupported RedHat/CentOs version" red
+ exit 2
+ ;;
+ esac
+ ;;
Fedora)
+ case $VERS in
16|17)
PACKAGES=$YUMPKGS
QUERY="rpm -q "
;;
*)
- cecho " > Unsupported RedHat/CentOs version" red
+ cecho " > Unsupported Fedora version" red
exit 2
;;
esac
Please sign in to comment.
Something went wrong with that request. Please try again.