HEX
HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux 2amigos-php74 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
User: squarehillcompany.com (1002)
PHP: 7.4.25
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //etc/rc5.d/S01opsview-agent
#! /bin/sh
#

### BEGIN INIT INFO
# Provides:          opsview-agent
# Required-Start:    $local_fs $remote_fs $syslog $named $network $time
# Required-Stop:     $local_fs $remote_fs $syslog $named $network
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/Stop the Nagios remote plugin execution daemon
### END INIT INFO


PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/opt/opsview/agent/bin/nrpe
NAME=opsview-agent
DESC=opsview-agent
CONFIG=/opt/opsview/agent/etc/nrpe.cfg
PIDFILE=/opt/opsview/var/nrpe.pid

# Problem due to file descriptor left open by Debian apt-get process
exec 3>/dev/null

test -x $DAEMON || exit 0

set -e

. /lib/lsb/init-functions

case "$1" in
  start)
	echo "Starting $DESC" "$NAME"
    # cleanup pidfile if necessary
    if [ -f $PIDFILE ]; then
        ps -p `cat $PIDFILE` | grep nrpe 1>/dev/null || rm -f $PIDFILE
    fi
	start-stop-daemon --chuid opsview -b --start $NICENESS --exec $DAEMON -- -c $CONFIG -d $DAEMON_OPTS
	;;
  stop)
	echo "Stopping $DESC" "$NAME"
	start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
	;;
  reload|force-reload)
	echo "Reloading $DESC configuration files" "$NAME"
	start-stop-daemon --stop --signal HUP --quiet --exec $DAEMON
	;;
  restart)
	$0 stop
	sleep 1
	$0 start
	;;
  status)
    status=0
    status_of_proc $DAEMON nrpe || status=$?
    exit $status
    ;;
  *)
	echo "Usage: $N {status|start|stop|restart|reload|force-reload}" >&2
	exit 1
	;;
esac

exit 0