projects
/
mirror
/
dsa-nagios.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The jessie kernel has not been built on a DSA box, breaking our check. Wow
[mirror/dsa-nagios.git]
/
dsa-nagios-checks
/
checks
/
dsa-check-log-age-loghost
diff --git
a/dsa-nagios-checks/checks/dsa-check-log-age-loghost
b/dsa-nagios-checks/checks/dsa-check-log-age-loghost
index
256caef
..
afec811
100755
(executable)
--- a/
dsa-nagios-checks/checks/dsa-check-log-age-loghost
+++ b/
dsa-nagios-checks/checks/dsa-check-log-age-loghost
@@
-29,10
+29,15
@@
usage(){
host="$1"
if [ -z "$host" ] || [ "$host" = "-h" ] || [ "$host" = "--help" ]; then
host="$1"
if [ -z "$host" ] || [ "$host" = "-h" ] || [ "$host" = "--help" ]; then
- echo >&2 "
$0:
Usage: $0 <host>"
+ echo >&2 "Usage: $0 <host>"
usage 3
fi
usage 3
fi
+if [ "${host/[^a-z0-9-]/}" != "$host" ]; then
+ echo >&2 "$0: Invalid hostname $1"
+ exit 3
+fi
+
ts=$(date -d 'now' +'%Y/%m/%d')
file="/var/log/hosts/$host/$ts/syslog"
if [ ! -e "$file" ]; then
ts=$(date -d 'now' +'%Y/%m/%d')
file="/var/log/hosts/$host/$ts/syslog"
if [ ! -e "$file" ]; then