]> granicus.if.org Git - icinga2/commitdiff
Initial commit of the Icinga Template Library.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 1 Feb 2013 10:39:06 +0000 (11:39 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 1 Feb 2013 10:39:06 +0000 (11:39 +0100)
Fixes #2977

Makefile.am
configure.ac
itl/Makefile.am [new file with mode: 0644]
itl/itl-host.conf [new file with mode: 0644]
itl/itl-service-common.conf [new file with mode: 0644]
itl/itl-service.conf [new file with mode: 0644]
itl/itl-standalone.conf [new file with mode: 0644]
itl/itl.conf [new file with mode: 0644]

index e81974feb93c77524ff73c4fa19d5be73b94928a..645c5ac1e208147030bb526c9a504043eb98a5cd 100644 (file)
@@ -8,7 +8,8 @@ SUBDIRS = \
        lib \
        components \
        icinga-app \
-       test
+       test \
+       itl
 #doc
 icinga2docdir = ${docdir}
 icinga2doc_DATA = \
index 4f953a38233a5f67410f58a46b60d07fbcc7f855..775f3db558290fa4f729dd1133a206ccce87e5f4 100644 (file)
@@ -97,6 +97,7 @@ components/replication/Makefile
 docs/Doxyfile
 icinga-app/Makefile
 icinga-app/config/Makefile
+itl/Makefile
 lib/Makefile
 lib/base/Makefile
 lib/config/Makefile
diff --git a/itl/Makefile.am b/itl/Makefile.am
new file mode 100644 (file)
index 0000000..279a2d7
--- /dev/null
@@ -0,0 +1,7 @@
+icinga2itldir = ${datarootdir}/icinga2/itl
+icinga2itl_DATA = \
+       itl.conf \
+       itl-host.conf \
+       itl-service.conf \
+       itl-service-common.conf \
+       itl-standalone.conf
diff --git a/itl/itl-host.conf b/itl/itl-host.conf
new file mode 100644 (file)
index 0000000..28c02bc
--- /dev/null
@@ -0,0 +1,29 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+
+object HostGroup "all-hosts" {
+    alias = "All Hosts"
+}
+
+abstract object Host "itl-host" {
+    hostgroups = { "all-hosts" },
+    
+    services = { "ping" },
+    hostchecks = { "ping" }
+}
diff --git a/itl/itl-service-common.conf b/itl/itl-service-common.conf
new file mode 100644 (file)
index 0000000..de3e713
--- /dev/null
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+ abstract object Service "ping" inherits "plugin-service" {
+       check_command = "$plugindir$/check_ping -H $address$ -w $wrta$,$wpl$% -c $crta$,$cpl$%a -p $packets$ -t $timeout$",
+
+       macros = {
+               wrta = 100,
+               wpl = 5,
+                
+               crta = 200,
+               cpl = 15,
+                
+               packets = 5,
+               timeout = 0
+       }
+}
+
+abstract object Service "dummy" inherits "plugin-service" {
+    check_command = "$plugindir$/check_dummy $state$ '$text$'",
+    
+    macros = {
+        state = 0,
+        text = "Check was successful."
+    }
+}
+
+abstract object Service "check_http_vhost" inherits "plugin-service" {
+    check_command = "$plugindir$/check_http -H $vhost$"
+}
+
+abstract object Service "check_http_ip" inherits "plugin-service" {
+    check_command = "$plugindir$/check_http -I $address$"
+}
+
+abstract object Service "load" inherits "plugin-service" {
+    check_command = "$plugindir$/check_load -w $wload1$,$wload5$,$wload15$ -c $cload1$,$cload5$,$cload15$",
+    
+    macros = {
+        wload1 = 0,
+        wload5 = 0,
+        wload15 = 0,
+        
+        cload1 = 0,
+        cload5 = 0,
+        crload5 = 0
+    }
+}
diff --git a/itl/itl-service.conf b/itl/itl-service.conf
new file mode 100644 (file)
index 0000000..5b6a348
--- /dev/null
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+
+object ServiceGroup "all-services" {
+    alias = "All Services"
+}
+
+abstract object Service "itl-service" {
+    servicegroups = { "all-services" }
+}
+
+abstract object Service "plugin-service" inherits "itl-service" {
+       methods = {
+               check = "native::PluginCheck"
+       }
+}
diff --git a/itl/itl-standalone.conf b/itl/itl-standalone.conf
new file mode 100644 (file)
index 0000000..95d184f
--- /dev/null
@@ -0,0 +1,21 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+local object Component "checker" {}
+local object Component "delegation" {}
diff --git a/itl/itl.conf b/itl/itl.conf
new file mode 100644 (file)
index 0000000..34d5079
--- /dev/null
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+
+/**
+ * This is the Icinga Templare Library, a collection of general purpose Icinga
+ * configuration templates.
+ */
+
+#include "itl-host.conf"
+#include "itl-service.conf"
+#include "itl-service-common.conf"