diff options
author | James Meyer <james.meyer@operamail.com> | 2011-12-07 19:45:02 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2011-12-07 19:45:02 (GMT) |
commit | 582455878ef98dfadc0618309686c85b135f7a23 (patch) | |
tree | a87b677b96c168524576cf32870487758d0b43ba /abs/core/xymon/xymon.install | |
parent | 65b2738ba8a6b80a17c5a2953a29be935b15d18c (diff) | |
download | linhes_pkgbuild-582455878ef98dfadc0618309686c85b135f7a23.zip linhes_pkgbuild-582455878ef98dfadc0618309686c85b135f7a23.tar.gz linhes_pkgbuild-582455878ef98dfadc0618309686c85b135f7a23.tar.bz2 |
xymon: first build, includes both server and client builds.
xymon is a system used to monitor various things about each host.
Possible to replace rrdtool and monitorx
Diffstat (limited to 'abs/core/xymon/xymon.install')
-rw-r--r-- | abs/core/xymon/xymon.install | 68 |
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 |