Hello community,
here is the log from the commit of package icinga.2451 for openSUSE:13.1:Update checked in at 2014-01-15 16:16:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:13.1:Update/icinga.2451 (Old)
and /work/SRC/openSUSE:13.1:Update/.icinga.2451.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "icinga.2451"
Changes:
--------
New Changes file:
--- /dev/null 2013-11-25 01:44:08.036031256 +0100
+++ /work/SRC/openSUSE:13.1:Update/.icinga.2451.new/icinga.changes 2014-01-15 16:16:57.000000000 +0100
@@ -0,0 +1,696 @@
+-------------------------------------------------------------------
+Tue Jan 7 10:39:42 UTC 2014 - thardeck@suse.com
+
+- imported upstream version 1.10.2
+ - includes fix for possible denial of service in CGI executables: CVE-2013-7108 (bnc#856837)
+ * core: Add an Icinga syntax plugin for Vim #4150 - LE/MF
+ * core: Document dropped options log_external_commands_user and event_profiling_enabled #4957 - BA
+ * core: type in spec file on ido2db startup #5000 - MF
+ * core: Build fails: xdata/xodtemplate.c requires stdint.h #5021 - SH
+
+ * classic ui: fix status output in JSON format not including short and long plugin output properly #5217 - RB
+ * classic ui: fix possible buffer overflows #5250 - RB
+ * classic ui: fix Off-by-one memory access in process_cgivars() #5251 - RB
+
+ * idoutils: idoutils oracle compile error #5059 - TD
+ * idoutils: Oracle update script 1.10.0 failes while trying to drop nonexisting index #5256 - RB
+- imported upstream version 1.10.1
+ * core: add line number information to config verification error messages #4967 - GB
+ * core/idoutils: revert check_source attribute due to mod_gearman manipulating in-memory checkresult list #4958 - MF
+ ** classic ui/idoutils schema: functionality is kept only for Icinga 2 support
+ * classic ui: fix context help on mouseover in cmd.cgi (Marc-Christian Petersen) #4971 - MF
+ * classic ui: correction of colspan value in status.cgi (Bernd Arnold) #4961 - MF
+ * idoutils: fix pgsql update script #4953 - AW/MF
+ * idoutils: fix logentry_type being integer, not unsigned long (thx David Mikulksi) #4953 - MF
+
+-------------------------------------------------------------------
+Mon Dec 2 17:23:21 UTC 2013 - thardeck@suse.com
+
+- fixed file permission of icingastats - bnc#851619
+
+-------------------------------------------------------------------
+Wed Oct 30 22:39:34 UTC 2013 - lars@linux-schulserver.de
+
+- switch to all unhandled problems per default in index.html
+
+-------------------------------------------------------------------
+Tue Oct 29 07:47:30 UTC 2013 - thardeck@suse.com
+
+- imported upstream version 1.10.0
+ * idoutils: slahistory table must be removed manually after enable_sla removal #4363
+ - DROP TABLE icinga_slahistory
+ * idoutils: timedevents & timedeventqueue tables are deprecated and removed #4482
+ * core: allow exclude (!) to work for regexp matches as well (Matthias Kerk) #3720 - MF
+ * core: make logging of external command errors more verbose (Anton Lofgren, op5 team) #4402 - MF
+ * core: avoid unnecessary ctime() calls when debugging is disabled, increase performance (Opsview Team) #4681 - MF
+ * core: add check source to checkresult/status data #4709 - MF
+ * core: fix check fails when using environment variables (Sven Nierlein) #2647 - MF
+ * classic ui: add display filter modification for status.cgi #852 - RB
+ * classic ui: log errors into cgi log (use_logging=1) #4389 - MF
+ * classic ui: show custom variables in extended info #4390 - MF
+ * classic ui: allow to exclude custom variable name/value based on pattern #4390 - MF
+ * classic ui: add make install-classicui-standalone-conf as seperated config installation #4664 - MF
+ * classic ui: added performance data to extinfo json output #4728 - RB
+ * classic ui: show backend version info from status file (1.x or 2.x) #4737 - MF
+ * classic ui: added option for partial servicegroups #2740 - RB
+ * classic ui: show check source in extinfo #4709 - MF
+ * classic ui: added live search #1657 - Kepi/RB
+ * idoutils: add a table trimming option for 'downtime history' #3989 - MF
+ * idoutils: allow to disable customvar status updates with dump_customvar_status=0|1 in idomod.cfg #4479 - MF
+ * idoutils: add check_source to status tables #4709 - MF
+ * idoutils: add object_id (host, service) to logentries status updates/state changes #4754 - MF
+ * install: allow enable perfdata config switch via configure #3996 - MF
+ * install: add --enable-debug=yes/no to set specific compiler flags for gdb, valgrind #4387 - MF
+ * install: detect /etc/apache2/conf-available on debian with apache2.4 #4509 - MF
+ * install: add manpages from debian upstream #4055 - MF
+
+-------------------------------------------------------------------
+Thu Oct 10 10:41:23 UTC 2013 - hanke@rzg.mpg.de
+
+- use correct variable for checking the status of the icinga-binary
+ in rcicinga
+
+-------------------------------------------------------------------
+Sun Sep 22 00:20:55 UTC 2013 - lars@linux-schulserver.de
+
+- add favicon.ico from Icinga webside to avoid messages in apache
+
+-------------------------------------------------------------------
+Mon Sep 16 10:55:44 UTC 2013 - lars@linux-schulserver.de
+
+- provide and obsolete renamed icinga-monitoring-tools in
+ subpackage monitoring-tools
+
+-------------------------------------------------------------------
+Wed Sep 11 13:08:44 UTC 2013 - lars@linux-schulserver.de
+
+- Remove conflicts: nagios for new subpackage monitoring-tools and
+ remove the (identical) binaries in Nagios package instead, so
+ nagios can recommend the new subpackage as icinga does
+- added log2ido manpage
+
+-------------------------------------------------------------------
+Thu Sep 5 17:32:58 CEST 2013 - mls@suse.de
+
+- add libperl_requires, as we link against libperl and thus
+ need a specific version of perl
+- conflict icinga-monitoring-tools with nagios
+
+-------------------------------------------------------------------
+Tue Aug 27 14:42:37 UTC 2013 - thardeck@suse.com
+
+- updated fix for bnc#834828 to use the default password if none provided
+
+-------------------------------------------------------------------
+Tue Aug 27 12:23:50 UTC 2013 - thardeck@suse.com
+
+- fixed bnc#834828 by asking for the password and changing the log permissions
+
+-------------------------------------------------------------------
+Mon Jul 8 13:31:53 UTC 2013 - thardeck@suse.com
+
+- imported upstream version 1.9.3
+ * core: fix init script status exit codes on not running daemon and present pid file #4243 - MF
+ * idoutils: fix workaround on libdbi fetch_next_row() bug applied for postgresql too, causing faulty queries #4367 - MF
+
+-------------------------------------------------------------------
+Fri Jul 5 10:04:57 UTC 2013 - thardeck@suse.com
+
+- moved convertcfg, mini_epn and new_mini_epn to the sub package
+ icinga-monitoring-tools so that it could be also used by Nagios
+
+-------------------------------------------------------------------
+Sun Jun 30 20:02:58 UTC 2013 - lars@linux-schulserver.de
+
+- update to 1.9.2:
+ * core: fix bug with non-ASCII (> 127) illegal macro output
+ characters on char-to-int cast (Jason Young) #4211 - MF
+ * core: bail early if main config file cannot be read - MF
+ * classic ui: fixed searching hostgroup results in wrong 'all'
+ view filter urls #4206 - RB
+ * classic ui: fix URL construction issue in icinga_reload_scroll_position()
+ javascript (Karsten Sühring) #4233 - MF
+ * idoutils: fix mysql: output/perfdata limits cut escaped string
+ leaving '\' at the end (Yannik Charton) #4196 - MF
+ * idoutils: bugfixes for socket queue, transactions and libdbi
+ handling #4049 - GB
+ * idoutils: fix ido2db gradually consumes more and more CPU time
+ with time #4210 - CF
+ * idoutils: fix wrong clob freeing in eventhandlers #4357 - TD
+
+-------------------------------------------------------------------
+Wed May 22 09:07:13 UTC 2013 - thardeck@suse.com
+
+- imported upstream version 1.9.1
+ * core: fix objects.cache does not get updated on (re)start, but config verify (Christian Ruppert) #4155 - MF
+ * classic ui: fixed UNICODE characters in JSON output from getting discarded #4193 - RB
+ * idoutils: fix segfaults on reload with multiple neb modules of the same binary #4033 - MF
+
+-------------------------------------------------------------------
+Tue May 7 15:30:46 UTC 2013 - thardeck@suse.com
+
+- imported upstream version 1.9.0 (check the official changelog for further details)
+ * idoutils uses a socket queue and transactions for large object dumps! #3527 #3533
+ * ido2db.cfg enable_sla is now deprecated! #3450
+ * icinga.cfg event_profiling_enabled is now deprecated! #4054
+ * core: increase performance with hash comparing hosts/services on config read #3722 - GB
+ * core: introduce warning level -vv on config verification #3510 - MF
+ * core: refuse to start if neb modules fail to load (Andreas Ericsson, op5 Team) #3812 - MF
+ * core: keep logfile open, reducing open/close performance decreases (Andreas Ericsson, op5 Team) #3390 - MF
+ * core: enhance illegal macro character processing performance (Andreas Ericsson, op5 Team) #3389 - MF
+ * core: add the notification type by string to debug logs; set CUSTOM=8, STALKING=9 (Andreas Ericsson, op5 Team) #3818 - MF
+ * core: skip writing status.dat if explicitely set to /dev/null (e.g. when using alternate data retrieval methods like IDOUtils) (Andreas Ericsson, op5 Team) #3819 - MF
+ * core: avoid writing objects.cache if set to /dev/null (Andreas Ericsson, op5 Team) #3819 - MF
+ * core: increase performance on host->service relation counter (config reading, flapping) #3820 - MF
+ * core: fix unable to exclude hostgroups when using nested hostgroups (Alexander Sulfrian) #2619 - MF
+ * classic ui: increase performance with hash comparing hosts/services to show/filter #3722 - GB
+ * classic ui: Add "set_expire_ack_by_default" to cgi configuration #3476 - CF
+ * classic ui: Add "send_ack_notifications" to cgi configuration (TheCry) #3467 - CF
+ * classic ui: Changed field size for hours to 4 when setting flexible downtime #3484 - RB
+ * ...
+
+
+-------------------------------------------------------------------
+Sun Mar 10 21:26:00 UTC 2013 - lars@linux-schulserver.de
+
+- move temp_file and temp_dir below /var/run/icinga as this location
+ is tmpfs on newer systems which speeds up tempfile creation and
+ "handles" the removal during shutdown automatically
+- use daemonchk.cgi for "rcicinga status", if possible
+
+-------------------------------------------------------------------
+Thu Feb 14 09:49:27 UTC 2013 - lars@linux-schulserver.de
+
+- provide 'monitoring_daemon' in the init script to allow other
+ init scripts to depend on it
+
+-------------------------------------------------------------------
+Mon Jan 14 10:30:39 UTC 2013 - thardeck@suse.com
+
+- imported upstream version 1.8.4
+ * core: add fix for CVE-2012-6096 - history.cgi remote command execution (Eric Stanley, Markus Frosch) #3532 - MF
+ * classic ui: Changed field size for hours to 4 when setting flexible downtime #3484 - RB
+ * classic ui: fixed Warning and Unknown States are mixed up in Alert Summary Report #3488 - RB
+ * idoutils: fix empty output/perfdata segfaults for mysql string truncate #3516 - MF
+ * idoutils: unlink leftover socket on startup, if using unix sockets - MF
+ * idoutils: fix long output data causes wrong data in database #2342 - MF
+
++++ 499 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:13.1:Update/.icinga.2451.new/icinga.changes
New:
----
README.SUSE
README.SUSE.idoutils
convertcfg.8
icinga-1.10.2.tar.gz
icinga-add-ifdefine-to-apache.patch
icinga-favicon.ico
icinga-fix-create-mysql-script.patch
icinga-rpmlintrc
icinga.8
icinga.changes
icinga.spec
icinga.sysconfig
icingastats.8
ido2db.8
log2ido.8
mini_epn.8
mini_epn_icinga.8
new_mini_epn.8
rcicinga
rcido2db
suse.de-icinga
update_icinga_paths.sh
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ icinga.spec ++++++
++++ 654 lines (skipped)
++++++ README.SUSE ++++++
Introduction
------------
CHANGES for 1.7
* bindir/idomod.o => libdir/idomod.so
* /var/lib/icinga => /var/spool/icinga
* /usr/lib/nagios/plugins/eventhandlers => /usr/lib/icinga/eventhandler
* /var/spool/icinga/icinga.cmd => /var/run/icinga/icinga.cmd
* /var/spool/icinga/ido2db.sock => /var/run/icinga/ido2db.sock
The packages are made as little dependend on each other as possible, to get the
maximum flexibility in setting up distributed monitoring environments. This
means, that you may have to install some additional packages manually. Zypper is
your friend.
Recommended OS Installation
---------------------------
Repositories:
https://build.opensuse.org/package/show?package=icinga&project=server%3Amonitoring
Order of Installation
---------------------
Keeping a certain order of installation will lead you to a working monitoring
setup in a relatively short time. Use zypper to pull the proper dependencies
automatically.
1. Install icinga
2. Install the needed nagios-plugins
3. If you need or want the classic gui, install icinga-www. If you want plain
monitoring with icinga core and configure everything else by hand, you are done.
3.1 An example user icingaadmin with password icingaadmin is installed to
/etc/icinga/htpasswd.users
3.1 Add a new basic auth user for apache:
# htpasswd /etc/icinga/htpasswd.users youradmin
4. Optional: install icinga-idoutils. Icinga Data Output Utils are necessary for
various database backed guis such as Icinga Web or Icinga Reporting. IDOUtils
use the libdbi database abstraction layer and can use MySQL or Postgresql with
this package.
- icinga-idoutils-mysql
- icinga-idoutils-pgsql
4.1 Create the idoutils database. For details see the README.SUSE.idoutils of the
icinga-idoutils-* package.
Detailed information can be found in the "Creation of Database and IDOUtils" section
in the official docs as well as the wiki howtos.
http://docs.icinga.org/latest/en/quickstart-idoutils.html
https://wiki.icinga.org/display/howtos/Setting+up+Icinga+with+IDOUtils
5. Optional: install additional Icinga guis like Icinga Web or Icinga Reporting as well
as addons such as PNP4Nagios, Check_MK or NagVis. For a suggested list please
either consult the docs or the wiki, or ask community members at icinga-portal.org
Troubleshooting
---------------
- check if you have set SELinux to "disabled" mode
- check that your local firewall rules contain appropriate rules for the
webserver and non-local database-connections
- start the components in the rigth order: database, ido2db, icinga, apache2
- check if idomod loads correctly
(/var/log/icinga/icinga.log: idomod: Successfully connected to data sink)
- check the apache2 error.log, the icinga.log and the syslog
- in case of possible bugs, turn on debugging and refer to the debug logs
Recommended Reading
-------------------
http://docs.icinga.org
http://wiki.icinga.org
http://www.icinga-portal.org
Suggestions and Bugreports
--------------------------
If you want to make suggestions for the way this software is packaged or want
to report bugs related to the packaging of this software, please report to
the SUSE bug tracker by using the link "Report Bug" on
https://build.opensuse.org/package/show?package=icinga&project=server%3Amonitoring
++++++ README.SUSE.idoutils ++++++
IDOUtils Notes for SUSE packages
================================
CHANGES for 1.7
* bindir/idomod.o => libdir/idomod.so
* /var/lib/icinga => /var/spool/icinga
* /usr/lib/nagios/plugins/eventhandlers => /usr/lib/icinga/eventhandler
* /var/spool/icinga/icinga.cmd => /var/run/icinga/icinga.cmd
* /var/spool/icinga/ido2db.sock => /var/run/icinga/ido2db.sock
==============
= IDOMOD Setup
==============
DO NOT EDIT icinga.cfg for broker_module entry!!! Icinga RPMs will use the
/etc/icinga/modules/idoutils.cfg with the module definition automatically.
Defining that twice can lead into unwanted errors!
Verify that by looking into the modules/idoutils.cfg file
# vim /etc/icinga/modules/idoutils.cfg
Other event broker modules can be defined using this module definition as well.
==============
= IDO2DB Setup
==============
Edit your database credentials in ido2db.cfg ...
# vim /etc/icinga/ido2db.cfg
db_servertype=mysql
#db_servertype=pgsql
db_host=localhost
db_port=3306
#db_port=5432
db_name=icinga
db_prefix=icinga_
db_user=icinga
db_pass=icinga
... and create the database like described below.
-------
- MySQL
-------
Create Database, User, Grants
-----------------------------
# mysql -u root -p
mysql> CREATE DATABASE icinga;
Query OK, 1 row affected (0.01 sec)
mysql> GRANT USAGE ON icinga.* TO 'icinga'@'localhost'
IDENTIFIED BY 'icinga'
WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0;
mysql> GRANT SELECT , INSERT , UPDATE , DELETE, DROP, CREATE VIEW
ON icinga.* TO 'icinga'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit
Import database schema
----------------------
# cd /usr/share/doc/packages/icinga-idoutils-mysql/mysql
# mysql -u root -p icinga < mysql.sql
------------
- Postgresql
------------
Create Database, User, Grants
-----------------------------
# su - postgres
postgres:~$ psql template1
template1=# create database icinga;
template1=# \q
postgres:~$ createlang plpgsql icinga
postgres:~$ psql
postgres=# create role icinga;
postgres=# alter role icinga login;
postgres=# grant all on database icinga to icinga;
postgres=# \q
Import database schema
----------------------
postgres:~$ cd /usr/share/doc/packages/icinga-idoutils-pgsql/pgsql
postgres:~$ psql -U icinga -d icinga < pgsql.sql
Setup trusted local icinga user
-------------------------------
Now that Postgresql does use a local user to be trusted (insecure, but good as startup),
edit pg_hba.conf accordingly. See Postgresql Manual for a more advanced setup on user
auth and privilegues.
# vim /var/lib/pgsql/data/pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
#icinga
local icinga icinga trust
and reload the Postgresql server.
==========
= Upgrade
==========
There is no db upgrade script like in Debian, so you need to keep track of that yourself.
First, get the schema version
# mysql -u root -p icinga
mysql> SELECT * from icinga_dbversion;
+--------------+----------+---------+
| dbversion_id | name | version |
+--------------+----------+---------+
| 1 | idoutils | 1.6.0 |
+--------------+----------+---------+
1 row in set (0.01 sec)
and then decide, what to do - based on the official upgrade docs:
http://docs.icinga.org/latest/en/upgrading_idoutils.html
Remember - the upgrade steps need to be applied incremential, version by version.
e.g.
# cd /usr/share/doc/packages/icinga-idoutils-mysql/mysql/upgrade/
# mysql -u root -p icinga < mysql-upgrade-1.7.0.sql
===========
= Advanced
===========
Advanced guides and upgrade information can be found in the docs and wiki:
http://docs.icinga.org/latest/en/quickstart-idoutils.html
http://docs.icinga.org/latest/en/upgrading_idoutils.html
++++++ convertcfg.8 ++++++
'\" t
.\" Title: convertcfg
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 06/10/2012
.\" Manual: convertcfg
.\" Source: Nagios
.\" Language: English
.\"
.TH "CONVERTCFG" "8" "06/10/2012" "Nagios" "convertcfg"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
convertcfg \- Nagios Config File Converter
.SH "SYNOPSIS"
.sp
\fBconvertcfg <config file> <object type>\fR
.SH "DESCRIPTION"
.sp
Nagios Config File Converter, written by Ethan Galstad (egalstad@nagios\&.org)\&.
.sp
This utility is designed to aide you in converting your old 'host' config file(s) to the new template-based config file style\&. It is also capable of converting extended host and service information definitions in your old CGI config file\&.
.sp
Supply the name of your old 'host' config file (or your old CGI config file if you're converting extended host/service definitions) on the command line, along with the type of object you would like to produce a new config file for\&. Your old config file is not overwritten - new configuration data is printed to standard output, so you can redirect it wherever you like\&.
.sp
Please note that you can only specify one type of object at a time on the command line\&.
.sp
IMPORTANT: This utility will generate Nagios 1\&..x compliant config files\&. However, the config files are not totally compatible with Nagios 2\&.x, so you will have to do some manual tweaking\&.
.SH "Valid object types:"
.sp
.if n \{\
.RS 4
.\}
.nf
timeperiods
commands
contacts
contactgroups
hosts
hostgroups
hostgroupescalations
services
servicedependencies
serviceescalations
hostextinfo
serviceextinfo
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
This manpage was written by Lars Vogdt and is based on the help text of convertcfg\&.
++++++ icinga-add-ifdefine-to-apache.patch ++++++
Index: icinga-1.7.0/sample-config/httpd.conf.in
===================================================================
--- icinga-1.7.0.orig/sample-config/httpd.conf.in
+++ icinga-1.7.0/sample-config/httpd.conf.in
@@ -5,6 +5,7 @@
# configuration file. Customize the paths, etc. as
# needed to fit your system.
+<IfDefine ICINGA>
ScriptAlias @cgiurl@ "@sbindir@"
@@ -38,4 +39,4 @@
AuthUserFile @HTTPAUTHFILE@
Require valid-user
</Directory>
-
+</IfDefine>
++++++ icinga-fix-create-mysql-script.patch ++++++
diff -rupN icinga-1.9.3.orig/module/idoutils/db/scripts/create_mysqldb.sh icinga-1.9.3/module/idoutils/db/scripts/create_mysqldb.sh
--- icinga-1.9.3.orig/module/idoutils/db/scripts/create_mysqldb.sh 2013-07-07 17:50:50.000000000 +0200
+++ icinga-1.9.3/module/idoutils/db/scripts/create_mysqldb.sh 2013-08-27 16:40:49.958328000 +0200
@@ -5,7 +5,7 @@
#--
#-- Copyright (c) 2009-2013 Icinga Development Team (http://www.icinga.org)
#--
-#-- current version: 2011-05-03 Thomas Dressler
+#-- current version: 2013-08-18 Thomas Dressler
#-- -- --------------------------------------------------------
@@ -17,10 +17,16 @@ DBUSER=icinga
DBPASS=icinga
DBHOST=localhost
DBADMIN=root
-
WD=`dirname $0`
cd $WD
WD=`pwd`
+
+#logfile privacy #4565
+LOG=$WD/create_mysqldb.log
+rm -f $LOG
+UMASK=`umask`
+umask 0077
+
cd ../mysql
echo "Enter password for mysql user '$DBADMIN' or <enter> if none"
@@ -28,6 +34,14 @@ read ROOTPASS
if [ -n "$ROOTPASS" ];then
P=-p$ROOTPASS
fi
+echo -n "Enter the new password for the new database user $DBUSER (press enter to use the default) : "
+read TEMPPASS
+if [ -z "$TEMPPASS" ]; then
+ echo "Using the default password $DBPASS"
+else
+ DBPASS=$TEMPPASS
+ echo "You can find the password (again) in the logfile generated at the end."
+fi
echo "drop existing DB $DB and user $DBUSER..."
mysql -u $DBADMIN -h $DBHOST $P mysql <$WD/create_mysqldb.log mysql <$LOG mysql <
.br
.SH DESCRIPTION
.B icinga
is a daemon program that monitors the status of various network
accessible systems, devices, and more. For more information, please
consult the online documentation available at http://www.icinga.org,
or on your Icinga server's web page.
.SH OPTIONS
.TP
main_config_file
The main configuration file. On debian systems this defaults to
/etc/icinga/icinga.cfg
.TP
\fB\-h\fR
A helpful usage message
.TP
\fB\-v\fR
Reads all data in the configuration files and performs a basic
verification/sanity check. Always make sure you verify your
config data before (re)starting Icinga.
.TP
\fB\-s\fR
Shows projected/recommended check scheduling information based
on the current data in the configuration files.
.TP
\fB\-d\fR
Starts Icinga in daemon mode (instead of as a foreground process).
.SH FILES
.TP
.IP /etc/icinga
Default configuration directory for Icinga
.SH AUTHOR
Icinga was started as Nagios by Ethan Galstad .
Icinga is maintained by the Icinga Project .
This manual page was written by sean finney for the Debian
GNU/Linux operating system (but it may be freely used, modified, and
redistributed by others).
++++++ icinga.sysconfig ++++++
## Path: Network/Monitors/Icinga
## Description: Icinga startup parameters
## Type: integer
## Default: 10
#
# Timeout during server shutdown (seconds)
# The start script kills Icinga after this timeout in double-seconds with SIGTERM
#
# Increase it, if you use Icinga in an big environment (>100 monitoring hosts)!
#
ICINGA_TIMEOUT="10"
## Type: integer
## Default: 0
#
# Nice level of running Icinga daemon.
#
ICINGA_NICELEVEL="0"
## Type: boolean
## Default: true
#
# Compress old Icinga logfiles in /var/log/icinga/archive.
#
# Icinga comes with his own logrotate scripts, so you can configure Icinga
# to rotate his logfile in /etc/icinga/icinga.cfg
# To save disk space, you can enable a cron job which compress the old
# logfiles once a week. Note: this disables the Icinga history.
ICINGA_COMPRESS_LOGFILES="true"
++++++ icingastats.8 ++++++
.TH icingastats "8" "February 2006" "sean finney " "icinga"
.SH NAME
icingastats \- report statistics information from the Icinga system
.SH SYNOPSIS
.B icingastats [\-hVL] [\-c config] [\-m] [\-d]
.br
.SH DESCRIPTION
.B icingastats
Is a program designed to provide information on the running Icinga
system. It can provide a brief summary of information, or it can
be used to export specific information about the nagios system
into an MRTG-compatible format.
For more information please consult the Icinga online documentation
available at http://www.icinga.org or the documentation available
with your icinga server's web page.
.SH OPTIONS
.TP
\fB\-c\fR|\-\-config=FILE
The main configuration file. On debian systems this defaults to
/etc/icinga/icinga.cfg
.TP
\fB\-m\fR|\-\-mrtg
Print output in MRTG-compatible format. For more details run
icingastats with \-\-help
.TP
\fB\-d\fR|\-\-data=VARS
Comma-seperated list of variables to output in MRTG format. For
more details run icingastats with \-\-help.
.TP
\fB\-h\fR|\-\-help
A helpful usage message
.TP
\fB\-V\fR|\-\-version
Print version information
.TP
\fB\-L\fR|\-\-license
Print license details
.SH FILES
.TP
.IP /etc/icinga
Default configuration directory for icinga
.SH AUTHOR
Icinga was started as Nagios by Ethan Galstad . Icinga is
maintained by the Icinga Project . This manual page was
written by sean finney for the Debian GNU/Linux operating
system (but it may be freely used, modified, and redistributed by others).
++++++ ido2db.8 ++++++
'\" t
.\" Title: ido2db
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 03/16/2010
.\" Manual: ido2db
.\" Source: Nagios/Icinga
.\" Language: English
.\"
.TH "IDO2DB" "8" "03/16/2010" "Nagios/Icinga" "ido2db"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ido2db \- store icinga events and configs in database
.SH "SYNOPSIS"
.sp
\fBido2db\fR \-c [\-i] [\-f]
.SH "DESCRIPTION"
.sp
Stores Icinga event and configuration data to a database for later retrieval and processing\&. Clients that are capable of sending data to the IDO2DB daemon include the LOG2NDO utility and IDOMOD event broker module\&.
.SH "OPTIONS"
.PP
\fB\-i\fR
.RS 4
Run under INETD/XINETD\&.
.RE
.PP
\fB\-f\fR
.RS 4
Don\(cqt daemonize, run in foreground\&.
.RE
.SH "AUTHOR"
.sp
This manpage was written by Alexander Wirt for the Debian Distribution\&.
++++++ log2ido.8 ++++++
'\" t
.\" Title: log2ido
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 09/11/2013
.\" Manual: log2ido
.\" Source: Icinga
.\" Language: English
.\"
.TH LOG2IDO 8 "September 11, 2013" "Icinga" "log2ido"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
log2ido \- sends the contents of an archived Icinga log file to ido2db daemon
.SH SYNOPSIS
.B \fBlog2ido\fR
\-s <source> \-d <dest> \-i <instance> [\-t <type>] [\-p <port>]
.SH DESCRIPTION
.sp
Sends the contents of an archived Icinga log file to STDOUT, a TCP socket, or a Unix domain socket in a format that is understood by the \fBIDO2DB\fR daemon.
.SH OPTIONS
.TP
.B \-s <source>
Name of the Icinga log file to read from.
.TP
.B \-d <dest>
If destination is a TCP socket, the address/hostname to connect to.
If destination is a Unix domain socket, the path to the socket.
If destination is STDOUT (for redirection, etc), a single dash (-).
.TP
.B \-i <instance>
This option identifies the "name" associated with this particular
instance of Icinga and is used to seperate data coming from multiple
instances. Defaults to 'default' (without quotes).
.TP
.B \-t <type>
Specifies the type of destination socket. Valid values include:
tcp
unix (default)
.TP
.B \-p <port>
Port number to connect to if destination is TCP socket.
.SH AUTHOR
.sp
This manpage was written by Lars Vogdt for the openSUSE Distribution\&.
.SH SEE ALSO
ido2db(8)
++++++ mini_epn.8 ++++++
'\" t
.\" Title: mini_epn
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 09/19/2009
.\" Manual: mini_epn
.\" Source: Nagios
.\" Language: English
.\"
.TH "MINI_EPN" "8" "09/19/2009" "Nagios" "mini_epn"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
mini_epn \- run nagiosplugins inside of an embedded perl interpreter
.SH "SYNOPSIS"
.sp
\fBmini_epn\fR
.SH "DESCRIPTION"
.sp
After calling \fBmini_epn\fR an embedded perl interpreter gets started and asks for you a script to execute under the interpreter\&. To exit the interpreter loop press ^d at the prompt\&. Please note that the maximal input length is 1024 characters.
.SH "EXAMPLES"
.sp
.if n \{\
.RS 4
.\}
.nf
# mini_epn
Enter file name: /usr/lib/nagios/plugins/check_linux_raid.pl
embedded perl plugin return code and output was: 0 & \'OK md0 status=[UU]\&. md1 status=[UU]\&.
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
This manpage was written by Alexander Wirt for the Debian Distribution and adapted for openSUSE by Lars Vogdt\&.
++++++ mini_epn_icinga.8 ++++++
'\" t
.\" Title: mini_epn
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 09/19/2009
.\" Manual: mini_epn
.\" Source: Nagios/Icinga
.\" Language: English
.\"
.TH "MINI_EPN" "8" "09/19/2009" "Nagios/Icinga" "mini_epn"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
mini_epn \- too to nagios/icingaplugins inside of an embedded perl interpreter
.SH "SYNOPSIS"
.sp
\fBmini_epn\fR
.SH "DESCRIPTION"
.sp
After calling \fBmini_epn\fR an embedded perl interpreter gets started and asks for you a script to execute under the interpreter\&. To exit the interpreter loop press ^d at the prompt\&.
.SH "EXAMPLES"
.sp
.if n \{\
.RS 4
.\}
.nf
# mini_epn
Enter file name: /usr/lib/nagios/plugins/check_linux_raid
embedded perl plugin return code and output was: 0 & \'OK md0 status=[UU]\&. md1 status=[UU]\&.
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
This manpage was written by Alexander Wirt for the Debian Distribution\&.
++++++ new_mini_epn.8 ++++++
'\" t
.\" Title: new_mini_epn
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 09/19/2009
.\" Manual: mini_epn
.\" Source: Nagios
.\" Language: English
.\"
.TH "NEW_MINI_EPN" "8" "06/10/2012" "Nagios" "new_mini_epn"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
new_mini_epn \- run nagiosplugins inside of an embedded perl interpreter
.SH "SYNOPSIS"
.sp
\fBnew_mini_epn\fR
.SH "DESCRIPTION"
.sp
After calling \fBnew_mini_epn\fR an embedded perl interpreter gets started and asks for you a script to execute under the interpreter\&. To exit the interpreter loop press ^d at the prompt\&.
.SH "EXAMPLES"
.sp
.if n \{\
.RS 4
.\}
.nf
# new_mini_epn
plugin command line: /usr/lib/nagios/plugins/check_mailq -w 10 -c 20
embedded perl plugin return code and output was: 0 & OK: mailq is empty|unsent=0;10;20;0
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
This manpage was written by Lars Vogdt for the openSUSE Distribution based on the mini_epn manpage written by Alexander Wirt for the Debian Distribution\&.
++++++ rcicinga ++++++
#! /bin/sh
# Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany.
# 2002 SuSE Linux AG Nuernberg, Germany.
# 2007 SuSE Linux GmbH Nuernberg, Germany.
# 2010 SUSE LINUX Products GmbH, Nuernberg, Germany
#
# Author: Wolfgang Rosenauer, Lars Vogdt
#
#
# /etc/init.d/icinga
#
# and symbolic its link
#
# /usr/sbin/rcicinga
#
# System startup script for icinga
#
### BEGIN INIT INFO
# Provides: icinga monitoring_daemon
# Required-Start: $local_fs $remote_fs $syslog $network
# Required-Stop: $local_fs $remote_fs $syslog $network
# Should-Start: $time sendmail httpd2 $named cron ido2db
# Should-Stop: sendmail ido2db
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Network monitor Icinga
# Description: Starts and stops the Icinga monitor
# used to provide network services status for hosts,
# services and networks.
### END INIT INFO
. /etc/rc.status
ICINGA_BIN='/usr/sbin/icinga'
ICINGA_CFG='/etc/icinga/icinga.cfg'
ICINGA_SYSCONFIG='/etc/sysconfig/icinga'
ICINGA_CFG_ERR_LOG='/var/log/icinga/config.err'
ICINGA_DAEMONCHK='/usr/lib/icinga/cgi/daemonchk.cgi'
# Read config and log errors in logfile
function config_check () {
case "$1" in
verbose)
$ICINGA_BIN -v "$ICINGA_CFG" >"$ICINGA_CFG_ERR_LOG" 2>&1
if [ $? -eq 0 ]; then
return 0
else
return 1
fi
;;
*)
$ICINGA_BIN -v "$ICINGA_CFG" >/dev/null 2>&1
if [ $? -eq 0 ]; then
return 0
else
$ICINGA_BIN -v "$ICINGA_CFG" >"$ICINGA_CFG_ERR_LOG" 2>&1
return 1
fi
;;
esac
}
# grab a config option
function get_var() {
if [ -n "$2" ]; then
set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'`
else
set -- `grep ^$1 "$ICINGA_CFG" | sed 's@=@ @' | tr -d '[:cntrl:]'`
fi
shift # remove first ARG => search-string
echo $*
}
# check some default files and directories
function check_files() {
# remove some perhaps left over files
for file in "$command_file" "$lock_file" "$status_file" "$temp_file"; do
test -f "$file" && rm -f "$file"
done
}
function check_lock_file() {
PIDDIR=$(dirname $lock_file)
case "$PIDDIR" in
/var/run)
if [ x"$icinga_user" != x"root" ]; then
DATESTRING=`date +"%Y%m%d"`
mv -f "$ICINGA_CFG" "$ICINGA_CFG-$DATESTRING"
sed -e "s|^lock_file.*|pid_file=$lock_file|g" "$ICINGA_CFG-$DATESTRING" > "$ICINGA_CFG"
/bin/logger -t rcicinga "Configured $lock_file in $ICINGA_CFG moved to $lock_file. Backup is $ICINGA_CFG-$DATESTRING"
test -f "$lock_file" && rm -f "$lock_file"
install -d -m755 -o$icinga_user -g$icinga_group $(dirname "$lock_file")
else
test -d "$PIDDIR" || mkdir -p "$PIDDIR"
fi
;;
*)
install -d -m755 -o$icinga_user -g$icinga_group $(dirname "$lock_file")
esac
}
# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
test -x "$ICINGA_BIN" || { echo "$ICINGA_BIN not installed or not executable.";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file
test -r "$ICINGA_CFG" || { echo "$ICINGA_CFG not existing or readable.";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# Check for existence of sysconfig file and read it
test -r "$ICINGA_SYSCONFIG" || { echo "$ICINGA_SYSCONFIG not existing or readable.";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
. "$ICINGA_SYSCONFIG"
# set values for sysconfig vars
if [ -n "$ICINGA_NICELEVEL" ]; then
NICELEVEL="-n $ICINGA_NICELEVEL"
else
NICELEVEL="-n 0"
fi
if [ -z "$ICINGA_TIMEOUT" ]; then
ICINGA_TIMEOUT=10
fi
#
# get variables from config file
#
icinga_user="$(get_var icinga_user)"
icinga_group="$(get_var icinga_group)"
lock_file="$(get_var lock_file)"
status_file="$(get_var status_file)"
log_file="$(get_var log_file)"
temp_file="$(get_var temp_file)"
temp_path="$(get_var temp_path)"
state_retention_file="$(get_var state_retention_file)"
command_file="$(get_var command_file)"
resource_file="$(get_var resource_file)"
check_result_path="$(get_var check_result_path)"
check_external_commands="$(get_var check_external_commands)"
#
# use default values if above check doesn't work
#
: ${icinga_user:=icinga}
: ${icinga_group:=icinga}
: ${icinga_cmdgrp:=icingacmd}
: ${resource_file:=/etc/icinga/resource.cfg}
# check ownership files
: ${check_result_path:=/var/spool/icinga/checkresults}
: ${log_file:=/var/log/icinga/icinga.log}
: ${state_retention_file:=/var/spool/icinga/retention.dat}
: ${status_file:=/var/spool/icinga/status.dat}
: ${check_external_commands:=0}
: ${temp_path:=/var/run/icinga/tmp}
: ${temp_file:=/var/run/icinga/icinga.tmp}
# files to remove
: ${command_file:=/var/run/icinga/icinga.cmd}
: ${lock_file:=/var/run/icinga/icinga.pid}
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting Icinga "
# create checkresult dir if missing
if [ ! -d "$check_result_path" ]; then
mkdir -p "$check_result_path"
chown $icinga_user:$icinga_group "$check_result_path"
chmod 775 "$check_result_path"
fi
if [ ! -d "$temp_path" ]; then
case "$temp_path" in
/var/run/icinga/tmp)
install -d -m775 -o$icinga_user -g$icinga_group "$temp_path"
;;
*)
/bin/logger -t rcicinga "$temp_path does not exist - creating now"
install -d -m775 -o$icinga_user -g$icinga_group "$temp_path"
;;
esac
fi
config_check
if [ $? -eq 0 ]; then
# check if icinga is already running
ICINGAPID=$(pidof "$ICINGA_BIN")
if [ -z "$ICINGAPID" ]; then
check_files
check_lock_file
fi
startproc $NICELEVEL -p "$lock_file" "$ICINGA_BIN" -d "$ICINGA_CFG"
if [ "$check_external_commands" != 0 ]; then
while [ ! -e "$command_file" ] && [ $ICINGA_TIMEOUT -gt 0 ]; do
sleep 1
ICINGA_TIMEOUT=$[$ICINGA_TIMEOUT-1]
done
chgrp $icinga_cmdgrp "$command_file"
fi
else
echo "Error in configuration - please read $ICINGA_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
stop)
echo -n "Shutting down Icinga "
# we have to wait for icinga to exit and remove its
# own Lockfile, otherwise a following "start" could
# happen, and then the exiting icinga will remove the
# new Lockfile, allowing multiple icinga daemons
# to (sooner or later) run - John Sellens
if checkproc "$ICINGA_BIN" ; then
killproc -p "$lock_file" -TERM "$ICINGA_BIN"
sleep 1
if [ -e "$lock_file" ]; then
echo "Warning - Icinga did not exit in a timely manner. Waiting..."
while [ -e "$lock_file" ] && [ $ICINGA_TIMEOUT -gt 0 ] ; do
sleep 1
ICINGA_TIMEOUT=$[$ICINGA_TIMEOUT-1]
echo -n '.'
[ $ICINGA_TIMEOUT -eq 41 ] && echo
done
fi
if checkproc "$ICINGA_BIN" ; then
killproc -p "$lock_file" -SIGKILL "$ICINGA_BIN"
echo -n "Warning: Icinga killed"
fi
else
echo -n "Icinga not running"
rc_failed 7
fi
check_files
rc_reset
rc_status -v
;;
try-restart)
## Do a restart only if the service was active before.
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
rc_status
;;
restart)
$0 check
$0 stop
$0 start
rc_status
;;
reload|force-reload)
echo -n "Reload service Icinga "
config_check
if [ $? -eq 0 ]; then
echo -n "Passed configuration check - reloading..."
killproc -HUP -p "$lock_file" "$ICINGA_BIN"
else
echo "- Error in configuration files"
echo -n "- aborting reload - please read $ICINGA_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
status)
echo -n "Checking for Icinga "
if [ -x "$ICINGA_DAEMONCHK" ]; then
if "$ICINGA_DAEMONCHK" -l "$lock_file"; then
rc_failed 0
else
rc_failed 1
fi
else
checkproc -p "$lock_file" "$ICINGA_BIN"
fi
rc_status -v
;;
check)
echo -n "Starting configuration check "
config_check
if [ $? -eq 0 ]; then
echo "- passed configuration check"
test -f $ICINGA_CFG_ERR_LOG && rm $ICINGA_CFG_ERR_LOG
rc_reset
else
echo "- detected Error in configuration files"
echo "Please read $ICINGA_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
check_verbose|show-errors)
echo "Running verbose configuration check..."
config_check verbose
exitcode=$?
cat "$ICINGA_CFG_ERR_LOG"
rc_failed $exitcode
rc_status -v
rc_exit
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|reload|check|check_verbose|show-errors}"
exit 1
;;
esac
rc_exit
++++++ rcido2db ++++++
#!/bin/sh
#
# Startup script for IDO2DB
#
# /etc/init.d/ido2db
# and its symbolic link
# /usr/sbin/rcido2db
#
### BEGIN INIT INFO
# Provides: ido2db
# Required-Start: $syslog $remote_fs
# Should-Start: mysql
# Required-Stop: $syslog $remote_fs
# Should-Stop: mysql
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Icinga Data Output Utilities
# Description: Automatic startup and shutdown of Icinga IDO2DB.
# IDOUtils is an Icinga addon allowing you to store Icinga data (current status
# information, state history, notification history, etc.) in a MySQL database.
### END INIT INFO
# Note on runlevels:
# 0 - halt/poweroff 6 - reboot
# 1 - single user 2 - multiuser without network exported
# 3 - multiuser w/ network (text mode) 5 - multiuser w/ network and X11 (xdm)
. /etc/rc.status
IDO2DB_BIN="/usr/sbin/ido2db"
IDO2DB_CFG="/etc/icinga/ido2db.cfg"
ICINGA_SYSCONFIG="/etc/sysconfig/icinga"
# grab a config option
function get_var() {
if [ -n "$2" ]; then
set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'`
else
set -- `grep ^$1 "$IDO2DB_CFG" | sed 's@=@ @' | tr -d '[:cntrl:]'`
fi
shift # remove first ARG => search-string
echo $*
}
# check some default files and directories
function check_files() {
# remove some perhaps left over files
for file in "$lock_file" "$socket_name"; do
test -e "$file" && rm -f "$file"
done
# create lock directory if it doesn't exist
PIDDIR=$(dirname $lock_file)
test -d "$PIDDIR" || install -d -m755 -o$ido2db_user -g$ido2db_group "$PIDDIR"
}
test -x $IDO2DB_BIN || { echo "$IDO2DB_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
test -r $IDO2DB_CFG || { echo "$IDO2DB_CFG not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# Check for existence of sysconfig file and read it
test -r "$ICINGA_SYSCONFIG" || { echo "$ICINGA_SYSCONFIG not existing or readable.";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
. "$ICINGA_SYSCONFIG"
# set values for sysconfig vars
if [ -n "$IDO2DB_NICELEVEL" ]; then
NICELEVEL="-n $IDO2DB_NICELEVEL"
else
NICELEVEL="-n 0"
fi
if [ -z "$IDO2DB_TIMEOUT" ]; then
IDO2DB_TIMEOUT=10
fi
#
# get variables from config file
#
lock_file="$(get_var lock_file)"
socket_name="$(get_var socket_name)"
ido2db_user="$(get_var ido2db_user)"
ido2db_group="$(get_var ido2db_group)"
#
# use default values if above check doesn't work
#
: ${lock_file:=/var/run/icinga/ido2db.pid}
: ${socket_name:=/var/run/icinga/ido2db.sock}
: ${ido2db_user:=icinga}
: ${ido2db_group:=icinga}
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting Ido2db "
IDO2DBPID=$(pidof "$IDO2DB_BIN")
if [ -z "$IDO2DBPID" ]; then
check_files
fi
startproc $NICELEVEL -p "$lock_file" "$IDO2DB_BIN" -c "$IDO2DB_CFG"
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down Ido2db "
if checkproc "$IDO2DB_BIN" ; then
killproc -p "$lock_file" -TERM "$IDO2DB_BIN"
sleep 1
if [ -e "$lock_file" ]; then
echo "Warning - Ido2db did not exit in a timely manner. Waiting..."
while [ -e "$lock_file" ] && [ $IDO2DB_TIMEOUT -gt 0 ] ; do
sleep 1
IDO2DB_TIMEOUT=$[$IDO2DB_TIMEOUT-1]
echo -n '.'
[ $IDO2DB_TIMEOUT -eq 41 ] && echo
done
fi
if checkproc "$IDO2DB_BIN" ; then
killproc -p "$lock_file" -SIGKILL "$IDO2DB_BIN"
echo -n "Warning: Ido2db killed"
fi
else
echo -n "Ido2db not running"
rc_failed 7
fi
check_files
rc_reset
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Do a restart only if the service was active before.
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
reload|force-reload)
echo -n "Reload service Ido2db "
config_check
if [ $? -eq 0 ]; then
echo -n "Passed configuration check - reloading..."
killproc -HUP -p "$lock_file" "$IDO2DB_BIN"
else
echo "- Error in configuration files"
echo -n "- aborting reload - please read $IDO2DB_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
status)
echo -n "Checking for Ido2db "
checkproc -p "$lock_file" "$IDO2DB_BIN"
rc_status -v
;;
check)
echo -n "Starting configuration check "
config_check
if [ $? -eq 0 ]; then
echo "- passed configuration check"
test -f $IDO2DB_CFG_ERR_LOG && rm $IDO2DB_CFG_ERR_LOG
rc_reset
else
echo "- detected Error in configuration files"
echo "Please read $IDO2DB_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
check_verbose)
echo "Running verbose configuration check..."
config_check verbose
exitcode=$?
cat "$IDO2DB_CFG_ERR_LOG"
rc_failed $exitcode
rc_status -v
rc_exit
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|reload|check|check_verbose}"
exit 1
;;
esac
rc_exit
++++++ suse.de-icinga ++++++
#!/usr/bin/env bash
#
# Compress old logfiles in /var/log/icinga/archives/
# once a week, if sysconfig variable is set to true
#
if [ -r /etc/sysconfig/icinga ]; then
. /etc/sysconfig/icinga
else
echo "/etc/sysconfig/icinga not found or not readable." >&2
exit 1
fi
if [[ "$ICINGA_COMPRESS_LOGFILES" = "true" ]]; then
for f in /var/log/icinga/archives/*.log ; do
if [[ -r "$f" ]] ; then
/usr/bin/bzip2 "$f"
fi
done
fi
++++++ update_icinga_paths.sh ++++++
#!/bin/bash
update_config_files ()
{
package="$1"
config_file="$2"
old_path="$3"
new_path="$4"
if [ -f "${config_file}" ] && /bin/grep -q "${old_path}" "${config_file}" > /dev/null 2>&1; then
DATE=$(date +"%Y%m%d%H%M")
#create backup if there wasn't one created this minute
if [ ! -f "${config_file}_rpm_update-${DATE}" ]
then
cp "${config_file}" "${config_file}_rpm_update-${DATE}" ||
{ %{logmsg} "Could not create backup file
${config_file}_rpm_update-${DATE}" >&2; exit 1; }
fi
sed -i "s|${old_path}|${new_path}|g" "${config_file}" \
|| { %{logmsg} "Could not adapt ${config_file} - please do manually" >&2 ; exit 1; }
%{logmsg} "WARNING: ${config_file} adapted to new configuration"
%{logmsg} " (see >rpm -q ${package} --changelog | less<)"
%{logmsg} " Backup file is: ${config_file}_rpm_update-$DATE"
fi
if [ -e "${old_path}" ]
then
%{logmsg} "WARNING: ${old_path} has been moved"
%{logmsg} " to ${new_path}"
%{logmsg} " Please check/adapt your configuration/scripts and move the still needed files to the new directory!"
fi
}
move_file_to_new_location ()
{
old_path="$1"
new_path="$2"
if [ -f "${old_path}" ]
then
cp -ua "${old_path}" "${new_path}" || \
{ %{logmsg} "Could not copy ${old_path} to ${new_path} \
because a newer version already exists" >&2; exit 1; }
rm "${old_path}"
fi
}
# update icinga config files
if [ "$1" == "icinga" ]
then
# determine if service was running to be able to restart it after the update
[ -f %{icinga_lockfile} ] && service_was_running=true
[ $service_was_running ] && rcicinga stop &>/dev/null || :
#############################################
# update paths to new run directory
update_config_files "icinga" "%{icinga_sysconfdir}/icinga.cfg" "/var/spool/icinga/icinga.cmd" "%{icinga_cmdfile}"
# update paths to new run directory
#############################################
#############################################
# update paths to new eventhandler directory
update_config_files "icinga" "%{icinga_sysconfdir}/resource.cfg" "/usr/lib/nagios/plugins/eventhandlers" "%{icinga_eventhandlerdir}"
# update paths to new eventhandler directory
#############################################
#############################################
# update paths to new spool directory
update_config_files "icinga" "%{icinga_sysconfdir}/icinga.cfg" "/var/lib/icinga" "%{icinga_spooldir}"
update_config_files "icinga" "%{icinga_sysconfdir}/objects/commands.cfg" "/var/lib/icinga" "%{icinga_spooldir}"
# update paths to new spool directory
#############################################
#############################################
# move necessary data to new spool directory
move_file_to_new_location "/var/lib/icinga/retention.dat" "%{icinga_spooldir}/"
move_file_to_new_location "/var/lib/icinga/idomod.tmp" "%{icinga_spooldir}/"
move_file_to_new_location "/var/lib/icinga/objects.precache" "%{icinga_spooldir}/"
# move necessary data to new spool directory
#############################################
#############################################
# cleanup remaining unneeded files
test -e "/var/spool/icinga/icinga.cmd" && rm "/var/spool/icinga/icinga.cmd"
test -f "/var/lib/icinga/status.dat" && rm "/var/lib/icinga/status.dat"
test -f "/var/lib/icinga/objects.cache" && rm "/var/lib/icinga/objects.cache"
# cleanup remaining unneeded files
#############################################
# start service if it was running before
[ $service_was_running ] && rcicinga start &>/dev/null || :
fi
# update icinga-idoutils config files
if [ "$1" == "icinga-idoutils" ]
then
# determine if service was running
[ -f %{icinga_ido2db_lockfile} ] && service_was_running=true
[ $service_was_running ] && rcido2db stop &>/dev/null || :
#############################################
# update paths to new run directory
update_config_files "icinga-idoutils" "%{icinga_sysconfdir}/ido2db.cfg" "/var/spool/icinga/ido2db.sock" "%{icinga_ido2db_socketfile}"
update_config_files "icinga-idoutils" "%{icinga_sysconfdir}/idomod.cfg" "/var/spool/icinga/ido2db.sock" "%{icinga_ido2db_socketfile}"
# cleanup old socket file
test -e "/var/spool/icinga/ido2db.sock" && rm "/var/spool/icinga/ido2db.sock"
# update paths to new spool directory
#############################################
# start service if it was running before and there wasn't a major upgrade
[ $service_was_running ] && rcido2db start &>/dev/null || :
fi
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org