Module: nagvis Branch: master Commit: ecfecf2360f4e7a346c0375cacd28b4fb20bbdc2 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=ecfecf2360f4e7a346c0375cacd28b4fb20bbdc2
Author: LaMi <[email protected]> Date: Sat Feb 27 16:24:15 2010 +0100 Fixed nagios path detection --- install.sh | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 1c74990..31ac0e5 100755 --- a/install.sh +++ b/install.sh @@ -361,14 +361,18 @@ log() { detect_nagios_path() { IFS=$'\n' for N_PROC in `ps ax -o pid,ppid,user,command | grep nagios | grep -v grep`; do + IFS=" " # 2138 1 nagios /d/nagvis-dev/nagios/bin/nagios -d /d/nagvis-dev/nagios/etc/nagios.cfg N_PID=`expr "$N_PROC" : ' *\([0-9]*\)'` N_PPID=`expr "$N_PROC" : ' *[0-9]* *\([0-9]*\)'` N_USR=`expr "$N_PROC" : ' *[0-9]* *[0-9]* *\([^ ]*\)'` N_CMD=`expr "$N_PROC" : ' *[0-9]* *[0-9]* *[^ ]* *\(.*\)'` - N_BIN=${N_CMD%% *} - NAGIOS_PATH=${N_BIN%%/bin/nagios} + echo "$N_CMD" | grep -i " -d" >/dev/null + if [[ $? -eq 0 && $N_PPID -eq 1 ]]; then + N_BIN=${N_CMD%% *} + NAGIOS_PATH=${N_BIN%%/bin/nagios} + fi done IFS=" " } ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
