2011-07-29 22:35:29 +02:00
|
|
|
# macros.nagios file
|
|
|
|
# macros for Nagios and Icinga (sub-)package building - handle with care
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# directories
|
|
|
|
#
|
|
|
|
|
|
|
|
# install all plugins into this directory
|
|
|
|
%nagios_plugindir %{_prefix}/lib/nagios/plugins
|
|
|
|
# install all event handler scripts into this directory
|
|
|
|
%nagios_eventhandlerdir %{_prefix}/lib/nagios/plugins/eventhandler
|
2011-11-01 13:57:06 +01:00
|
|
|
# files like p1.pl are located directly in this directory
|
|
|
|
%nagios_libdir %{_prefix}/lib/nagios
|
2011-07-29 22:35:29 +02:00
|
|
|
# Nagios uses this directory for status files
|
|
|
|
%nagios_localstatedir %{_var}/lib/nagios
|
|
|
|
# Nagios configuration should be stored here
|
|
|
|
%nagios_sysconfdir %{_sysconfdir}/nagios
|
|
|
|
# Nagios static webpages, stylesheets and theme(s), online documentation
|
|
|
|
%nagios_datadir %{_datadir}/nagios
|
2011-11-01 13:46:52 +01:00
|
|
|
# Nagios spool dir (checkresult-dir)
|
2011-07-30 21:47:12 +02:00
|
|
|
%nagios_spooldir %{_var}/spool/nagios
|
2011-08-22 12:22:22 +02:00
|
|
|
# Nagios logfile dir
|
|
|
|
%nagios_logdir %{_var}/log/nagios
|
2011-08-22 12:58:46 +02:00
|
|
|
# Nagios cgi directory
|
|
|
|
%nagios_cgidir %{_prefix}/lib/nagios/cgi
|
2011-07-29 22:35:29 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# files
|
|
|
|
#
|
|
|
|
|
|
|
|
# This is the file that Nagios checks for external command requests
|
|
|
|
%nagios_command_file %{_var}/spool/nagios/nagios.cmd
|
|
|
|
# This is where the current status of all monitored services and
|
|
|
|
# hosts is stored.
|
|
|
|
%nagios_status_file %{_var}/lib/nagios/status.dat
|
|
|
|
# This is the file that Nagios should use to store host and
|
|
|
|
# service state information before it shuts down.
|
|
|
|
%nagios_state_retention_file %{_var}/lib/nagios/retention.dat
|
|
|
|
|
|
|
|
#
|
|
|
|
# users and groups
|
|
|
|
#
|
|
|
|
|
|
|
|
# User, Nagios runs under
|
|
|
|
%nagios_user nagios
|
|
|
|
# Group, Nagios runs under
|
|
|
|
%nagios_group nagios
|
|
|
|
# User, that can execute commands via %{nagios_command_file}
|
2011-07-30 21:40:43 +02:00
|
|
|
%nagios_command_user wwwrun
|
2011-07-29 22:35:29 +02:00
|
|
|
# Group, that can execute commands via %{nagios_command_file}
|
2011-08-22 12:46:49 +02:00
|
|
|
%nagios_command_group nagcmd
|
2011-07-29 22:35:29 +02:00
|
|
|
|
2013-01-01 15:57:33 +01:00
|
|
|
# Add Nagios user and groups
|
|
|
|
%nagios_user_group_add() \
|
|
|
|
/usr/sbin/groupadd -r %{nagios_group} 2>/dev/null || :\
|
|
|
|
/usr/sbin/useradd -r -g %{nagios_group} -d %{nagios_localstatedir} -s /bin/false -c "User for Nagios" %{nagios_user} 2>/dev/null || :\
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
%nagios_command_user_group_add() \
|
|
|
|
/usr/sbin/groupadd -r %{nagios_command_group} 2>/dev/null || :\
|
|
|
|
%if 0%{?suse_version} > 01220 \
|
|
|
|
/usr/sbin/usermod -a -G %{nagios_command_group} %{nagios_user} || :\
|
|
|
|
%else \
|
|
|
|
/usr/sbin/groupmod -A %{nagios_user} %{nagios_command_group} 2>/dev/null || :\
|
|
|
|
%endif \
|
|
|
|
%{nil}
|
2011-07-29 22:35:29 +02:00
|
|
|
|