Cron Job Monitor
Description
This set of scripts reads cron job entries and check whether the cron jobs are running as it is supposed to be
and, if it does, check whether there are any error messages. If it finds these problems, it creates
a log and sends out email.
Location of Scripts and Their Names
Location: /data/mta/Script/Cron_check/Scripts/
GitHub Address: https://github.com/chandra-mta/MTA
cron_wrap_script | Mar 03, 2021 |
cron_main_script | Mar 03, 2021 |
check_cron_records.py | Mar 03, 2021 |
monthly_cleanup.py | Mar 03, 2021 |
send_error_list_email.py | Mar 03, 2021 |
Retired |
find_cron_records.py | Nov 08, 2018 |
find_cron_records_colossus.py | Nov 08, 2018 |
Please read README file for more details.
/data/mta/Script/Cron_check/Scripts/README.
Sep 16, 2014 | Initially logged |
Jul 16, 2015 | colossus-v added |
Apr 05, 2018 | colossus-v needs /usr/bin/python. created its version |
Nov 20, 2018 | han-v/luke-v added |
May 13, 2019 | updated python3.6 |
May 20, 2019 | a time stamp bug fixed |
Jun 10, 2020 | han-v, luke-v removed/boba-v added |
Oct 26, 2020 | read_data_file moved from mta coomon function to avoid jinja2 |
---|
Oct 27, 2020 | python 3.6 environment set for email |
---|
Oct 28, 2020 | a bug: not recording log fixed |
---|
Jan 20, 2021 | error checking condition updated |
---|
Mar 03, 2021 | python 3.8 upate |
---|
Data Needed
-
/home/mta/Logs/*cron
-
/home/cus/Logs/*cron
Environment Setting
-
setenv PYTHONPATH "/data/mta/Script/Python3.8/envs/ska3-shiny/lib/python3.8/site-packages:/data/mta/Script/Python3.8/lib/python3.8/site-packages/"
Output Locations and File Names
-
/data/mta/Script/Cron_check/house_keeping/Records/
- c3po-v_mta
- r2e2-v_mta
- c3po-v_cus
- r2e2-v_cus
- rhodes_cus
- r2d2-v_mta_error_list
- c3po-v_mta_error_list
How to Run the Script(s)
-
Log into: a machine you want to check with the user you want to check
-
run: /data/mta/Script/Cron_check/Scripts/check_cron_records.py
-
run once a day: /data/mta/Script/Cron_check/Scripts/send_error_list_email.py
-
run once a month: /data/mta/Script/Cron_check/Scripts/monthly_cleanup.py
How to Run Test(s)
-
There is no test for this set of scripts.
Expected result from the test
test results -- test results -- test results
Cron Job
-
mta @c3po-v
0,30 * * * * /data/mta/Script/Cron_check/Scripts/check_cron_records.py >> $HOME/Logs/new_cron_check_c3po_v_mta 2>&1
-
cus @ r2d2-v
5,35 * * * * /data/mta/Script/Cron_check/Scripts/check_cron_records.py >> $HOME/Logs/new_cron_check_r2d2_v_cus.cron 2>&1
-
mta @ r2d2-v
5,35 * * * * /data/mta/Script/Cron_check/Scripts/check_cron_records.py >> $HOME/Logs/new_cron_check_r2d2_v_mta.cron 2>&1
-
mta @ boba-v
6,36 * * * * /data/mta/Script/Cron_check/Scripts/check_cron_records.py >> $HOME/Logs/new_cron_check_boba_v_mta 2>&1
-
mta @ boba-v
10 7 * * * cd /data/mta4/Script/Cron_check/Scripts/; /data/mta/Script/Cron_check/Scripts/cron_wrap_script >> $HOME/Logs/new_cron_email_script.cron 2>&1
1 0 1 * * /data/mta4/Script/Cron_check/Scripts/monthly_cleanup.py >> $HOME/Logs/new_cron_email_clean_up_mta.cron 2>&1
Web Addreess
NA
Note
None
Future Plan/Update Schedule
None
Back to Top Page