im trying to setup a script which can look at a file and email me when a fail is present, this runs on cron every 10 minutes
Below is the file that will tell me if a PASS or FAIL has occured
$more monitor/results
Test: 01db_up.sh. Status: PASS. Message: db is up
Test: 02cm_up.sh. Status: PASS. Message: CM is running
Test: 03free_db.sh. Status: PASS. Message: 15% free space in data db
Test: 04free_log.sh. Status: PASS. Message: 99% free space in log db
currently i have this script
# Version - V0.1 19/08/09
#!/bin/ksh -xv
#test to see if the database is up and running
if [ $(grep "01db_up" monitor/results|grep FAIL|wc -l) -eq 1 ] ; then
if [ $($(grep -c 01db_up.*FAIL monitor/results) -ne 0 ] ; then
To keep the forums high quality for all users, please take the time to format your posts correctly.
Use Code Tags when you post any code or data samples so others can easily read your code.
You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags and by hand.)
Avoid adding color or different fonts and font size to your posts.
Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.