Exemplo n.º 1
0
def wdux_header(confpath):
    import platform
    center = wdlib.center

    print sep
    print
    center('              ##                ')
    center('              ##                ')
    center('##     ##  #####  ##  ##  ##  ##')
    center(' ## # ##  ##  ##  ##  ##    ##  ')
    center('  ## ##    #####   ####   ##  ##')
    print
    print
    center('WatchDog/UX Daily Report')
    center('%s' % time.strftime('%A %d.%m.%Y %H:%M'))
    center(r'on host "%s"' % (platform.uname()[1]))
    print
    print
    center('wdux version %s' % __version__)
    center('configuration from "%s"  [%s]' % (confpath, wdlib.mtime(confpath)))
    #    center('cluster package: %s       status: %s' % (cl_pkg, cl_sts))
    print sep
Exemplo n.º 2
0
import sys  # for sys.maxint
import os, re

# WDUX specific modules
import wdlib
import sysloglib as SLL

# globals
try:
    test = __file__
except NameError:
    import sys
    __file__ = sys.argv[0]

__version__ = wdlib.mtime(__file__)

err = sys.stderr.write
TopN = 10
OTHERSOURCE = '_system_'  # substitute for sources not processed here

sources = {
    # 'source_name' {base_filename, description, keep successful events?}
    # syslog is split by 'source_name' (lowercase!) into files in TMP
    # these are then read by the parser, results go into OUT
    # 'source_name' must match the syslog entry exactly! except for case
    # unrecognized sources are put into the OTHERSOURCE category
    # 'tmp_fh','handles','fname' values added at runtime
    'ftpd': {
        'name': 'sys_ftp',
        'desc': 'FTP events',