Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init script changes #102

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions graphios.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,9 @@ def process_log(file_name):
nobj.UOM = re.sub("[^a-zA-Z]+", "", u)
processed_objects.append(nobj)
except:
log.critical("failed to parse label: '%s' part of perf"
"string '%s'" % (metric, nobj.PERFDATA))
log.critical("failed to parse label '%s' for "
"host '%s' service '%s' perfdata '%s'"
% (metric, nobj.HOSTNAME, nobj.SERVICEDESC, nobj.PERFDATA))
continue
return processed_objects

Expand Down
20 changes: 12 additions & 8 deletions init/rhel/graphios
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,29 @@
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

prog="/usr/bin/graphios"
# or use the command line options:
#prog="/usr/bin/graphios --log-file=/dir/mylog.log --spool-directory=/dir/my/sool"
prog="/usr/bin/graphios.py"
OPTIONS=""
GRAPHIOS_USER="nagios"
RETVAL=0
lockfile=/var/lock/subsys/graphios

if [ -f /etc/sysconfig/graphios ]; then
. /etc/sysconfig/graphios
fi

start () {
echo -n "Starting $prog"
/usr/bin/sudo -u ${GRAPHIOS_USER} ${prog} &
echo -n $"Starting $prog: "
nohup su ${GRAPHIOS_USER} -s /bin/sh -c "${prog} ${OPTIONS}" >/dev/null 2>&1 &
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
[ $RETVAL -eq 0 ] && touch ${lockfile} && success || failure
echo
}

stop () {
echo -n "Stopping $prog"
echo -n $"Stopping $prog: "
killproc graphios.py
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
[ $RETVAL -eq 0 ] && rm -f ${lockfile}
echo
}

Expand Down
3 changes: 0 additions & 3 deletions init/rhel/postinstall
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# add symlink
ln -s /usr/bin/graphios.py /usr/bin/graphios

# add graphios service
if [ ! -d /etc/systemd ]; then
# we are running init
Expand Down
2 changes: 0 additions & 2 deletions init/rhel/postuninstall
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ else
# we are running systemd
systemctl stop graphios.service
fi

unlink /usr/bin/graphios