1=head1 NAME
2
3epylog ‐ Perl5 module for writing perl modules for epylog.
4
5=head1 SYNOPSIS
6
7 use epylog;
8
9 # create a new epylog object
10 my $du = new epylog;
11
12 # initialize the object
13 $du‐>init(’modulename’);
14
15 # get a username from a userid
16 $du‐>getuname(500);
17
18 # get a hostname from an IP address
19 $du‐>gethost(’127.0.0.1’);
20
21 # find the system name in a standard syslog line
22 $du‐>getsystem($syslogline);
23
24 # get the value of an environment variable
25 # first parameter is the name of the variable, second one is
26 # the default value to return if the variable is undefined.
27 $du‐>option(’TMPDIR’, ’/tmp’);
28
29 # return the next available syslog line from the logs (LOGCAT)
30 $du‐>nextline();
31
32 # check if the logfile is EOF’d. Returns 0 if not yet.
33 $du‐>islogeof();
34
35 # add a string or an array of strings to the report (LOGREPORT)
36 $du‐>pushrep(’Report line’);
37
38 # add a syslog line entry to the list of analyzed and filtered
39 # lines (LOGFILTER)
40 $du‐>pushfilt($syslog_line);
41
42 # intelligently output some debug information.
43 #  first  parameter  is level, second parameter is the string to
44output.
45 # level 0  ‐‐ critical errors, always output
46 # level 1  ‐‐ standard epylog execution, without "‐‐quiet"
47 # level 2> ‐‐ additional levels of verbosity.
48 $du‐>mlog(1, ’Processing data’);
49
50 # return how many lines were added to the filter  file  (LOGFIL‐
51TER)
52 $du‐>filtsize();
53
54 #  return  how  many lines were added to the report file (LOGRE‐
55PORT)
56 $du‐>repsize();
57
58 # make a pretty report header.
59 $du‐>mkrephdr(’NOTICED REBOOTS’);
60
61 # call this at the end of your module! It closes the filehandles
62and
63 # writes out the report.
64 $du‐>finalize();
65
66=head1 AUTHORS
67
68 Konstantin Ryabitsev <icon@linux.duke.edu>
69 Michael Stenner <mstenner@phy.duke.edu>
70
71 Duke University Physics
72
73=head1 REVISION
74
75$Revision: 1.1.2.1 $
76
77=head1 SEE ALSO
78
79epylog(8), epylog_modules(5)
80
81
82=cut
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Impressum