help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strange BeginGroupIfNoLineMatching/InsertFile behaviour


From: John van Zantvoort
Subject: strange BeginGroupIfNoLineMatching/InsertFile behaviour
Date: Tue, 28 Feb 2006 16:31:18 +0100

Hi guys,

I've got a configfile that has some dynamic parameters which I edit through cfengine, the file involves
monitorring parameters that can differ per system, patch level, management dispostion, etc.:
  e.g. not all directories are mounted on the same disk and not all directories are mountpoints.
Our approach is to keep the parameters as generic as possible and changing the input on the
system side.

My question:

Why does this work:
    { /etc/nagios/nrpe.cfg
      AutoCreate

      BeginGroupIfNoLineMatching "##### BEGIN $(EditHeader) $(CVSRev) ####"
        Append "##### BEGIN $(EditHeader) $(CVSRev) ####"
        ForEachLineIn '/path/to/diskmonitoring/parameters/created/by/a/module'
          AppendIfNoLineMatching "ThisLine"
        EndLoop

        Append "# HTTPD"
        Append "command[check_proc_httpd_root]=/usr/lib/nagios/plugins/check_procs -C httpd -u root -w 1:1 -c 1:1"
        Append "command[check_proc_httpd_child]=/usr/lib/nagios/plugins/check_procs -C httpd -u apache -w 8:50 -c 5:150"
        # ... more "neat" parameters ....

        Append "##### END $(EditHeader) $(CVSRev)"
      EndGroup
    }

And this doesn't:
    { /etc/nagios/nrpe.cfg
      AutoCreate

      BeginGroupIfNoLineMatching "##### BEGIN $(EditHeader) $(CVSRev) ####"
        Append "##### BEGIN $(EditHeader) $(CVSRev) ####"
        InserFile '/path/to/diskmonitoring/parameters/created/by/a/module'

        Append "# HTTPD"
        Append "command[check_proc_httpd_root]=/usr/lib/nagios/plugins/check_procs -C httpd -u root -w 1:1 -c 1:1"
        Append "command[check_proc_httpd_child]=/usr/lib/nagios/plugins/check_procs -C httpd -u apache -w 8:50 -c 5:150"
        # ... more "neat" parameters ....

        Append "##### END $(EditHeader) $(CVSRev)"
      EndGroup
    }

--
Met vriendelijke groeten/with kind regards

        John van Zantvoort

---

Paranoia is simply an optimistic outlook on life.

GCM d- s+:+ a- C+ UL+++ P+++ L++ E--- W++ N+ o K-
w-- O- M- V- PS+ PE- Y+ PGP+ t+ 5 X- R- tv b+ DI++
D+ G e h- r++ y+

reply via email to

[Prev in Thread] Current Thread [Next in Thread]