Python scripts for monitoring cron jobs with DeadManPing.
- Install dependencies:
pip install requests - Replace
YOUR_MONITOR_IDin each script with your actual monitor ID from deadmanping.com - Make script executable:
chmod +x script.py - Add to crontab:
0 3 * * * /usr/bin/python3 /path/to/script.py
- detect_empty_backup_file_cron.py - Detect when backup files are empty
- verify_cron_job_actually_ran.py - Verify job execution with timestamps
- verify_cron_job_completed.py - Confirm job finished successfully
- cron_job_exit_code_not_zero.py - Check exit codes
- cron_job_exit_status_check.py - Verify exit status
- detect_cron_job_wrong_exit_code.py - Detect false success
- silent_cron_failures.py - Detect silent failures with try-finally
- cron_job_silent_failure_detection.py - Always ping on success
- detect_empty_backup_file.py - Check backup file size
- detect_backup_file_missing.py - Verify backup file exists
- backup_file_zero_bytes.py - Detect zero-byte backups
- verify_backup_file_size.py - Validate file size ranges
- curl_success_but_wrong_response.py - Validate API responses
- curl_returns_200_but_wrong_data.py - Check response body content
- verify_cron_output.py - Validate script output
- verify_script_output_content.py - Check output content
- detect_cron_job_partial_failure.py - Verify multi-step jobs
- cron_job_returns_success_but_fails.py - Validate results
- cron_job_not_executing.py - Detect non-execution
- detect_cron_job_skipped.py - Catch skipped jobs
- Use try-finally - Ensure ping is sent even on exception
- Check results - Don't just trust exit codes, verify actual results
- Handle exceptions - Catch and report errors properly
- Use subprocess.run() - Better control over exit codes than os.system()
- Validate JSON - Always validate JSON responses before using
All examples require:
pip install requestsSee deadmanping.com for detailed documentation on each problem and solution.