Below is the scripts on page 18 I typed from the Zabbix 1.8 Network monitoring book (Richards Olups), but it was written for suse 10. After I run the command ln -s to generate the symlinks I try to run the agentd and server but it returns back with an error which is pointing to the around the last command echo.
ERROR message
"
/etc/init.d/zabbix_agentd: line 123: unexpected EOF while looking for matching ` "'
/etc/init.d/zabbix_agentd: line 129: syntax error: unexpected end of file
"
#! /bin/sh
# Copyright (c) 07/2004 A.Tophofen, Germany
# Modified for Zabbix 1.1alpha7 and SuSE Linux 9.2
# April 2005, A. Kiepe, Switzerland
#
# init.d/zabbix_server
#
### BEGIN INIT INFO
# Provides: zabbix_agentd
# Required-Start: $network $remote_fs $local_fs
# Required-Stop: $network $remote_fs $local_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Zabbix Monitoring agentd deamon
### END INIT INFO
ZABBIX_CONFIG="/etc/zabbix/zabbix_agentd.conf"
test -r $ZABBIX_CONFIG || { echo "$ZABBIX_CONFIG Missing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"
test -x $ZABBIX_BIN || { echo "$ZABBIX_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
. /etc/rc.status
# Reset status of this service
rc_reset
NAME="Zabbix agentd daemon"
ZABBIX_PID="/var/tmp/zabbix_agentd.pid"
case "$1" in
start)
echo -n "Starting ${NAME} "
## Start Daemon with startproc(8). If this fails
## the return value is set appropriately by startproc
/sbin/startproc -t l -p $ZABBIX_PID $ZABBIX_BIN
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down ${NAME}"
## Stop daemon with killproc(8) and if this fails
## killproc sets the return value according to LSB.
/sbin/killproc -TERM $ZABBIX_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
## Do a restart only if the service was active before
## Note: try-restart is now part of the LSB (as of 1.9)
## RH has similar command named condrestart.
if test "$1" = "condrestart"; then
echo "$[attn} Use try-restart ${done} (LSB)${attn} rather than
condrestart ${warn} (RH) ${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure
fi
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whethewr it was
## running or not, start it again
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Zabbix server daemon does not support configuration reloading
## thus it is restarted, if running
echo -n "Reload service $NAME "
$0 try-restart
rc_status
;;
reload)
## Zabbic server deamon does not support configuration reloading
## thus reload fails
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service $NAME "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0
# Return value is slightly different for the status command:
# 0 - service up and running
# 1 - service dead, but PID file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running (unused)
# 4 - service status unknown :-(
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
# NOTE: checkproc returns LSB compliant status values.
/sbin/checkproc -p $ZABBIX_PID $ZABBIX_BIN
# NOTE: rc_status knows that we can called this init script with
# "status" option and adapts its message accordingly
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload, print out the
## argument to this init script which is required for a reload
## Note: probe is not (yet) part of the LSB (as of 1.9)
test $ZABBIX_CONFIG -nt $ZABBIX_PID && echo reload
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit
ERROR message
"
/etc/init.d/zabbix_agentd: line 123: unexpected EOF while looking for matching ` "'
/etc/init.d/zabbix_agentd: line 129: syntax error: unexpected end of file
"
#! /bin/sh
# Copyright (c) 07/2004 A.Tophofen, Germany
# Modified for Zabbix 1.1alpha7 and SuSE Linux 9.2
# April 2005, A. Kiepe, Switzerland
#
# init.d/zabbix_server
#
### BEGIN INIT INFO
# Provides: zabbix_agentd
# Required-Start: $network $remote_fs $local_fs
# Required-Stop: $network $remote_fs $local_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Zabbix Monitoring agentd deamon
### END INIT INFO
ZABBIX_CONFIG="/etc/zabbix/zabbix_agentd.conf"
test -r $ZABBIX_CONFIG || { echo "$ZABBIX_CONFIG Missing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"
test -x $ZABBIX_BIN || { echo "$ZABBIX_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
. /etc/rc.status
# Reset status of this service
rc_reset
NAME="Zabbix agentd daemon"
ZABBIX_PID="/var/tmp/zabbix_agentd.pid"
case "$1" in
start)
echo -n "Starting ${NAME} "
## Start Daemon with startproc(8). If this fails
## the return value is set appropriately by startproc
/sbin/startproc -t l -p $ZABBIX_PID $ZABBIX_BIN
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down ${NAME}"
## Stop daemon with killproc(8) and if this fails
## killproc sets the return value according to LSB.
/sbin/killproc -TERM $ZABBIX_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
## Do a restart only if the service was active before
## Note: try-restart is now part of the LSB (as of 1.9)
## RH has similar command named condrestart.
if test "$1" = "condrestart"; then
echo "$[attn} Use try-restart ${done} (LSB)${attn} rather than
condrestart ${warn} (RH) ${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure
fi
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whethewr it was
## running or not, start it again
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Zabbix server daemon does not support configuration reloading
## thus it is restarted, if running
echo -n "Reload service $NAME "
$0 try-restart
rc_status
;;
reload)
## Zabbic server deamon does not support configuration reloading
## thus reload fails
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service $NAME "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0
# Return value is slightly different for the status command:
# 0 - service up and running
# 1 - service dead, but PID file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running (unused)
# 4 - service status unknown :-(
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
# NOTE: checkproc returns LSB compliant status values.
/sbin/checkproc -p $ZABBIX_PID $ZABBIX_BIN
# NOTE: rc_status knows that we can called this init script with
# "status" option and adapts its message accordingly
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload, print out the
## argument to this init script which is required for a reload
## Note: probe is not (yet) part of the LSB (as of 1.9)
test $ZABBIX_CONFIG -nt $ZABBIX_PID && echo reload
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit

Comment