1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>7.25. Modifizierte Attribute</title>
<link rel="stylesheet" href="../stylesheets/icinga-docs.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<meta name="keywords" content="Supervision, Icinga, Nagios, Linux">
<link rel="home" href="index.html" title="Icinga Version 1.14 Dokumentation">
<link rel="up" href="ch07.html" title="Kapitel 7. Fortgeschrittene Themen">
<link rel="prev" href="cgiincludes.html" title="7.24. Angepasste Classic UI-Modul-Kopf- und Fußzeilen">
<link rel="next" href="objectinheritance.html" title="7.26. Objektvererbung">
<script src="../js/jquery-min.js" type="text/javascript"></script><script src="../js/icinga-docs.js" type="text/javascript"></script>
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<CENTER><IMG src="../images/logofullsize.png" border="0" alt="Icinga" title="Icinga"></CENTER>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">7.25. Modifizierte Attribute</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="cgiincludes.html">Zurück</a> </td>
<th width="60%" align="center">Kapitel 7. Fortgeschrittene Themen</th>
<td width="20%" align="right"> <a accesskey="n" href="objectinheritance.html">Weiter</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="section" title="7.25. Modifizierte Attribute">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="modified_attr"></a>7.25. <a name="modified-attr"></a>Modifizierte Attribute</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section">7.25.1. <a href="modified_attr.html#introduction">Einführung</a></span></dt>
<dt><span class="section">7.25.2. <a href="modified_attr.html#example">Beispiel</a></span></dt>
</dl></div>
<div class="section" title="7.25.1. Einführung">
<div class="titlepage"><div><div><h3 class="title">
<a name="introduction"></a>7.25.1. Einführung</h3></div></div></div>
<p>Verschiedene Attribute von Host, Services und Kontakte können während der Laufzeit verändert werden, z.B. beim Deaktivieren von
Benachrichtigungen über das Web-Interface, wodurch der lokale Standardwert überschrieben wird. Der Core wird <span class="bold"><strong>immer</strong></span> zuerst das modifizierte Attribut benutzen.</p>
<p>Wenn "<a class="link" href="configmain.html#configmain-retain_state_information">retain_state_information</a>" aktiviert ist (das ist der Standard),
dann werden diese Änderungen über Neustarts hinweg beibehalten. Falls Sie diese Einstellung deaktivieren, dann gelten die geänderten
Werte nur bis zum nächsten Neustart.</p>
<p>Neben der automatischen Änderung durch verschiedene Befehle der klassischen Oberfläche können Sie diese Werte auch mit Hilfe von
<a class="link" href="extcommands.html" title="7.1. Externe Befehle">externen Befehlen</a> anpassen.</p>
<p><span class="bold"><strong>Liste der externen Befehle zum ändern von Attributen</strong></span> (zu Details siehe <a class="link" href="extcommands2.html" title="7.2. Liste der externen Befehle">Liste der externen Befehle</a>)</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<p>Host-Attribute ändern: <code class="code">CHANGE_HOST_MODATTR;</code><host_name>;<value></p>
</li>
<li class="listitem">
<p>Service-Attribute ändern: <code class="code">CHANGE_SVC_MODATTR;</code><host_name>;<service_description>;<value></p>
</li>
<li class="listitem">
<p>Kontakt-Attribute ändern: <code class="code">CHANGE_CONTACT_MODATTR;</code><contact_name>;<value></p>
</li>
<li class="listitem">
<p>Kontakt-Attribute ändern: <code class="code">CHANGE_CONTACT_MODHATTR;</code><contact_name>;<value></p>
</li>
<li class="listitem">
<p>Kontakt-Attribute ändern: <code class="code">CHANGE_CONTACT_MODSATTR;</code><contact_name>;<value></p>
</li>
</ul></div>
<p>Der Werte ist ein logisches ODER der verschiedenen Werte aus der Tabelle am Ende dieses Abschnitts. "Logisches ODER" bedeutet,
dass Sie die Werte addieren und die Summe benutzen müssen.</p>
</div>
<div class="section" title="7.25.2. Beispiel">
<div class="titlepage"><div><div><h3 class="title">
<a name="example"></a>7.25.2. Beispiel</h3></div></div></div>
<p>Die folgenden Zeilen zeigen ein allgemeines Beispiel, wie externe Befehle an das Command-File übergeben werden.</p>
<pre class="programlisting"> #!/bin/sh
# Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/icinga/var/rw/icinga.cmd'
/bin/printf "[%lu] CHANGE_HOST_MODATTR;Host1;11\n" $now > $commandfile</pre>
<p>Das o.g. Kommando wird verschiedene Attribute von "Host1" ändern:</p>
<pre class="screen">enable notifications 1
enable active checks 2
enable the eventhandler 8
--
11</pre>
<p><a name="modified_attr-table"></a><span class="bold"><strong>Auszug aus include/common.h</strong></span></p>
<pre class="screen">/************************MODIFIED ATTRIBUTES *************************/
#define MODATTR_NONE 0
#define MODATTR_NOTIFICATIONS_ENABLED 1
#define MODATTR_ACTIVE_CHECKS_ENABLED 2
#define MODATTR_PASSIVE_CHECKS_ENABLED 4
#define MODATTR_EVENT_HANDLER_ENABLED 8
#define MODATTR_FLAP_DETECTION_ENABLED 16
#define MODATTR_FAILURE_PREDICTION_ENABLED 32
#define MODATTR_PERFORMANCE_DATA_ENABLED 64
#define MODATTR_OBSESSIVE_HANDLER_ENABLED 128
#define MODATTR_EVENT_HANDLER_COMMAND 256
#define MODATTR_CHECK_COMMAND 512
#define MODATTR_NORMAL_CHECK_INTERVAL 1024
#define MODATTR_RETRY_CHECK_INTERVAL 2048
#define MODATTR_MAX_CHECK_ATTEMPTS 4096
#define MODATTR_FRESHNESS_CHECKS_ENABLED 8192
#define MODATTR_CHECK_TIMEPERIOD 16384
#define MODATTR_CUSTOM_VARIABLE 32768
#define MODATTR_NOTIFICATION_TIMEPERIOD 65536</pre>
<a class="indexterm" name="idm139734664863504"></a>
<a class="indexterm" name="idm139734664862112"></a>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="cgiincludes.html">Zurück</a> </td>
<td width="20%" align="center"><a accesskey="u" href="ch07.html">Nach oben</a></td>
<td width="40%" align="right"> <a accesskey="n" href="objectinheritance.html">Weiter</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">7.24. Angepasste Classic UI-Modul-Kopf- und Fußzeilen </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Zum Anfang</a></td>
<td width="40%" align="right" valign="top"> 7.26. Objektvererbung</td>
</tr>
</table>
</div>
<P class="copyright">© 1999-2009 Ethan Galstad, 2009-2017 Icinga Development Team, https://www.icinga.com</P>
</body>
</html>
|