@@ -113,6 +113,7 @@ function doMonitor()
113113 $ this ->monitorMailWarnLog ();
114114 $ this ->monitorMailErrLog ();
115115 $ this ->monitorMessagesLog ();
116+ $ this ->monitorISPCCronLog ();
116117 $ this ->monitorFreshClamLog ();
117118 $ this ->monitorClamAvLog ();
118119 $ this ->monitorIspConfigLog ();
@@ -937,6 +938,43 @@ function monitorMessagesLog()
937938 $ this ->_delOldRecords ($ type , 10 );
938939 }
939940
941+ function monitorISPCCronLog ()
942+ {
943+ global $ app ;
944+ global $ conf ;
945+
946+ /* the id of the server as int */
947+ $ server_id = intval ($ conf ["server_id " ]);
948+
949+ /** The type of the data */
950+ $ type = 'log_ispc_cron ' ;
951+
952+ /* Get the data of the log */
953+ $ data = $ this ->_getLogData ($ type );
954+
955+ /*
956+ * actually this info has no state.
957+ * maybe someone knows better...???...
958+ */
959+ $ state = 'no_state ' ;
960+
961+ /*
962+ Insert the data into the database
963+ */
964+ $ sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
965+ "VALUES ( " .
966+ $ server_id . ", " .
967+ "' " . $ app ->dbmaster ->quote ($ type ) . "', " .
968+ time () . ", " .
969+ "' " . $ app ->dbmaster ->quote (serialize ($ data )) . "', " .
970+ "' " . $ state . "' " .
971+ ") " ;
972+ $ app ->dbmaster ->query ($ sql );
973+
974+ /* The new data is written, now we can delete the old one */
975+ $ this ->_delOldRecords ($ type , 10 );
976+ }
977+
940978 function monitorFreshClamLog ()
941979 {
942980 global $ app ;
@@ -1092,6 +1130,9 @@ function _getLogData($log){
10921130 case 'log_messages ' :
10931131 $ logfile = '/var/log/messages ' ;
10941132 break ;
1133+ case 'log_ispc_cron ' :
1134+ $ logfile = '/var/log/ispconfig/cron.log ' ;
1135+ break ;
10951136 case 'log_freshclam ' :
10961137 $ logfile = '/var/log/clamav/freshclam.log ' ;
10971138 break ;
0 commit comments