summarylogtreecommitdiffstats
path: root/nagios.install
diff options
context:
space:
mode:
authorIdares2015-08-05 17:56:11 +0200
committerIdares2015-08-05 17:56:11 +0200
commitce43a446091ed39485387193f2648a7d0dd10896 (patch)
tree42bebe300acb391b87135c8b0679a3a5632c8b2f /nagios.install
downloadaur-ce43a446091ed39485387193f2648a7d0dd10896.tar.gz
Initial import
Diffstat (limited to 'nagios.install')
-rw-r--r--nagios.install41
1 files changed, 41 insertions, 0 deletions
diff --git a/nagios.install b/nagios.install
new file mode 100644
index 000000000000..36f038c0dd1f
--- /dev/null
+++ b/nagios.install
@@ -0,0 +1,41 @@
+# arg 1: the new package version
+
+post_install() {
+ cat <<EOM
+
+--> Sample config files are installed with .sample extension.
+--> Remember, these are *SAMPLE* config files. You'll need to read
+--> the documentation for more information on how to actually define
+--> services, hosts, etc. to fit your particular needs.
+
+EOM
+
+ getent group nagios > /dev/null || groupadd -g 30 nagios > /dev/null
+ getent passwd nagios > /dev/null || useradd -u 30 -g nagios -d /dev/null -s /bin/false nagios > /dev/null
+}
+
+pre_upgrade() {
+
+ _httpdconf="/etc/httpd/conf/extra/nagios.conf"
+ if [ -f $_httpdconf ]; then
+ cp $_httpdconf $_httpdconf.pacsave
+ fi
+
+}
+
+post_upgrade() {
+
+ post_install
+
+ find /var/nagios -user nobody -exec chown nagios.nagios {} \;
+ if [ -f /var/log/nagios.log ]; then
+ chown nagios /var/log/nagios.log
+ fi
+
+ _httpdconf="/etc/httpd/conf/extra/nagios.conf"
+ if [ ! -f $_httpdconf -a -f $_httpdconf.pacsave ]; then
+ cp $_httpdconf.pacsave $_httpdconf
+ fi
+
+}
+