FreeBSD Bugzilla – Attachment 100550 Details for
Bug 139848
add pre-caching to net-mgmt/nagios rc.d script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.97 KB, created by
kimor79
on 2009-10-22 21:50:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
kimor79
Created:
2009-10-22 21:50:01 UTC
Size:
1.97 KB
patch
obsolete
>--- /tmp/nagios.in.orig 2009-10-22 13:33:01.000000000 -0700 >+++ /tmp/nagios.in 2009-10-22 13:35:46.000000000 -0700 >@@ -12,6 +12,8 @@ > # Add the following lines to /etc/rc.conf to enable nagios: > # nagios_enable (bool): Set to "NO" by default. > # Set it to "YES" to enable nagios. >+# nagios_precache (bool): Set to "NO" by default. >+# Set it to "YES" to enable pre-caching. > # nagios_flags (str): Set to "" by default. > # nagios_configfile (str): Set to "%%PREFIX%%/etc/nagios/nagios.cfg" by default. > # >@@ -30,17 +32,35 @@ > start_precmd="start_precmd" > stop_postcmd="stop_postcmd" > restart_precmd="nagios_checkconfig" >-reload_precmd="nagios_checkconfig" >+reload_precmd="reload_precmd" > sig_reload=HUP > > [ -z "${nagios_enable}" ] && nagios_enable="NO" > [ -z "${nagios_configfile}" ] && nagios_configfile="%%PREFIX%%/etc/nagios/nagios.cfg" >+[ -z "${nagios_precache}" ] && nagios_precache="NO" > > load_rc_config "${name}" > > required_files="${nagios_configfile}" > command_args="${command_args} ${nagios_configfile}" > >+nagios_cacheconfig() { >+ if ! checkyesno nagios_precache; then >+ return 0 >+ fi >+ >+ echo -n "Pre-Caching nagios configuration: " >+ ${command} -pv ${nagios_configfile} 2>&1 >/dev/null >+ if [ $? != 0 ]; then >+ echo "FAILED" >+ ${command} -v ${nagios_configfile} >+ return 1 >+ else >+ command_args="-u -x ${command_args}" >+ echo "OK" >+ fi >+} >+ > nagios_checkconfig() { > echo -n "Performing sanity check of nagios configuration: " > ${command} -v ${nagios_configfile} 2>&1 >/dev/null >@@ -53,11 +73,25 @@ > fi > } > >+reload_precmd() { >+ if ! nagios_checkconfig; then >+ return 1 >+ fi >+ >+ if ! nagios_cacheconfig; then >+ return 1 >+ fi >+} >+ > start_precmd() { > if ! nagios_checkconfig; then > return 1 > fi > >+ if ! nagios_cacheconfig; then >+ return 1 >+ fi >+ > su -m "${nagios_user}" -c "touch \"%%NAGIOSDIR%%/nagios.log\" \"%%NAGIOSDIR%%/status.sav\"" > rm -f "%%NAGIOSDIR%%/rw/nagios.cmd" > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 139848
: 100550