This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JJ Asghar
committed
Oct 2, 2013
1 parent
1155bba
commit 0ffe4db
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
CHECK_FILE=somefile | ||
ERRORRANGE=20 | ||
HIGHRANGE=20 | ||
LOWRANGE=0 | ||
somecommand=`echo blah` | ||
stateid= | ||
WWW_DIR=/var/www | ||
OFF=/var/www/off | ||
|
||
if [ -f "${OFF}" ] | ||
then | ||
echo OFF | ||
stateid=1 | ||
exit $stateid | ||
else | ||
|
||
|
||
if [ "${somecomand}" -eq 0 ]; | ||
then | ||
if [ ! \( -e "${WWW_DIR}/${CHECK_FILE}" \) ]; | ||
then | ||
cd /var/www/ | ||
sudo ln -s ${CHECK_FILE_TMP} ${CHECK_FILE} | ||
fi | ||
echo The Global somecommand is OK | ||
stateid=0 | ||
elif [ "${somecommand}" -ge "${LOWRANGE}" ] && [ "${somecommand}" -lt "${HIGHRANGE}" ]; | ||
then | ||
echo The Global somecommand is in a Warning state at "${somecommand}" | ||
stateid=1 | ||
elif [ "${somecommand}" -ge ${ERRORRANGE} ]; | ||
then | ||
if [ \( -h "${WWW_DIR}/${CHECK_FILE}" \) ]; | ||
then | ||
cd /var/www/ | ||
sudo rm ${CHECK_FILE} | ||
fi | ||
echo The Global somecommand is in a Critical state at "${somecommand}" | ||
stateid=2 | ||
fi | ||
exit $stateid | ||
fi |