[shinken/el6] Initial import (#705108)

david hannequin hvad at fedoraproject.org
Sun Sep 16 16:35:04 UTC 2012


commit 296fcd765d3d46cc5a54f5d4978153e3ed066bee
Author: hvad <david.hannequin at gmail.com>
Date:   Sun Sep 16 18:34:56 2012 +0200

    Initial import (#705108)

 .gitignore             |    1 +
 shinken-admin.8shinken |   27 +++
 shinken-build.patch    |   12 ++
 shinken.commands.cfg   |  248 ++++++++++++++++++++++++++
 shinken.spec           |  448 ++++++++++++++++++++++++++++++++++++++++++++++++
 sources                |    1 +
 6 files changed, 737 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..7097f43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/shinken-1.0.1.tar.gz
diff --git a/shinken-admin.8shinken b/shinken-admin.8shinken
new file mode 100644
index 0000000..4e38711
--- /dev/null
+++ b/shinken-admin.8shinken
@@ -0,0 +1,27 @@
+=head1 SHINKEN-ADMIN                                                                  
+
+Command - Shinken admin command.
+
+=head1 SYNOPSIS
+
+/usr/sbin/shinken-admin 
+
+=head1 DESCRIPTION
+
+Shinken Admin 
+
+=head1 OPTIONS
+
+=over 8
+
+=head1 BUGS
+
+This command has absolutely no bugs, as I have written it. Also, as it has no bugs, there is no need for a bug tracker.
+
+=head1 AUTHORS
+
+Bshinken-arbiter was written by Jean Gabes <naparuba at gmail.com>. This manual page was written by David Hannequin <david.hannequin at gmail.com>.
+
+Both are released under the GNU Affero General Public License, version 3 or later.
+
+=cut
diff --git a/shinken-build.patch b/shinken-build.patch
new file mode 100644
index 0000000..ed922d7
--- /dev/null
+++ b/shinken-build.patch
@@ -0,0 +1,12 @@
+diff -up shinken-1.0.1/setup.py.orig shinken-1.0.1/setup.py
+--- shinken-1.0.1/setup.py.orig	2012-07-21 19:24:07.609000155 +0200
++++ shinken-1.0.1/setup.py	2012-07-22 13:43:23.787005697 +0200
+@@ -231,7 +231,7 @@ class build_config(Command):
+             os.makedirs(discovery_dir)
+         for dirname in [self.var_path, self.run_path, self.log_path, discovery_dir]:
+             if self.build_base:
+-                dirname = os.path.join(self.build_base, dirname)
++                dirname = self.build_base +"/"+ dirname
+             if not os.path.exists(dirname):
+                 os.makedirs(dirname)
+ 
diff --git a/shinken.commands.cfg b/shinken.commands.cfg
new file mode 100644
index 0000000..f7aad1a
--- /dev/null
+++ b/shinken.commands.cfg
@@ -0,0 +1,248 @@
+# Here are some sample commands for checking classics things like
+# systems and websites
+
+
+# -----------------------------------------------------------------
+#
+#      Classic network calls
+#
+# -----------------------------------------------------------------
+
+# Simple tcp check
+define command {
+       command_name	check_tcp
+       command_line	$PLUGINSDIR$/check_tcp  -H $HOSTADDRESS$ -p $ARG1$
+}
+
+# Simple web check
+define command {
+       command_name	check_http
+       command_line	$PLUGINSDIR$/check_http -H $HOSTADDRESS$
+}
+
+# And with SSL
+define command {
+       command_name     check_https
+       command_line     $PLUGINSDIR$/check_http -H $HOSTADDRESS$ -S
+}
+
+
+# Check a DNS entry
+define command {
+       command_name	check_dig
+       command_line 	$PLUGINSDIR$/check_dig -H $HOSTADDRESS$ -l $ARG1$
+}
+
+# Check a FTP service
+define command {
+       command_name	check_ftp
+       command_line	$PLUGINSDIR$/check_ftp -H $HOSTADDRESS$
+}
+
+
+# Ask a nrpe agent
+define command {
+       command_name	check_nrpe
+       command_line	$PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$
+}
+
+# Same but with arguments
+define command {
+       command_name	check_nrpe_args
+       command_line	$PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$
+}
+
+# Simple ping command
+define command {
+       command_name	check_ping
+       command_line	$PLUGINSDIR$/check_ping -H $HOSTADDRESS$ -w 3000,100% -c 5000,100% -p 1
+}
+
+# Look at good ssh launch
+define command {
+       command_name	check_ssh
+       command_line	$PLUGINSDIR$/check_ssh -H $HOSTADDRESS$
+}
+
+# Look for good smtp connection
+define command {
+       command_name	check_smtp
+       command_line	$PLUGINSDIR$/check_smtp -H $HOSTADDRESS$
+}
+
+# And SMTPS too
+define command {
+       command_name	check_smtps
+       command_line	$PLUGINSDIR$/check_smtp -H $HOSTADDRESS$ -S
+}
+
+# Look at a SSL certificate
+define command {
+       command_name	check_https_certificate
+       command_line	$PLUGINSDIR$/check_http -H $HOSTADDRESS$ -C 30
+}
+
+#Look at an HP printer state
+define command{
+       command_name     check_hpjd
+       command_line     $PLUGINSDIR$/check_hpjd -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$
+}
+
+
+# Look at Oracle connection
+define command {
+       command_name	check_oracle_listener
+       command_line	$PLUGINSDIR$/check_oracle --tns $HOSTADDRESS$
+}
+
+# Same but for MSSQL
+# Look at http://labs.consol.de/nagios/check_mssql_health/ to get it
+# Don't forget to change $MSSQLUSER$ and $MSSQLPASSWORD$ in resources.cfg before you use this ;)
+define command {
+       command_name	check_mssql_connection
+       command_line	$PLUGINSDIR$/check_mssql_health --hostname $HOSTADDRESS$ --username "$MSSQLUSER$" --password "$MSSQLPASSWORD$" --mode connection-time
+}
+
+
+# Ldap query
+# Don't forget to update the macros in the resources.cfg file
+define command {
+       command_name	check_ldap
+       command_line	$PLUGINSDIR$/check_ldap -H $HOSTADDRESS$ -b "$LDAPBASE$" -D $DOMAINUSER$ -P "$DOMAINPASSWORD$"
+}
+
+# Now the same, but in LDAPS
+# Don't forget to update the macros in the resources.cfg
+define command {
+       command_name     check_ldaps
+       command_line     $PLUGINSDIR$/check_ldaps -H $HOSTADDRESS$ -b "$LDAPBASE$" -D $DOMAINUSER$ -P "$DOMAINPASSWORD$"
+}
+
+# Distant mysql check
+define command {
+       command_name	check_mysql_connection
+       command_line	$PLUGINSDIR$/check_mysql -H $HOSTADDRESS$ -u $MYSQLUSER$ -p $MYSQLPASSWORD$
+}
+
+
+## Now ESX and VM checks
+##ARG1 and take cpu, io, net or mem
+define command{
+       command_name     check_esx_host
+       command_line     $PLUGINSDIR$/check_esx3.pl -D $VCENTER$ -H $HOSTADDRESS$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ l $ARG1$
+}
+
+define command{
+        command_name    check_esx_vm
+        command_line    $PLUGINSDIR$/check_esx3.pl -D $VCENTER$ -N $HOSTALIAS$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ -l $ARG1$
+}
+
+
+#### Then samples which are not really useful in the real world
+
+#Pollertag is a advanced features for mix architectures. Look at the doc for it.
+define command{
+	command_name	check_linux_host_alive
+	command_line	$PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p 22 -t 3
+	#poller_tag	DMZ
+	#module_type	nrpe_poller
+}
+
+#Pollertag is a advanced features for mix architectures. Look at the doc for it.
+define command{
+        command_name    check_host_alive
+        command_line    $PLUGINSDIR$/check_ping -H $HOSTADDRESS$ -w 1,50% -c 2,70% -p 1
+        #poller_tag     DMZ
+	#module_type	nrpe_poller
+}
+
+
+define command{
+        command_name    check_windows_host_alive
+        command_line    $PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p 139 -t 3
+        #poller_tag     DMZ
+	#module_type	nrpe_poller
+}
+
+
+define command{
+	command_name	check_local_disk
+	command_line	$PLUGINSDIR$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
+	#poller_tag	DMZ
+	#module_type	nrpe_poller
+}
+
+
+# Dummy check port command
+define command{
+       command_name	check_port
+       command_line	/bin/ping localhost -c 1
+ #$USER1$/check.sh $HOSTADDRESS$ -c $ARG1$
+       #poller_tag	DMZ
+       #module_type	nrpe_poller
+}
+
+# Dummy check for mysql, always CRITICAL
+define command{
+       command_name     check_mysql
+       command_line     $USER1$/check_dummy.sh 2
+}
+
+
+define command{
+        command_name    check_dummy
+        command_line    $USER1$/check_dummy.sh $ARG1$
+	#poller_tag	DMZ
+}
+
+
+define command{
+	command_name	super_event_kill_everyone
+	command_line	$USER1$/check.sh $HOSTADDRESS$ -c $ARG1$ SERVICE $_HOSTDELLSUCK$
+}
+
+
+# We say Http checks are always OK
+define command{
+	command_name	check_http2
+	command_line	$USER1$/check_dummy.sh 1
+	#module_type	nrpe_poller
+}
+
+define command{
+	command_name	check-host-alive
+	command_line	$USER1$/check.sh $HOSTADDRESS$ -c $ARG1$ HOST $_HOSTDELLSUCK$ $SERVICEDESC:srv-1:Service-2$ $SERVICEDESC::Service-30$ $HOSTADDRESS:$  $HOSTGROUPALIAS:linux-servers$
+	#module_type	dummy_poller
+}
+
+
+define command{
+       command_name	check_vm_cpu
+       command_line	$USER1$/check_esx3.pl -H lulu
+}
+
+
+#### Now notification commands
+define command{
+        command_name                    notify-host-by-email
+        command_line                    /usr/bin/printf "%b" "Shinken Notification\n\nType:$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nDate/Time: $DATE$" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
+}
+
+
+define command{
+        command_name                    notify-service-by-email
+        command_line                    /usr/bin/printf "%b" "Shinken Notification\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATE$ Additional Info : $SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
+}
+
+
+#### And Discovery commands
+define command{
+        command_name        nmap_discovery
+        command_line        $USER1$/nmap_discovery_runner.py -t $NMAPTARGETS$
+}
+
+define command{
+        command_name        vmware_esx_discovery
+        command_line        $USER1$/vmware_discovery_runner.py -V $VCENTER$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ -r "lower|nofqdn"
+}
+
diff --git a/shinken.spec b/shinken.spec
new file mode 100644
index 0000000..35510ca
--- /dev/null
+++ b/shinken.spec
@@ -0,0 +1,448 @@
+Summary:        Python Monitoring tool
+Name:           shinken
+Version:        1.0.1
+Release:        4%{?dist}
+URL:            http://%{name}-monitoring.org
+Source0:        http://%{name}-monitoring.org/pub/%{name}-%{version}.tar.gz
+Source1:        shinken-admin.8shinken
+Source2:        shinken.commands.cfg
+Patch0:         %{name}-build.patch
+License:        AGPLv3+
+Requires:       python 
+Requires:       python-pyro 
+Requires:       python-simplejson 
+Requires:       systemd-units
+Requires:       nmap 
+Requires:       sudo  
+BuildRequires:  python-devel
+BuildRequires:  python-setuptools
+BuildRequires:  systemd-units
+BuildRoot:      %{_tmppath}/%{name}-%{version}-buildroot
+Buildarch:      noarch
+
+%global shinken_user nagios
+%global shinken_group nagios
+
+%description 
+Shinken is a new monitoring tool written in Python. 
+The main goal of Shinken is to allow users to have a fully flexible 
+architecture for their monitoring system that can easily scale to large 
+environments.
+Shinken also provide interfaces with NDODB and Merlin database, 
+Livestatus connector Shinken does not include any human interfaces.
+
+%package arbiter
+Summary: Shinken Arbiter 
+Requires: %{name} = %{version}-%{release}
+
+%description arbiter
+Shinken arbiter daemon
+
+%package reactionner
+Summary: Shinken Reactionner
+Requires: %{name} = %{version}-%{release}
+
+%description reactionner
+Shinken reactionner daemon
+
+%package scheduler
+Summary: Shinken Scheduler
+Requires: %{name} = %{version}-%{release}
+
+%description scheduler
+Shinken scheduler daemon
+
+%package poller
+Summary: Shinken Poller
+Requires: %{name} = %{version}-%{release}
+Requires: nagios-plugins-all
+
+%description poller
+Shinken poller daemon
+
+%package broker
+Summary: Shinken Poller
+Requires: %{name} = %{version}-%{release}
+Requires: mysql-connector-python
+Requires: python-redis
+Requires: python-memcached
+
+%description broker
+Shinken broker daemon
+
+%package receiver
+Summary: Shinken Poller
+Requires: %{name} = %{version}-%{release}
+
+%description receiver
+Shinken receiver daemon
+
+%prep
+
+%setup -q
+
+%patch0 -p1 -b orig 
+# clean git files/
+find . -name '.gitignore' -exec rm -f {} \;
+
+# Check confuguration files 
+sed -i -e 's!./$SCRIPT!python ./$SCRIPT!' test/quick_tests.sh
+sed -i -e 's!include var/void_for_git!exclude var/void_for_git!'  MANIFEST.in
+rm  etc/packs/databases/mongodb/macros.cfg
+
+%build
+
+CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build 
+
+%install
+
+%{__python} setup.py install -O1 --skip-build --root %{buildroot} --install-scripts=/usr/sbin/ --owner %{shinken_user} --group %{shinken_group}
+
+install -d -m0755 %{buildroot}%{_sbindir}
+install -p -m0755 bin/shinken-{arbiter,admin,discovery,broker,poller,reactionner,receiver,scheduler} %{buildroot}%{_sbindir}
+
+install -d -m0755 %{buildroot}%{python_sitelib}/%{name}
+install -p %{name}/*.py %{buildroot}%{python_sitelib}/%{name}
+cp -rf %{name}/{clients,core,misc,modules,objects,plugins,webui} %{buildroot}%{python_sitelib}/%{name}
+
+install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/
+rm -rf %{buildroot}%{_sysconfdir}/%{name}/*
+
+install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/objects
+install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/objects/{contacts,discovery,hosts,services}
+
+install -p -m0644 for_fedora/etc/objects/contacts/nagiosadmin.cfg %{buildroot}%{_sysconfdir}/%{name}/objects/contacts/nagiosadmin.cfg
+install -p -m0644 for_fedora/etc/objects/hosts/localhost.cfg %{buildroot}%{_sysconfdir}/%{name}/objects/hosts/localhost.cfg
+install -p -m0644 for_fedora/etc/objects/services/linux_disks.cfg %{buildroot}%{_sysconfdir}/%{name}/objects/services/linux_disks.cfg
+install -p -m0644 for_fedora/etc/htpasswd.users %{buildroot}%{_sysconfdir}/%{name}/htpasswd.users
+install -p -m0644 for_fedora/etc/%{name}-specific.cfg %{buildroot}%{_sysconfdir}/%{name}/
+install -p -m0644 for_fedora/etc/discovery*.cfg %{buildroot}%{_sysconfdir}/%{name}/
+install -p -m0644 for_fedora/etc/{contactgroups,nagios,timeperiods,%{name}-specific,escalations,servicegroups,resource,templates}.cfg %{buildroot}%{_sysconfdir}/%{name}/
+install -p -m0644 for_fedora/etc/{brokerd,pollerd,reactionnerd,receiverd,schedulerd}.ini %{buildroot}%{_sysconfdir}/%{name}/
+
+cp -rf %{SOURCE2}  %{buildroot}%{_sysconfdir}/%{name}/commands.cfg
+
+install -d -m0755 %{buildroot}%{_unitdir}
+install -p -m0644 for_fedora/systemd/%{name}-arbiter.service %{buildroot}%{_unitdir}/%{name}-arbiter.service
+install -p -m0644 for_fedora/systemd/%{name}-broker.service %{buildroot}%{_unitdir}/%{name}-broker.service
+install -p -m0644 for_fedora/systemd/%{name}-reactionner.service %{buildroot}%{_unitdir}/%{name}-reactionner.service
+install -p -m0644 for_fedora/systemd/%{name}-scheduler.service %{buildroot}%{_unitdir}/%{name}-scheduler.service
+install -p -m0644 for_fedora/systemd/%{name}-receiver.service %{buildroot}%{_unitdir}/%{name}-receiver.service
+install -p -m0644 for_fedora/systemd/%{name}-poller.service %{buildroot}%{_unitdir}/%{name}-poller.service
+
+install -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d
+install -p -m0644 for_fedora/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/shinken
+
+install -d -m0755 %{buildroot}%{_sysconfdir}/tmpfiles.d
+install -m0644  for_fedora/%{name}-tmpfiles.conf %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf
+
+install -d -m0755 %{buildroot}%{_localstatedir}/log/%{name}
+install -d -m0755 %{buildroot}%{_localstatedir}/log/%{name}/archives
+install -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name}
+
+mkdir -p %{buildroot}%{_localstatedir}/run/
+install -d -m0755 %{buildroot}%{_localstatedir}/run/%{name}
+
+install -d -m0755 %{buildroot}%{_usr}/lib/%{name}/plugins
+install  -m0755 libexec/*{.py,.pl} %{buildroot}%{_usr}/lib/%{name}/plugins
+
+install -d -m0755 %{buildroot}%{_mandir}/man3
+install -p -m0644 doc/man/* %{buildroot}%{_mandir}/man3
+install -p -m0644 %{SOURCE1} %{buildroot}%{_mandir}/man3
+
+chmod +x %{buildroot}%{python_sitelib}/%{name}/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/daemons/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/dummy_poller.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/objects/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/livestatus_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/status_dat_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/service_perfdata_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/merlindb_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/host_perfdata_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/couchdb_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/ndodb_oracle_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/ndodb_mysql_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/login/login.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/webui_broker/*.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/action/action.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/bottle.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/clients/livestatus.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/thrift_broker/thrift_command_query.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/eltdetail/eltdetail.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/threedimpacts/threedimpacts.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/thrift_broker/thrift_query.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/livestatus_broker/mapping.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/thrift_broker/thrift_broker.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/depgraph/depgraph.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/thrift_broker/thrift_status.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/misc/{regenerator.py,datamanager.py,filter.py,sorter.py,perfdata.py}
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/thrift_broker/thrift_response.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/problems/problems.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/thrift_broker/__init__.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/glpidb_broker/__init__.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/glpidb_broker/glpidb_broker.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/dashboard/dashboard.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/system/system.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/mobile/mobile.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/impacts/impacts.py
+chmod +x %{buildroot}%{python_sitelib}/%{name}/modules/ip_tag_arbiter/{__init__.py,ip_tag_arbiter.py}
+
+chmod -x %{buildroot}%{python_sitelib}/%{name}/{property,daemon,basemodule}.py
+chmod -x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/eltdetail/htdocs/js/domtab.js
+chmod -x %{buildroot}%{python_sitelib}/%{name}/webui/bottle.py
+chmod -x %{buildroot}%{python_sitelib}/%{name}/modules/livestatus_broker/mapping.py
+chmod -x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/system/htdocs/css/system.css
+chmod -x %{buildroot}%{python_sitelib}/%{name}/modules/livestatus_broker/*.py
+chmod -x %{buildroot}%{python_sitelib}/%{name}/modules/{logstore_mongodb.py,logstore_sqlite.py}
+chmod -x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/system/htdocs/css/log.css
+chmod -x %{buildroot}%{python_sitelib}/%{name}/webui/plugins/eltdetail/htdocs/css/eltdetail2.css
+
+sed -i -e '1d;2i#!/usr/bin/env pyhton' %{buildroot}%{python_sitelib}/%{name}/__init__.py
+sed -i -e 's:#!/usr/bin/python::' %{buildroot}%{python_sitelib}/%{name}/core/__init__.py
+sed -i -e 's:#!/usr/bin/python::' %{buildroot}%{python_sitelib}/%{name}/plugins/__init__.py
+sed -i -e '1d;2i#!/usr/bin/env python' %{buildroot}%{_usr}/lib/%{name}/plugins/nsca_client.py
+sed -i -e 's!/usr/local/shinken/libexec!%{_libdir}/nagios/plugins!' %{buildroot}%{_sysconfdir}/%{name}/resource.cfg
+sed -i -e 's!/usr/lib/nagios/plugins!%{_libdir}/nagios/plugins!' %{buildroot}%{_sysconfdir}/%{name}/resource.cfg
+sed -i -e 's!/usr/local/shinken/var/arbiterd.pid!/var/run/shinken/arbiterd.pid!' %{buildroot}%{_sysconfdir}/%{name}/nagios.cfg
+sed -i -e 's!command_file=/usr/local/shinken/var/rw/nagios.cmd!command_file=/var/log/shinken/nagios.cmd!' %{buildroot}%{_sysconfdir}/%{name}/nagios.cfg
+sed -i -e 's!cfg_file=hostgroups.cfg!!' %{buildroot}%{_sysconfdir}/%{name}/nagios.cfg
+sed -i -e 's!,Windows_administrator!!' %{buildroot}%{_sysconfdir}/%{name}/contactgroups.cfg
+sed -i -e 's!/usr/local/shinken/src/!/usr/sbin/!' FROM_NAGIOS_TO_SHINKEN
+sed -i -e 's!/usr/local/nagios/etc/!/etc/shinken/!' FROM_NAGIOS_TO_SHINKEN
+sed -i -e 's!/usr/local/shinken/src/etc/!/etc/shinken/!' FROM_NAGIOS_TO_SHINKEN
+sed -i -e 's!(you can also be even more lazy and call the bin/launch_all.sh script).!!' FROM_NAGIOS_TO_SHINKEN
+
+rm -rf %{buildroot}%{_localstatedir}/{log,run,lib}/%{name}/void_for_git
+rm %{buildroot}%{_usr}/lib/%{name}/plugins/check.sh
+rm %{buildroot}%{_sysconfdir}/default/shinken
+rm -rf %{buildroot}%{_sysconfdir}/init.d/shinken*
+rm -rf %{buildroot}%{_sbindir}/%{name}-skonf
+rm -rf %{buildroot}%{_usr}/lib/%{name}/plugins/*.{pyc,pyo}
+rm -rf %{buildroot}%{_sbindir}/shinken-{arbiter,discovery,broker,poller,reactionner,receiver,scheduler}.py
+
+
+sed -i -e '1d;2i#!/usr/bin/env python' %{buildroot}%{python_sitelib}/%{name}/modules/ip_tag_arbiter/{__init__,ip_tag_arbiter}.py
+sed -i -e '1d;2i#!/usr/bin/env python' %{buildroot}%{python_sitelib}/%{name}/misc/{filter,sorter,perfdata}.py
+sed -i -e '1d;2i#!/usr/bin/env python' %{buildroot}%{python_sitelib}/%{name}/modules/glpi_arbiter.py
+sed -i -e '1d;2i#!/usr/bin/env python' %{buildroot}%{python_sitelib}/%{name}/misc/datamanager.py
+sed -i -e '1d;2i#!/usr/bin/env python' %{buildroot}%{python_sitelib}/%{name}/webui/plugins/system/system.py
+sed -i -e '1d;2i#!/usr/bin/env python' %{buildroot}%{python_sitelib}/%{name}/webui/plugins/mobile/mobile.py
+
+
+
+%clean
+
+%pre 
+echo Adding %{shinken_group} group ...
+getent group %{shinken_group} >/dev/null || groupadd -r %{shinken_group}
+echo Adding %{shinken_user} user ...
+getent passwd %{shinken_user} >/dev/null || useradd -r -g %{shinken_group} -d %{_localstatedir}/spool/nagios -s /sbin/nologin %{shinken_user}
+exit 0
+
+%post arbiter
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%post broker
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%post poller
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%post reactionner
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%post scheduler
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%post receiver
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%preun arbiter 
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable %{name}-arbiter.service > /dev/null 2>&1 || :
+    /bin/systemctl stop %{name}-arbiter.service > /dev/null 2>&1 || :
+fi
+
+%preun broker 
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable %{name}-broker.service > /dev/null 2>&1 || :
+    /bin/systemctl stop %{name}-broker.service > /dev/null 2>&1 || :
+fi
+
+%preun poller 
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable %{name}-poller.service > /dev/null 2>&1 || :
+    /bin/systemctl stop %{name}-poller.service > /dev/null 2>&1 || :
+fi
+
+%preun reactionner 
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable %{name}-reactionner.service > /dev/null 2>&1 || :
+    /bin/systemctl stop %{name}-reactionner.service > /dev/null 2>&1 || :
+fi
+
+%preun scheduler 
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable %{name}-scheduler.service > /dev/null 2>&1 || :
+    /bin/systemctl stop %{name}-scheduler.service > /dev/null 2>&1 || :
+fi
+
+%preun receiver 
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable %{name}-receiver.service > /dev/null 2>&1 || :
+    /bin/systemctl stop %{name}-receiver.service > /dev/null 2>&1 || :
+fi
+
+%postun arbiter
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart %{name}-arbiter.service >/dev/null 2>&1 || :
+fi
+
+%postun broker
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart %{name}-broker.service >/dev/null 2>&1 || :
+fi
+
+%postun poller
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart %{name}-poller.service >/dev/null 2>&1 || :
+fi
+
+%postun reactionner
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart %{name}-reactionner.service >/dev/null 2>&1 || :
+fi
+
+%postun scheduler
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart %{name}-scheduler.service >/dev/null 2>&1 || :
+fi
+
+%postun receiver
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart %{name}-receiver.service >/dev/null 2>&1 || :
+fi
+
+%files arbiter
+%{_unitdir}/%{name}-arbiter.service
+%{_sbindir}/%{name}-arbiter*
+%{_mandir}/man3/%{name}-arbiter*
+
+%files reactionner
+%{_unitdir}/%{name}-reactionner.service
+%{_sbindir}/%{name}-reactionner*
+%{_mandir}/man3/%{name}-reactionner*
+
+%files scheduler
+%{_unitdir}/%{name}-scheduler.service
+%{_sbindir}/%{name}-scheduler*
+%{_mandir}/man3/%{name}-scheduler*
+
+%files poller
+%{_unitdir}/%{name}-poller.service
+%{_sbindir}/%{name}-poller*
+%{_mandir}/man3/%{name}-poller*
+
+%files broker
+%{_unitdir}/%{name}-broker.service
+%{_sbindir}/%{name}-broker*
+%{_mandir}/man3/%{name}-broker*
+
+%files receiver
+%{_unitdir}/%{name}-receiver.service
+%{_sbindir}/%{name}-receiver*
+%{_mandir}/man3/%{name}-receiver*
+
+%files
+%{python_sitelib}/%{name}
+%{python_sitelib}/Shinken-1.0.1-py2.7.egg-info
+%{_sbindir}/%{name}-discovery
+%{_sbindir}/%{name}-admin
+%doc etc/packs COPYING THANKS 
+%{_mandir}/man3/%{name}-*
+%{_usr}/lib/%{name}/plugins
+%config(noreplace) %{_sysconfdir}/%{name}
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
+%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
+%attr(-,%{shinken_user} ,%{shinken_group}) %dir %{_localstatedir}/log/%{name}
+%attr(-,%{shinken_user} ,%{shinken_group}) %dir %{_localstatedir}/lib/%{name}
+%attr(-,%{shinken_user} ,%{shinken_group}) %dir %{_localstatedir}/run/%{name}
+
+%changelog
+* Mon Sep 10 2012 David Hannequin <david.hannequin at gmail.com> - 1.0.1-4
+- Add COPYING README THANKS file.
+- delete defattr.
+
+* Sun Sep 09 2012 David Hannequin <david.hannequin at gmail.com> - 1.0.1-3
+- Delete require python-sqlite2.
+
+* Sun Jul 22 2012 David Hannequin <david.hannequin at gmail.com> - 1.0.1-2
+- Add build patch. 
+
+* Tue Mar 13 2012 David Hannequin <david.hannequin at gmail.com> - 1.0.1-1
+- Update from upstream,
+- Add shinken packs
+
+* Mon Oct 24 2011 David Hannequin <david.hannequin at gmail.com> - 0.8.1-1
+- Update from upstream,
+- Add manpage, 
+- Add require nagios plugins.  
+
+* Mon May 30 2011 David Hannequin <david.hannequin at gmail.com> - 0.6.5-1
+- Update from upstream,
+- Add require python-redis, 
+- Add require python-memcached.
+
+* Mon May 30 2011 David Hannequin <david.hannequin at gmail.com> - 0.6.4-3
+- Fix path in default shinken file,
+- Fix path in setup.cfg, 
+- Add file FROM_NAGIOS_TO_SHINKEN.
+
+* Sun May 29 2011 David Hannequin <david.hannequin at gmail.com> - 0.6.4-2
+- Fix shinken configuration,
+- Replace macro,
+- Update from upstreamr.
+
+* Fri May 20 2011 David Hannequin <david.hannequin at gmail.com> - 0.6.4-1
+- Update from upstream. 
+
+* Sun Apr 29 2011 David Hannequin <david.hannequin at gmail.com> - 0.6-1
+- Fisrt release for fedora.
diff --git a/sources b/sources
index e69de29..c655946 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+591dc55ac92dd975a222eb779419724b  shinken-1.0.1.tar.gz


More information about the scm-commits mailing list