Группа :: Мониторинг
Пакет: xymon
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: xymon.rundir.patch
Скачать
Скачать
diff -Nur xymon-4.3.29.bak/client/clientlaunch.cfg.DIST xymon-4.3.29/client/clientlaunch.cfg.DIST
--- xymon-4.3.29.bak/client/clientlaunch.cfg.DIST 2019-09-11 17:42:00.000000000 +0400
+++ xymon-4.3.29/client/clientlaunch.cfg.DIST 2019-09-11 17:53:19.962344409 +0400
@@ -16,7 +16,7 @@
[msgcache]
DISABLED
ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg
- CMD $XYMONCLIENTHOME/bin/msgcache --no-daemon --pidfile=$XYMONCLIENTLOGS/msgcache.pid
+ CMD $XYMONCLIENTHOME/bin/msgcache --no-daemon --pidfile=$XYMONRUNDIR/msgcache.pid
LOGFILE $XYMONCLIENTLOGS/msgcache.log
# The main client task
diff -Nur xymon-4.3.29.bak/configure.server xymon-4.3.29/configure.server
--- xymon-4.3.29.bak/configure.server 2019-09-11 17:42:01.909621671 +0400
+++ xymon-4.3.29/configure.server 2019-09-11 17:53:19.962344409 +0400
@@ -365,6 +365,17 @@
fi
echo ""; echo ""
+echo "Where to put the Xymon runfiles [$XYMONLOGDIR] ? "
+if test -z "$XYMONRUNDIR"
+then
+ read XYMONRUNDIR
+fi
+if test -z "$XYMONRUNDIR"
+then
+ XYMONRUNDIR="$XYMONLOGDIR"
+fi
+echo ""; echo ""
+
echo "What is the name of this host [`uname -n`] ? "
if test -z "$XYMONHOSTNAME"
then
@@ -420,6 +431,8 @@
echo "SECURECGIDIR = $SECURECGIDIR" >>Makefile
echo "# Where to put logfiles" >>Makefile
echo "XYMONLOGDIR = $XYMONLOGDIR" >>Makefile
+echo "# Where to put runfiles" >>Makefile
+echo "XYMONRUNDIR = $XYMONRUNDIR" >>Makefile
echo "# Where to install manpages" >>Makefile
echo "MANROOT = $MANROOT" >>Makefile
echo "# How to run fping or xymonping" >>Makefile
diff -Nur xymon-4.3.29.bak/web/showgraph.c xymon-4.3.29/web/showgraph.c
--- xymon-4.3.29.bak/web/showgraph.c 2019-09-11 17:42:00.000000000 +0400
+++ xymon-4.3.29/web/showgraph.c 2019-09-11 17:53:19.962344409 +0400
@@ -136,9 +136,9 @@
}
fcntl(ctlsocket, F_SETFL, O_NONBLOCK);
- dir = opendir(xgetenv("XYMONTMP"));
+ dir = opendir(xgetenv("XYMONRUNDIR"));
if (!dir) {
- errprintf("Cannot access $XYMONTMP directory: %s\n", strerror(errno));
+ errprintf("Cannot access $XYMONRUNDIR directory: %s\n", strerror(errno));
return;
}
@@ -155,10 +155,10 @@
memset(&myaddr, 0, sizeof(myaddr));
myaddr.sun_family = AF_UNIX;
- SBUF_MALLOC(fnam, strlen(xgetenv("XYMONTMP"))+ strlen(d->d_name) + 2);
- snprintf(fnam, fnam_buflen, "%s/%s", xgetenv("XYMONTMP"), d->d_name);
+ SBUF_MALLOC(fnam, strlen(xgetenv("XYMONRUNDIR"))+ strlen(d->d_name) + 2);
+ snprintf(fnam, fnam_buflen, "%s/%s", xgetenv("XYMONRUNDIR"), d->d_name);
if (strlen(fnam) > sizeof(myaddr.sun_path)) {
- errprintf("rrdctl files located in XYMONTMP with too long pathname - max %d characters\n", sizeof(myaddr.sun_path));
+ errprintf("rrdctl files located in XYMONRUNDIR with too long pathname - max %d characters\n", sizeof(myaddr.sun_path));
return;
}
strncpy(myaddr.sun_path, fnam, sizeof(myaddr.sun_path));
diff -Nur xymon-4.3.29.bak/xymond/etcfiles/tasks.cfg.DIST xymon-4.3.29/xymond/etcfiles/tasks.cfg.DIST
--- xymon-4.3.29.bak/xymond/etcfiles/tasks.cfg.DIST 2019-09-11 17:42:01.953622303 +0400
+++ xymon-4.3.29/xymond/etcfiles/tasks.cfg.DIST 2019-09-11 17:53:19.962344409 +0400
@@ -18,8 +18,8 @@
# you want to run).
[xymond]
ENVFILE @XYMONHOME@/etc/xymonserver.cfg
- CMD xymond --pidfile=$XYMONSERVERLOGS/xymond.pid \
- --restart=$XYMONTMP/xymond.chk --checkpoint-file=$XYMONTMP/xymond.chk --checkpoint-interval=600 \
+ CMD xymond --pidfile=$XYMONRUNDIR/xymond.pid \
+ --restart=$XYMONRUNDIR/xymond.chk --checkpoint-file=$XYMONRUNDIR/xymond.chk --checkpoint-interval=600 \
--log=$XYMONSERVERLOGS/xymond.log \
--admin-senders=127.0.0.1,$XYMONSERVERIP \
--store-clientlogs=!msgs
@@ -28,7 +28,7 @@
[history]
ENVFILE @XYMONHOME@/etc/xymonserver.cfg
NEEDS xymond
- CMD xymond_channel --channel=stachg --log=$XYMONSERVERLOGS/history.log xymond_history --pidfile=$XYMONSERVERLOGS/xymond_history.pid
+ CMD xymond_channel --channel=stachg --log=$XYMONSERVERLOGS/history.log xymond_history --pidfile=$XYMONRUNDIR/xymond_history.pid
# "alert" sends out alerts.
[alert]
@@ -100,7 +100,7 @@
[xymonproxy]
DISABLED
ENVFILE @XYMONHOME@/etc/xymonserver.cfg
- CMD $XYMONHOME/bin/xymonproxy --server=YOUR.XYMON.SERVER.IP --report=$MACHINE.xymonproxy --no-daemon --pidfile=$XYMONSERVERLOGS/xymonproxy.pid
+ CMD $XYMONHOME/bin/xymonproxy --server=YOUR.XYMON.SERVER.IP --report=$MACHINE.xymonproxy --no-daemon --pidfile=$XYMONRUNDIR/xymonproxy.pid
LOGFILE $XYMONSERVERLOGS/xymonproxy.log
@@ -115,7 +115,7 @@
[xymonfetch]
DISABLED
ENVFILE @XYMONHOME@/etc/xymonserver.cfg
- CMD $XYMONHOME/bin/xymonfetch --server=YOUR.XYMON.SERVER.IP --no-daemon --pidfile=$XYMONSERVERLOGS/xymonfetch.pid
+ CMD $XYMONHOME/bin/xymonfetch --server=YOUR.XYMON.SERVER.IP --no-daemon --pidfile=$XYMONRUNDIR/xymonfetch.pid
LOGFILE $XYMONSERVERLOGS/xymonfetch.log
diff -Nur xymon-4.3.29.bak/xymond/etcfiles/xymonserver.cfg.DIST xymon-4.3.29/xymond/etcfiles/xymonserver.cfg.DIST
--- xymon-4.3.29.bak/xymond/etcfiles/xymonserver.cfg.DIST 2019-09-11 17:42:01.951622274 +0400
+++ xymon-4.3.29/xymond/etcfiles/xymonserver.cfg.DIST 2019-09-11 17:53:19.963344423 +0400
@@ -2,6 +2,7 @@
#
XYMONSERVERROOT="@XYMONTOPDIR@" # Where Xymon is installed
XYMONSERVERLOGS="@XYMONLOGDIR@" # Directory for server logs. The xymon user must have write-access here.
+XYMONRUNDIR="@XYMONRUNDIR@" # Directory for server pid files and runtime data. The xymon user must also have write-access here.
XYMONCLIENTHOME="@XYMONTOPDIR@/client" # XYMONHOME directory for the client
diff -Nur xymon-4.3.29.bak/xymond/Makefile xymon-4.3.29/xymond/Makefile
--- xymon-4.3.29.bak/xymond/Makefile 2019-09-11 17:42:01.927621930 +0400
+++ xymon-4.3.29/xymond/Makefile 2019-09-11 18:01:12.846085141 +0400
@@ -146,7 +146,7 @@
cfgfiles:
cat $(APACHECONF) | sed -e 's!@XYMONHOME@!$(XYMONHOME)!g' | sed -e 's!@INSTALLETCDIR@!$(INSTALLETCDIR)!g' | sed -e 's!@INSTALLWWWDIR@!$(INSTALLWWWDIR)!g' | sed -e 's!@INSTALLSTATICWWWDIR@!$(INSTALLSTATICWWWDIR)!g' | sed -e 's!@XYMONVAR@!$(XYMONVAR)!g' | sed -e 's!@CGIDIR@!$(CGIDIR)!g' | sed -e 's!@SECURECGIDIR@!$(SECURECGIDIR)!g' | sed -e 's!@XYMONHOSTURL@!$(XYMONHOSTURL)!g' | sed -e 's!@XYMONCGIURL@!$(XYMONCGIURL)!g' | sed -e 's!@SECUREXYMONCGIURL@!$(SECUREXYMONCGIURL)!g' >etcfiles/xymon-apache.conf
- cat etcfiles/xymonserver.cfg.DIST | sed -e 's!@XYMONTOPDIR@!$(XYMONTOPDIR)!g'| sed -e 's!@XYMONLOGDIR@!$(XYMONLOGDIR)!g'| sed -e 's!@XYMONHOSTNAME@!$(XYMONHOSTNAME)!g'| sed -e 's!@XYMONHOSTIP@!$(XYMONHOSTIP)!g'| sed -e 's!@XYMONHOSTOS@!$(XYMONHOSTOS)!g' | sed -e 's!@XYMONHOSTURL@!$(XYMONHOSTURL)!g' | sed -e 's!@XYMONCGIURL@!$(XYMONCGIURL)!g' | sed -e 's!@SECUREXYMONCGIURL@!$(SECUREXYMONCGIURL)!g' | sed -e 's!@XYMONHOME@!$(XYMONHOME)!g' | sed -e 's!@XYMONVAR@!$(XYMONVAR)!g' | sed -e 's!@FPING@!$(FPING)!g' | sed -e 's!@MAILPROGRAM@!$(MAILPROGRAM)!g' | sed -e 's!@RUNTIMEDEFS@!$(RUNTIMEDEFS)!g' >etcfiles/xymonserver.cfg
+ cat etcfiles/xymonserver.cfg.DIST | sed -e 's!@XYMONTOPDIR@!$(XYMONTOPDIR)!g'| sed -e 's!@XYMONLOGDIR@!$(XYMONLOGDIR)!g'| sed -e 's!@XYMONRUNDIR@!$(XYMONRUNDIR)!g' | sed -e 's!@XYMONHOSTNAME@!$(XYMONHOSTNAME)!g'| sed -e 's!@XYMONHOSTIP@!$(XYMONHOSTIP)!g'| sed -e 's!@XYMONHOSTOS@!$(XYMONHOSTOS)!g' | sed -e 's!@XYMONHOSTURL@!$(XYMONHOSTURL)!g' | sed -e 's!@XYMONCGIURL@!$(XYMONCGIURL)!g' | sed -e 's!@SECUREXYMONCGIURL@!$(SECUREXYMONCGIURL)!g' | sed -e 's!@XYMONHOME@!$(XYMONHOME)!g' | sed -e 's!@XYMONVAR@!$(XYMONVAR)!g' | sed -e 's!@FPING@!$(FPING)!g' | sed -e 's!@MAILPROGRAM@!$(MAILPROGRAM)!g' | sed -e 's!@RUNTIMEDEFS@!$(RUNTIMEDEFS)!g' >etcfiles/xymonserver.cfg
../build/bb-commands.sh >>etcfiles/xymonserver.cfg
cat etcfiles/hosts.cfg.DIST | sed -e 's!@XYMONHOSTNAME@!$(XYMONHOSTNAME)!g' | sed -e 's!@XYMONHOSTIP@!$(XYMONHOSTIP)!g' >etcfiles/hosts.cfg
cat etcfiles/alerts.cfg.DIST | sed -e 's!@XYMONHOSTNAME@!$(XYMONHOSTNAME)!g' | sed -e 's!@XYMONHOSTIP@!$(XYMONHOSTIP)!g' >etcfiles/alerts.cfg
diff -Nur xymon-4.3.29.bak/xymond/trimhistory.c xymon-4.3.29/xymond/trimhistory.c
--- xymon-4.3.29.bak/xymond/trimhistory.c 2019-09-11 17:42:00.000000000 +0400
+++ xymon-4.3.29/xymond/trimhistory.c 2019-09-11 17:53:19.963344423 +0400
@@ -210,7 +210,7 @@
FILE *fd;
long pid = -1;
- sprintf(pidfn, "%s/xymond_history.pid", xgetenv("XYMONSERVERLOGS"));
+ sprintf(pidfn, "%s/xymond_history.pid", xgetenv("XYMONRUNDIR"));
fd = fopen(pidfn, "r");
if (fd) {
char l[100];
diff -Nur xymon-4.3.29.bak/xymond/xymond_history.c xymon-4.3.29/xymond/xymond_history.c
--- xymon-4.3.29.bak/xymond/xymond_history.c 2019-09-11 17:42:00.000000000 +0400
+++ xymon-4.3.29/xymond/xymond_history.c 2019-09-11 17:53:19.963344423 +0400
@@ -86,7 +86,7 @@
/* Don't save the error buffer */
save_errbuf = 0;
- sprintf(pidfn, "%s/xymond_history.pid", xgetenv("XYMONSERVERLOGS"));
+ sprintf(pidfn, "%s/xymond_history.pid", xgetenv("XYMONRUNDIR"));
if (xgetenv("XYMONALLHISTLOG")) save_allevents = (strcmp(xgetenv("XYMONALLHISTLOG"), "TRUE") == 0);
if (xgetenv("XYMONHOSTHISTLOG")) save_hostevents = (strcmp(xgetenv("XYMONHOSTHISTLOG"), "TRUE") == 0);
if (xgetenv("SAVESTATUSLOG")) save_histlogs = (strncmp(xgetenv("SAVESTATUSLOG"), "FALSE", 5) != 0);
diff -Nur xymon-4.3.29.bak/xymond/xymond_rrd.c xymon-4.3.29/xymond/xymond_rrd.c
--- xymon-4.3.29.bak/xymond/xymond_rrd.c 2019-09-11 17:42:00.000000000 +0400
+++ xymon-4.3.29/xymond/xymond_rrd.c 2019-09-11 17:53:19.964344437 +0400
@@ -253,7 +253,8 @@
/* Setup the control socket that receives cache-flush commands */
memset(&ctlsockaddr, 0, sizeof(ctlsockaddr));
- sprintf(ctlsockaddr.sun_path, "%s/rrdctl.%lu", xgetenv("XYMONTMP"), (unsigned long)getpid());
+ if (xgetenv("XYMONRUNDIR") && mkdir(xgetenv("XYMONRUNDIR"), 0755) != -1) dbgprintf("Created %s\n", xgetenv("XYMONRUNDIR")); // just in case
+ sprintf(ctlsockaddr.sun_path, "%s/rrdctl.%lu", xgetenv("XYMONRUNDIR"), (unsigned long)getpid());
unlink(ctlsockaddr.sun_path); /* In case it was accidentally left behind */
ctlsockaddr.sun_family = AF_UNIX;
ctlsocket = socket(AF_UNIX, SOCK_DGRAM, 0);