<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Custom-Macros on BAFM</title><link>https://christian.blog.pakiheim.de/tags/custom-macros/</link><description>Recent content in Custom-Macros on BAFM</description><generator>Hugo -- 0.160.1</generator><language>en</language><lastBuildDate>Sat, 16 Aug 2008 19:10:37 +0000</lastBuildDate><atom:link href="https://christian.blog.pakiheim.de/tags/custom-macros/index.xml" rel="self" type="application/rss+xml"/><item><title>Custom macros in host definitions</title><link>https://christian.blog.pakiheim.de/posts/2008-08-16_custom-macros-in-host-definitions/</link><pubDate>Sat, 16 Aug 2008 19:10:37 +0000</pubDate><guid isPermaLink="false">http://blog.barfoo.org/?p=920</guid><description>&lt;p&gt;Well, I was &lt;a href="https://christian.blog.pakiheim.de/posts/2008-07-19_nagios-hostgroup-inheritance-continued" title="Nagios Hostgroup Inheritance"&gt;playing with the hostgroup inheritance&lt;/a&gt; earlier. One problem with that is, if you define a duplicate service Nagios is really unpredictable or rather inconsistent. Now, as Thomas Guyot-Sionnest told me, I should try &lt;a href="http://nagios.sourceforge.net/docs/3_0/macros.html"&gt;custom macros&lt;/a&gt; for the check definition. So what I did was the following:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;templates/host-windows.cfg&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt" id="hl-0-1"&gt;&lt;a class="lnlinks" href="#hl-0-1"&gt;1&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-2"&gt;&lt;a class="lnlinks" href="#hl-0-2"&gt;2&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-3"&gt;&lt;a class="lnlinks" href="#hl-0-3"&gt;3&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-4"&gt;&lt;a class="lnlinks" href="#hl-0-4"&gt;4&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-5"&gt;&lt;a class="lnlinks" href="#hl-0-5"&gt;5&lt;/a&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;define host {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; name         generic-windows
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; register 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; _RDPPORT 3389
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;strong&gt;hostgroups/windows.cfg&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>