summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon/xymon.install
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/xymon/xymon.install')
-rw-r--r--abs/core/xymon/xymon.install68
1 files changed, 68 insertions, 0 deletions
diff --git a/abs/core/xymon/xymon.install b/abs/core/xymon/xymon.install
new file mode 100644
index 0000000..08fbd8c
--- /dev/null
+++ b/abs/core/xymon/xymon.install
@@ -0,0 +1,68 @@
+post_install() {
+ . /etc/systemconfig
+ if [ ! -f /data/srv/xymon/server/ext/ignoreclient.py ]
+ then
+ echo "#this is a list of hosts to ignore" > /data/srv/xymon/server/ext/ignoreclient.py
+ echo ignorehosts=\"\'ignoreme1\',\'ignoreme2\'\" >> /data/srv/xymon/server/ext/ignoreclient.py
+ fi
+
+ if [ ! -f /data/srv/httpd/htdocs/failed_func_hosts ]
+ then
+ touch /data/srv/httpd/htdocs/failed_func_hosts
+ fi
+ chown nobody:nobody /data/srv/httpd/htdocs/failed_func_hosts
+ chmod 777 /data/srv/httpd/htdocs/failed_func_hosts
+
+
+ sed -i -e "s/localhost/$hostname/" /data/srv/xymon/server/etc/hosts.cfg
+ sed -i -e "s/\#/\# func/" /data/srv/xymon/server/etc/hosts.cfg
+ sed -i -e "s/localhost/$hostname/" /data/srv/xymon/server/etc/xymonserver.cfg
+ chown -R nobody /data/srv/xymon
+ chown -R nobody /data/srv/httpd/htdocs/xymon
+ chown -R nobody /var/log/hobbit
+ chown root /data/srv/xymon/server/bin/xymonping
+ chmod +s /data/srv/xymon/server/bin/xymonping
+ echo "Adding sudo permissions for nobody {certmaster-ca}"
+ echo "Adding sudo permissions for http {backup_job}"
+ LINE="nobody ALL = NOPASSWD:/usr/bin/certmaster-ca"
+ LINE1="http ALL = NOPASSWD:/usr/MythVantage/bin/backup_job"
+
+ for i in "$LINE" "$LINE1"
+ do
+ cp /etc/sudoers /etc/sudoers.bak
+ grep -q "$i" /etc/sudoers
+ if [ $? != 0 ]
+ then
+ echo "$i" >> /etc/sudoers
+ visudo -cf /etc/sudoers
+ if [ ! $? = 0 ]
+ then
+ cp /etc/sudoers.bak /etc/sudoers
+ echo $i
+ echo "Error adding files"
+ exit 1
+ fi
+ fi
+ done
+
+
+
+
+
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ rm -f /data/srv/httpd/htdocs/xymon/index.html
+}
+
+pre_remove() {
+ /bin/true
+}
+op=$1
+shift
+$op $*
+# vim: ft=sh ts=2