Gitweb:        
http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=1748edccdfe67c5cbc93345551c8cdaba6bc791f
Commit:        1748edccdfe67c5cbc93345551c8cdaba6bc791f
Parent:        542f16d63466d8ba52e84db25220aa84d42c5df0
Author:        Tim Stoop <[email protected]>
AuthorDate:    Fri Feb 19 11:30:30 2010 -0800
Committer:     David Lutterkort <[email protected]>
CommitterDate: Fri Feb 19 11:30:30 2010 -0800

Nagisocfg: lens and test for /etc/nagios3/nagios.cfg

---
 AUTHORS                         |    1 +
 lenses/nagioscfg.aug            |    8 ++++
 lenses/tests/test_nagioscfg.aug |   76 +++++++++++++++++++++++++++++++++++++++
 tests/Makefile.am               |    1 +
 4 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 85f4a62..05e295e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -25,6 +25,7 @@ Contributions by:
   Robin Lee Powell            <[email protected]>
   Satoru SATOH                <[email protected]>
   Nahum Shalman               <nshalman elys com>
+  Tim Stoop                   <[email protected]>
   Laine Stump                 <[email protected]>
   Ivana Hutarova Varekova     <[email protected]>
   Dean Wilson                 <[email protected]>
diff --git a/lenses/nagioscfg.aug b/lenses/nagioscfg.aug
new file mode 100644
index 0000000..2f643a3
--- /dev/null
+++ b/lenses/nagioscfg.aug
@@ -0,0 +1,8 @@
+module NagiosCfg =
+  autoload xfm
+
+  let filter = incl "/etc/nagios3/nagios.cfg"
+
+  let lns = Sysctl.lns
+
+  let xfm = transform lns filter
diff --git a/lenses/tests/test_nagioscfg.aug b/lenses/tests/test_nagioscfg.aug
new file mode 100644
index 0000000..7faae55
--- /dev/null
+++ b/lenses/tests/test_nagioscfg.aug
@@ -0,0 +1,76 @@
+module Test_NagiosCfg =
+
+       let s1 = "log_file=/var/log/nagios3/nagios.log\n"
+       test NagiosCfg.lns get s1 =
+               { "log_file" = "/var/log/nagios3/nagios.log" }
+
+       let s2 = "debug_level=0
+
+
+
+# DEBUG VERBOSITY
+# This option determines how verbose the debug log out will be.
+# Values: 0 = Brief output
+#         1 = More detailed
+#         2 = Very detailed
+
+debug_verbosity=1
+
+
+
+# DEBUG FILE
+# This option determines where Nagios should write debugging information.
+
+debug_file=/var/lib/nagios3/nagios.debug
+
+
+
+# MAX DEBUG FILE SIZE
+# This option determines the maximum size (in bytes) of the debug file.  If
+# the file grows larger than this size, it will be renamed with a .old
+# extension.  If a file already exists with a .old extension it will
+# automatically be deleted.  This helps ensure your disk space usage doesn't
+# get out of control when debugging Nagios.
+
+max_debug_file_size=1000000
+
+
+cfg_dir=/etc/nagios3/dcsit_production
+cfg_dir=/etc/nagios3/dcdb_test
+cfg_dir=/etc/nagios3/dcdb_production
+"
+       test NagiosCfg.lns get s2 =
+  { "debug_level" = "0" }
+  {  }
+  {  }
+  {  }
+  { "#comment" = "DEBUG VERBOSITY" }
+  { "#comment" = "This option determines how verbose the debug log out will 
be." }
+  { "#comment" = "Values: 0 = Brief output" }
+  { "#comment" = "1 = More detailed" }
+  { "#comment" = "2 = Very detailed" }
+  {  }
+  { "debug_verbosity" = "1" }
+  {  }
+  {  }
+  {  }
+  { "#comment" = "DEBUG FILE" }
+  { "#comment" = "This option determines where Nagios should write debugging 
information." }
+  {  }
+  { "debug_file" = "/var/lib/nagios3/nagios.debug" }
+  {  }
+  {  }
+  {  }
+  { "#comment" = "MAX DEBUG FILE SIZE" }
+  { "#comment" = "This option determines the maximum size (in bytes) of the 
debug file.  If" }
+  { "#comment" = "the file grows larger than this size, it will be renamed 
with a .old" }
+  { "#comment" = "extension.  If a file already exists with a .old extension 
it will" }
+  { "#comment" = "automatically be deleted.  This helps ensure your disk space 
usage doesn't" }
+  { "#comment" = "get out of control when debugging Nagios." }
+  {  }
+  { "max_debug_file_size" = "1000000" }
+  {  }
+  {  }
+  { "cfg_dir" = "/etc/nagios3/dcsit_production" }
+  { "cfg_dir" = "/etc/nagios3/dcdb_test" }
+  { "cfg_dir" = "/etc/nagios3/dcdb_production" }
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2ed23e4..cb40a48 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -45,6 +45,7 @@ lens_tests =                  \
   lens-modprobe.sh             \
   lens-monit.sh                        \
   lens-multipath.sh     \
+  lens-nagioscfg.sh     \
   lens-ntp.sh                  \
   lens-openvpn.sh              \
   lens-pam.sh                  \

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to