Patch: Config files in nagios.spec

Matt Ezell ezell at nics.utk.edu
Thu Jan 8 03:44:56 CET 2009


The spec file does not install the sample configuration files to
/etc/nagios/objects.  The default /etc/nagios/nagios.cfg references these
non-existent files.

Patch below adds the files to the rpm.

~Matt


> diff -U3 nagios.spec.orig nagios.spec
--- nagios.spec.orig    2009-01-06 20:51:06.000000000 -0500
+++ nagios.spec    2009-01-06 20:50:35.000000000 -0500
@@ -243,6 +243,7 @@
 install -d -m 0755 ${RPM_BUILD_ROOT}/etc/logrotate.d
 install -d -m 0755 ${RPM_BUILD_ROOT}/etc/httpd/conf.d
 install -d -m 0755 ${RPM_BUILD_ROOT}/etc/nagios
+install -d -m 0755 ${RPM_BUILD_ROOT}/etc/nagios/objects
 ### install -d -m 0755 ${RPM_BUILD_ROOT}/etc/nagios/private
 make DESTDIR=${RPM_BUILD_ROOT} INSTALL_OPTS="" COMMAND_OPTS="" install
 make DESTDIR=${RPM_BUILD_ROOT} INSTALL_OPTS="" COMMAND_OPTS="" INIT_OPTS=""
install-daemoninit
@@ -257,9 +258,9 @@
   [ -f $f ] && install -c -m 664 $f ${RPM_BUILD_ROOT}/etc/nagios/${f}
 done
 cd template-object
-for f in
{hosts,hostgroups,services,contacts,contactgroups,dependencies,escalations,timeperiods,checkcommands,misccommands,minimal}.cfg
+for f in {commands,contacts,localhost,switch,templates,timeperiods}.cfg
 do
-  [ -f $f ] && install -c -m 664 $f ${RPM_BUILD_ROOT}/etc/nagios/${f}
+  [ -f $f ] && install -c -m 664 $f
${RPM_BUILD_ROOT}/etc/nagios/objects/${f}
 done
 cd ..
 cd ..
@@ -304,8 +305,10 @@
 %{_prefix}/lib/nagios/eventhandlers/*
 %{_sbindir}/convertcfg
 %dir /etc/nagios
+%dir /etc/nagios/objects
 %defattr(644,root,root)
 %config(noreplace) /etc/nagios/*.cfg
+%config(noreplace) /etc/nagios/objects/*.cfg
 %defattr(750,root,%{nsgrp})
 ###%dir /etc/nagios/private
 %defattr(640,root,%{nsgrp})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090107/191d01ec/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list