-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
58 lines (41 loc) · 1.85 KB
/
main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Server Notification Scripts
*
*
* @copyright 2012 jCODE
* @author Jason Millward <[email protected]>
* @package Utility
*/
// Config
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'config.php';
// Classes
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'OAuth.php';
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'TwitterOAuth.php';
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'RestClient.php';
// Functions
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'functions' . DIRECTORY_SEPARATOR . 'original.php';
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'functions' . DIRECTORY_SEPARATOR . 'custom.php';
// Things that only happen on the first of the month
if ( todayIsTheFirst() && lastRun('monthly','28 Days') ) {
// Notify the wold to how long we've been up and running for
sayUptime();
// Notify the world how much data we've sent and recived
sayNetwork();
}
// Things that run once a day, at midnight
if ( isMidnight() && lastRun('daily','22 Hours') ) {
// Check backup logs to see if everything was completed successfully
readBackupLogs();
// Read error logs, notify owner to make them stop being silly
checkErrorLogs();
// Read HDD free space, notify admin if they're too full
checkDisks();
}
// Things that are being checked every x minutes
// Check server load, if it's too high, notify everyone
checkLoad();
// Check database load, buffer and general databasey things
//readDB();
// Custom network load checker
//readPartyCat();