diff options
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | plugins-scripts/check_log.sh | 11 | ||||
-rw-r--r-- | plugins-scripts/utils.sh.in | 10 |
3 files changed, 8 insertions, 14 deletions
@@ -3,6 +3,7 @@ This file documents the major additions and syntax changes between releases. | |||
3 | 1.6 ... | 3 | 1.6 ... |
4 | WARNINGS | 4 | WARNINGS |
5 | check_procs now ignores its parent process to avoid unexpected results when invoked via certain shells | 5 | check_procs now ignores its parent process to avoid unexpected results when invoked via certain shells |
6 | utils.sh no longer defines ECHO | ||
6 | 7 | ||
7 | 1.5 2nd October 2013 | 8 | 1.5 2nd October 2013 |
8 | ENHANCEMENTS | 9 | ENHANCEMENTS |
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh index a1bfb48..ca5810a 100755 --- a/plugins-scripts/check_log.sh +++ b/plugins-scripts/check_log.sh | |||
@@ -60,7 +60,6 @@ | |||
60 | # TV: removed PATH restriction. Need to think more about what this means overall | 60 | # TV: removed PATH restriction. Need to think more about what this means overall |
61 | #PATH="" | 61 | #PATH="" |
62 | 62 | ||
63 | ECHO="/bin/echo" | ||
64 | GREP="/bin/egrep" | 63 | GREP="/bin/egrep" |
65 | DIFF="/bin/diff" | 64 | DIFF="/bin/diff" |
66 | TAIL="/bin/tail" | 65 | TAIL="/bin/tail" |
@@ -167,10 +166,10 @@ done | |||
167 | # If the source log file doesn't exist, exit | 166 | # If the source log file doesn't exist, exit |
168 | 167 | ||
169 | if [ ! -e $logfile ]; then | 168 | if [ ! -e $logfile ]; then |
170 | $ECHO "Log check error: Log file $logfile does not exist!\n" | 169 | echo "Log check error: Log file $logfile does not exist!" |
171 | exit $STATE_UNKNOWN | 170 | exit $STATE_UNKNOWN |
172 | elif [ ! -r $logfile ] ; then | 171 | elif [ ! -r $logfile ] ; then |
173 | $ECHO "Log check error: Log file $logfile is not readable!\n" | 172 | echo "Log check error: Log file $logfile is not readable!" |
174 | exit $STATE_UNKNOWN | 173 | exit $STATE_UNKNOWN |
175 | fi | 174 | fi |
176 | 175 | ||
@@ -180,7 +179,7 @@ fi | |||
180 | 179 | ||
181 | if [ ! -e $oldlog ]; then | 180 | if [ ! -e $oldlog ]; then |
182 | $CAT $logfile > $oldlog | 181 | $CAT $logfile > $oldlog |
183 | $ECHO "Log check data initialized...\n" | 182 | echo "Log check data initialized..." |
184 | exit $STATE_OK | 183 | exit $STATE_OK |
185 | fi | 184 | fi |
186 | 185 | ||
@@ -209,10 +208,10 @@ $RM -f $tempdiff | |||
209 | $CAT $logfile > $oldlog | 208 | $CAT $logfile > $oldlog |
210 | 209 | ||
211 | if [ "$count" = "0" ]; then # no matches, exit with no error | 210 | if [ "$count" = "0" ]; then # no matches, exit with no error |
212 | $ECHO "Log check ok - 0 pattern matches found\n" | 211 | echo "Log check ok - 0 pattern matches found" |
213 | exitstatus=$STATE_OK | 212 | exitstatus=$STATE_OK |
214 | else # Print total matche count and the last entry we found | 213 | else # Print total matche count and the last entry we found |
215 | $ECHO "($count) $lastentry" | 214 | echo "($count) $lastentry" |
216 | exitstatus=$STATE_CRITICAL | 215 | exitstatus=$STATE_CRITICAL |
217 | fi | 216 | fi |
218 | 217 | ||
diff --git a/plugins-scripts/utils.sh.in b/plugins-scripts/utils.sh.in index 4a07df8..031c035 100644 --- a/plugins-scripts/utils.sh.in +++ b/plugins-scripts/utils.sh.in | |||
@@ -6,19 +6,13 @@ STATE_CRITICAL=2 | |||
6 | STATE_UNKNOWN=3 | 6 | STATE_UNKNOWN=3 |
7 | STATE_DEPENDENT=4 | 7 | STATE_DEPENDENT=4 |
8 | 8 | ||
9 | if test -x /usr/bin/printf; then | ||
10 | ECHO=/usr/bin/printf | ||
11 | else | ||
12 | ECHO=echo | ||
13 | fi | ||
14 | |||
15 | print_revision() { | 9 | print_revision() { |
16 | echo "$1 v$2 (@PACKAGE@ @VERSION@)" | 10 | echo "$1 v$2 (@PACKAGE@ @VERSION@)" |
17 | $ECHO "@WARRANTY@" | sed -e 's/\n/ /g' | 11 | printf '%b' "@WARRANTY@" |
18 | } | 12 | } |
19 | 13 | ||
20 | support() { | 14 | support() { |
21 | $ECHO "@SUPPORT@" | sed -e 's/\n/ /g' | 15 | printf '%b' "@SUPPORT@" |
22 | } | 16 | } |
23 | 17 | ||
24 | # | 18 | # |