Skip to content
Snippets Groups Projects
Select Git revision
  • 1ff8825502bbad6b64d270c97a7038e8fb8c1487
  • master default protected
  • Legacy_Php7
3 results

inc_functions.php

Blame
  • cronlog.class.php 12.15 KiB
    <?php
    /**
     * ______________________________________________________________________
     * 
     *  _____                 _       _             _                        
     * /  __ \               (_)     | |           (_)                       
     * | /  \/_ __ ___  _ __  _  ___ | |__   __   ___  _____      _____ _ __ 
     * | |   | '__/ _ \| '_ \| |/ _ \| '_ \  \ \ / / |/ _ \ \ /\ / / _ \ '__|
     * | \__/\ | | (_) | | | | | (_) | |_) |  \ V /| |  __/\ V  V /  __/ |   
     *  \____/_|  \___/|_| |_| |\___/|_.__/    \_/ |_|\___| \_/\_/ \___|_|   
     *                      _/ |                                             
     *                     |__/                                              
     * ______________________________________________________________________
     * 
     * The cronjob viewer for centralized monitoring of cronjobs using
     * Axels cronrwapper (see <https://github.com/axelhahn/cronwrapper>).
     * 
     * You can browse all servers to see 
     * - the last status of all cronjobs
     * - results an execution times of running jonbs
     * - a timeline for all jobs running > 60s
     * 
     * 
     * Free software. Open Source. GNU GPL 3.
     * SOURCE: <https://git-repo.iml.unibe.ch/iml-open-source/cronlog-viewer>
     * 
     * ______________________________________________________________________
     * 
     * The cronlog class contains non visual methods
     * @see cronlog-renderer.class.php
     *
     * @license GNU GPL 3.0
     * @author Axel Hahn <axel.hahn@iml.unibe.ch>
     */
    
    class cronlog {
        
        
        protected $_sDataDir = "__APPDIR__/data";
        protected $_iTtlCache = 60; // in sec
    
        /**
         * when show an error for expired jobs (latency to execute job and sync logs)
         * @var integer
         */
        protected $_iExpiredJobsFailAfter = 60*30; // in sec
        protected $_iMinTtl = 0; // in sec
        protected $_aSkipJoblogs = array();
        
        protected $_aInstances = array();
    
        protected $_aServers = array();
        protected $_sActiveServer = false;
        
        protected $_sFileFilter_serverjoblog = '*joblog*.done';
        protected $_sFileFilter_serverlog = '*.log';
    
        protected $_sLang = ''; // language ... read from config file
        protected $_aLang = []; // language data
    
        // ----------------------------------------------------------------------
        // MAIN
        // ----------------------------------------------------------------------
    
        /**
         * init
         * @return boolean
         */
        public function __construct() {