|
Packit |
667938 |
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Standard preamble:
|
|
Packit |
667938 |
.\" ========================================================================
|
|
Packit |
667938 |
.de Sp \" Vertical space (when we can't use .PP)
|
|
Packit |
667938 |
.if t .sp .5v
|
|
Packit |
667938 |
.if n .sp
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.de Vb \" Begin verbatim text
|
|
Packit |
667938 |
.ft CW
|
|
Packit |
667938 |
.nf
|
|
Packit |
667938 |
.ne \\$1
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.de Ve \" End verbatim text
|
|
Packit |
667938 |
.ft R
|
|
Packit |
667938 |
.fi
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.\" Set up some character translations and predefined strings. \*(-- will
|
|
Packit |
667938 |
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
|
Packit |
667938 |
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
|
|
Packit |
667938 |
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
|
|
Packit |
667938 |
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
|
|
Packit |
667938 |
.\" nothing in troff, for use with C<>.
|
|
Packit |
667938 |
.tr \(*W-
|
|
Packit |
667938 |
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
|
Packit |
667938 |
.ie n \{\
|
|
Packit |
667938 |
. ds -- \(*W-
|
|
Packit |
667938 |
. ds PI pi
|
|
Packit |
667938 |
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
|
Packit |
667938 |
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
|
Packit |
667938 |
. ds L" ""
|
|
Packit |
667938 |
. ds R" ""
|
|
Packit |
667938 |
. ds C` ""
|
|
Packit |
667938 |
. ds C' ""
|
|
Packit |
667938 |
'br\}
|
|
Packit |
667938 |
.el\{\
|
|
Packit |
667938 |
. ds -- \|\(em\|
|
|
Packit |
667938 |
. ds PI \(*p
|
|
Packit |
667938 |
. ds L" ``
|
|
Packit |
667938 |
. ds R" ''
|
|
Packit |
667938 |
. ds C`
|
|
Packit |
667938 |
. ds C'
|
|
Packit |
667938 |
'br\}
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Escape single quotes in literal strings from groff's Unicode transform.
|
|
Packit |
667938 |
.ie \n(.g .ds Aq \(aq
|
|
Packit |
667938 |
.el .ds Aq '
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" If the F register is turned on, we'll generate index entries on stderr for
|
|
Packit |
667938 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
Packit |
667938 |
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
Packit |
667938 |
.\" output yourself in some meaningful fashion.
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Avoid warning from groff about undefined register 'F'.
|
|
Packit |
667938 |
.de IX
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.nr rF 0
|
|
Packit |
667938 |
.if \n(.g .if rF .nr rF 1
|
|
Packit |
667938 |
.if (\n(rF:(\n(.g==0)) \{
|
|
Packit |
667938 |
. if \nF \{
|
|
Packit |
667938 |
. de IX
|
|
Packit |
667938 |
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
. if !\nF==2 \{
|
|
Packit |
667938 |
. nr % 0
|
|
Packit |
667938 |
. nr F 2
|
|
Packit |
667938 |
. \}
|
|
Packit |
667938 |
. \}
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.rr rF
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
|
Packit |
667938 |
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
|
Packit |
667938 |
. \" fudge factors for nroff and troff
|
|
Packit |
667938 |
.if n \{\
|
|
Packit |
667938 |
. ds #H 0
|
|
Packit |
667938 |
. ds #V .8m
|
|
Packit |
667938 |
. ds #F .3m
|
|
Packit |
667938 |
. ds #[ \f1
|
|
Packit |
667938 |
. ds #] \fP
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.if t \{\
|
|
Packit |
667938 |
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
|
Packit |
667938 |
. ds #V .6m
|
|
Packit |
667938 |
. ds #F 0
|
|
Packit |
667938 |
. ds #[ \&
|
|
Packit |
667938 |
. ds #] \&
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
. \" simple accents for nroff and troff
|
|
Packit |
667938 |
.if n \{\
|
|
Packit |
667938 |
. ds ' \&
|
|
Packit |
667938 |
. ds ` \&
|
|
Packit |
667938 |
. ds ^ \&
|
|
Packit |
667938 |
. ds , \&
|
|
Packit |
667938 |
. ds ~ ~
|
|
Packit |
667938 |
. ds /
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.if t \{\
|
|
Packit |
667938 |
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
|
Packit |
667938 |
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
|
Packit |
667938 |
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
|
Packit |
667938 |
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
|
Packit |
667938 |
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
|
Packit |
667938 |
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
. \" troff and (daisy-wheel) nroff accents
|
|
Packit |
667938 |
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
|
Packit |
667938 |
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
|
Packit |
667938 |
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
|
Packit |
667938 |
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
|
Packit |
667938 |
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
|
Packit |
667938 |
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
|
Packit |
667938 |
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
|
Packit |
667938 |
.ds ae a\h'-(\w'a'u*4/10)'e
|
|
Packit |
667938 |
.ds Ae A\h'-(\w'A'u*4/10)'E
|
|
Packit |
667938 |
. \" corrections for vroff
|
|
Packit |
667938 |
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
|
Packit |
667938 |
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
|
Packit |
667938 |
. \" for low resolution devices (crt and lpr)
|
|
Packit |
667938 |
.if \n(.H>23 .if \n(.V>19 \
|
|
Packit |
667938 |
\{\
|
|
Packit |
667938 |
. ds : e
|
|
Packit |
667938 |
. ds 8 ss
|
|
Packit |
667938 |
. ds o a
|
|
Packit |
667938 |
. ds d- d\h'-1'\(ga
|
|
Packit |
667938 |
. ds D- D\h'-1'\(hy
|
|
Packit |
667938 |
. ds th \o'bp'
|
|
Packit |
667938 |
. ds Th \o'LP'
|
|
Packit |
667938 |
. ds ae ae
|
|
Packit |
667938 |
. ds Ae AE
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.rm #[ #] #H #V #F C
|
|
Packit |
667938 |
.\" ========================================================================
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.IX Title "MRTGLIB 1"
|
|
Packit |
667938 |
.TH MRTGLIB 1 "2018-07-13" "2.17.7" "mrtg"
|
|
Packit |
667938 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
Packit |
667938 |
.\" way too many mistakes in technical documents.
|
|
Packit |
667938 |
.if n .ad l
|
|
Packit |
667938 |
.nh
|
|
Packit |
667938 |
.SH "NAME"
|
|
Packit |
667938 |
MRTG_lib.pm \- Library for MRTG and support scripts
|
|
Packit |
667938 |
.SH "SYNOPSIS"
|
|
Packit |
667938 |
.IX Header "SYNOPSIS"
|
|
Packit |
667938 |
.Vb 5
|
|
Packit |
667938 |
\& use MRTG_lib;
|
|
Packit |
667938 |
\& my ($configfile, @target_names, %globalcfg, %targetcfg);
|
|
Packit |
667938 |
\& readcfg($configfile, \e@target_names, \e%globalcfg, \e%targetcfg);
|
|
Packit |
667938 |
\& my (@parsed_targets);
|
|
Packit |
667938 |
\& cfgcheck(\e@target_names, \e%globalcfg, \e%targetcfg, \e@parsed_targets);
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.SH "DESCRIPTION"
|
|
Packit |
667938 |
.IX Header "DESCRIPTION"
|
|
Packit |
667938 |
MRTG_lib is part of \s-1MRTG,\s0 the Multi Router Traffic Grapher. It was separated
|
|
Packit |
667938 |
from \s-1MRTG\s0 to allow other programs to easily use the same config files. The
|
|
Packit |
667938 |
main part of MRTG_lib is the config file parser but some other funcions are
|
|
Packit |
667938 |
there too.
|
|
Packit |
667938 |
.ie n .IP "$MRTG_lib::OS" 4
|
|
Packit |
667938 |
.el .IP "\f(CW$MRTG_lib::OS\fR" 4
|
|
Packit |
667938 |
.IX Item "$MRTG_lib::OS"
|
|
Packit |
667938 |
Type of \s-1OS: WIN, UNIX, VMS\s0
|
|
Packit |
667938 |
.ie n .IP "$MRTG_lib::SL" 4
|
|
Packit |
667938 |
.el .IP "\f(CW$MRTG_lib::SL\fR" 4
|
|
Packit |
667938 |
.IX Item "$MRTG_lib::SL"
|
|
Packit |
667938 |
\&\fISlash\fR in the current \s-1OS.\s0
|
|
Packit |
667938 |
.ie n .IP "$MRTG_lib::PS" 4
|
|
Packit |
667938 |
.el .IP "\f(CW$MRTG_lib::PS\fR" 4
|
|
Packit |
667938 |
.IX Item "$MRTG_lib::PS"
|
|
Packit |
667938 |
Path separator in \s-1PATH\s0 variable
|
|
Packit |
667938 |
.ie n .IP """readcfg""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWreadcfg\fR" 4
|
|
Packit |
667938 |
.IX Item "readcfg"
|
|
Packit |
667938 |
\&\f(CW\*(C`readcfg($file, \e@targets, \e%globalcfg, \e%targetcfg [, $prefix, \e%extrules])\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Reads a config file, parses it and fills some arrays and hashes. The
|
|
Packit |
667938 |
mandatory arguments are: the name of the config file, a ref to an array which
|
|
Packit |
667938 |
will be filled with a list of the target names, a hashref for the global
|
|
Packit |
667938 |
configuration, a hashref for the target configuration.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
The configuration file syntax is:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 4
|
|
Packit |
667938 |
\& globaloption: value
|
|
Packit |
667938 |
\& targetoption[targetname]: value
|
|
Packit |
667938 |
\& aprefix*extglobal: value
|
|
Packit |
667938 |
\& aprefix*exttarget[target2]: value
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
E.g.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 3
|
|
Packit |
667938 |
\& workdir: /var/stat/mrtg
|
|
Packit |
667938 |
\& target[router1]: 2:public@router1.local.net
|
|
Packit |
667938 |
\& 14all*columns: 2
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
The global config hash has the structure
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& $globalcfg{configoption} = \*(Aqvalue\*(Aq
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
The target config hash has the structure
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& $targetcfg{configoption}{targetname} = \*(Aqvalue\*(Aq
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
See mrtg-reference for more information about the \s-1MRTG\s0 configuration syntax.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
\&\f(CW\*(C`readcfg\*(C'\fR can take two additional arguments to extend the config file
|
|
Packit |
667938 |
syntax. This allows programs to put their configuration into the mrtg config
|
|
Packit |
667938 |
file. The fifth argument is the prefix of the extension, the sixth argument
|
|
Packit |
667938 |
is a hash with the checkrules for these extension settings. E.g. if the
|
|
Packit |
667938 |
prefix is \*(L"14all\*(R" \f(CW\*(C`readcfg\*(C'\fR will check config lines that begin with
|
|
Packit |
667938 |
\&\*(L"14all*\*(R", i.e. all lines like
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 2
|
|
Packit |
667938 |
\& 14all*columns: 2
|
|
Packit |
667938 |
\& 14all*graphsize[target3]: 500 200
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
against the rules in \f(CW%extrules\fR. The format of this hash is:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 4
|
|
Packit |
667938 |
\& $extrules{option} = [sub{$_[0] =~ m/^\ed+$/}, sub{"Error message for $_[0]"}]
|
|
Packit |
667938 |
\& i.e.
|
|
Packit |
667938 |
\& $extrules{option}[0] \-> a test expression
|
|
Packit |
667938 |
\& $extrules{option}[1] \-> error message if test fails
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
The first part of the array is a perl expression to test the value of the
|
|
Packit |
667938 |
option. The test can access this value in the variable \*(L"$arg\*(R". The second
|
|
Packit |
667938 |
part of the array is an error message to display when the test fails. The
|
|
Packit |
667938 |
failed value can be integrated by using the variable \*(L"$arg\*(R".
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Config settings with an different prefix than the one given in the \f(CW\*(C`readcfg\*(C'\fR
|
|
Packit |
667938 |
call are not checked but inserted into \fI\f(CI%globalcfg\fI\fR and \fI\f(CI%targetcfg\fI\fR.
|
|
Packit |
667938 |
Prefixed settings keep their prefix in the config hashes:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& $targetcfg{\*(Aq14all*graphsize\*(Aq}{\*(Aqtarget3\*(Aq} = \*(Aq500 200\*(Aq
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.ie n .IP """cfgcheck""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWcfgcheck\fR" 4
|
|
Packit |
667938 |
.IX Item "cfgcheck"
|
|
Packit |
667938 |
\&\f(CW\*(C`cfgcheck(\e@target_names, \e%globalcfg, \e%targetcfg, \e@parsed_targets)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Checks the configuration read by \f(CW\*(C`readcfg\*(C'\fR. Checks the values in the config
|
|
Packit |
667938 |
for syntactical and/or semantical errors. Sets defaults for some options.
|
|
Packit |
667938 |
Parses the \*(L"target[...]\*(R" options and filles the array \f(CW@parsed_targets\fR ready
|
|
Packit |
667938 |
for mrtg functions.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
The first three arguments are the same as for \f(CW\*(C`readcfg\*(C'\fR. The fourth argument
|
|
Packit |
667938 |
is an arrayref which will be filled with the parsed target defs.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
\&\f(CW\*(C`cfgcheck\*(C'\fR converts the values of target settings \fIoptions\fR, e.g.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& options[router1]: bits, growright
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
to a hash:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 2
|
|
Packit |
667938 |
\& $targetcfg{\*(Aqoption\*(Aq}{\*(Aqbits\*(Aq}{\*(Aqrouter1\*(Aq} = 1
|
|
Packit |
667938 |
\& $targetcfg{\*(Aqoption\*(Aq}{\*(Aqgrowright\*(Aq}{\*(Aqrouter1\*(Aq} = 1
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
This is not done by \f(CW\*(C`readcfg\*(C'\fR so if you don't use \f(CW\*(C`cfgcheck\*(C'\fR you have to
|
|
Packit |
667938 |
check the scalar variable \fI\f(CI$targetcfg\fI{'option'}{'router1'}\fR (\s-1MRTG\s0 allows
|
|
Packit |
667938 |
options to be separated by space or ',').
|
|
Packit |
667938 |
.ie n .IP """ensureSL""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWensureSL\fR" 4
|
|
Packit |
667938 |
.IX Item "ensureSL"
|
|
Packit |
667938 |
\&\f(CW\*(C`ensureSL(\e$pathname)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Checks that the \fIpathname\fR does not contain double path separators and ends
|
|
Packit |
667938 |
with a path separator. It uses \f(CW$MRTG_lib::SL\fR as path separator which will be /
|
|
Packit |
667938 |
or \e depending on the \s-1OS.\s0
|
|
Packit |
667938 |
.ie n .IP """log2rrd""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWlog2rrd\fR" 4
|
|
Packit |
667938 |
.IX Item "log2rrd"
|
|
Packit |
667938 |
\&\f(CW\*(C`log2rrd ($router,\e%globalcfg,\e%targetcfg)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Convert log file to rrd format. Needs rrdtool.
|
|
Packit |
667938 |
.ie n .IP """datestr""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWdatestr\fR" 4
|
|
Packit |
667938 |
.IX Item "datestr"
|
|
Packit |
667938 |
\&\f(CW\*(C`datestr(time)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Returns the time given in the argument as a nicely formated date string.
|
|
Packit |
667938 |
The argument has to be in \s-1UNIX\s0 time format (seconds since 1970\-1\-1).
|
|
Packit |
667938 |
.ie n .IP """timestamp""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWtimestamp\fR" 4
|
|
Packit |
667938 |
.IX Item "timestamp"
|
|
Packit |
667938 |
\&\f(CW\*(C`timestamp()\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Return a string representing the current time.
|
|
Packit |
667938 |
.ie n .IP """setup_loghandlers""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWsetup_loghandlers\fR" 4
|
|
Packit |
667938 |
.IX Item "setup_loghandlers"
|
|
Packit |
667938 |
\&\f(CW\*(C`setup_loghandlers(filename)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Install signalhandlers for _\|_DIE_\|_ and _\|_WARN_\|_ making the errors
|
|
Packit |
667938 |
go the the specified destination. If filename is 'eventlog'
|
|
Packit |
667938 |
mrtg will log to the windows event logger.
|
|
Packit |
667938 |
.ie n .IP """expistr""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWexpistr\fR" 4
|
|
Packit |
667938 |
.IX Item "expistr"
|
|
Packit |
667938 |
\&\f(CW\*(C`expistr(time)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Returns the time given in the argument formatted suitable for \s-1HTTP\s0
|
|
Packit |
667938 |
Expire-Headers.
|
|
Packit |
667938 |
.ie n .IP """create_pid""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWcreate_pid\fR" 4
|
|
Packit |
667938 |
.IX Item "create_pid"
|
|
Packit |
667938 |
\&\f(CW\*(C`create_pid()\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Creates a pid file for the mrtg daemon
|
|
Packit |
667938 |
.ie n .IP """demonize_me""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWdemonize_me\fR" 4
|
|
Packit |
667938 |
.IX Item "demonize_me"
|
|
Packit |
667938 |
\&\f(CW\*(C`demonize_me()\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Puts the running program into background, detaching it from the terminal.
|
|
Packit |
667938 |
.ie n .IP """populatecache""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWpopulatecache\fR" 4
|
|
Packit |
667938 |
.IX Item "populatecache"
|
|
Packit |
667938 |
\&\f(CW\*(C`populatecache(\e%confcache, $host, $reread, $snmpoptshash)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Reads the \s-1SNMP\s0 variables \fIifDescr\fR, \fIipAdEntIfIndex\fR, \fIifPhysAddress\fR, \fIifName\fR from
|
|
Packit |
667938 |
the \fIhost\fR and stores the values in \fI\f(CI%confcache\fI\fR as follows:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 5
|
|
Packit |
667938 |
\& $confcache{$host}{\*(AqDescr\*(Aq}{ifDescr}{oid} = (ifDescr or \*(AqDup\*(Aq)
|
|
Packit |
667938 |
\& $confcache{$host}{\*(AqIP\*(Aq}{ipAdEntIfIndex}{oid} = (ipAdEntIfIndex or \*(AqDup\*(Aq)
|
|
Packit |
667938 |
\& $confcache{$host}{\*(AqEth\*(Aq}{ifPhysAddress}{oid} = (ifPhysAddress or \*(AqDup\*(Aq)
|
|
Packit |
667938 |
\& $confcache{$host}{\*(AqName\*(Aq}{ifName}{oid} = (ifName or \*(AqDup\*(Aq)
|
|
Packit |
667938 |
\& $confcache{$host}{\*(AqType\*(Aq}{ifType}{oid} = (ifType or \*(AqDup\*(Aq)
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
The value (at the right side of =) is 'Dup' if a value was retrieved
|
|
Packit |
667938 |
muliple times, the retrieved value else.
|
|
Packit |
667938 |
.ie n .IP """readconfcache""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWreadconfcache\fR" 4
|
|
Packit |
667938 |
.IX Item "readconfcache"
|
|
Packit |
667938 |
\&\f(CW\*(C`my $confcache = readconfcache($file)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Preload the confcache from a file.
|
|
Packit |
667938 |
.ie n .IP """readfromconfcache""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWreadfromconfcache\fR" 4
|
|
Packit |
667938 |
.IX Item "readfromconfcache"
|
|
Packit |
667938 |
\&\f(CW\*(C`writeconfcache($confcache,$file)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Store the current confcache into a file.
|
|
Packit |
667938 |
.ie n .IP """writeconfcache""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWwriteconfcache\fR" 4
|
|
Packit |
667938 |
.IX Item "writeconfcache"
|
|
Packit |
667938 |
\&\f(CW\*(C`writeconfcache($confcache,$file)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Store the current confcache into a file.
|
|
Packit |
667938 |
.ie n .IP """storeincache""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWstoreincache\fR" 4
|
|
Packit |
667938 |
.IX Item "storeincache"
|
|
Packit |
667938 |
\&\f(CW\*(C`storeincache($confcache,$host,$method,$key,$value)\*(C'\fR
|
|
Packit |
667938 |
.ie n .IP """readfromcache""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWreadfromcache\fR" 4
|
|
Packit |
667938 |
.IX Item "readfromcache"
|
|
Packit |
667938 |
\&\f(CW\*(C`readfromcache($confcache,$host,$method,$key)\*(C'\fR
|
|
Packit |
667938 |
.ie n .IP """clearfromcache""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWclearfromcache\fR" 4
|
|
Packit |
667938 |
.IX Item "clearfromcache"
|
|
Packit |
667938 |
\&\f(CW\*(C`clearfromcache($confcache,$host)\*(C'\fR
|
|
Packit |
667938 |
.ie n .IP """debug""" 4
|
|
Packit |
667938 |
.el .IP "\f(CWdebug\fR" 4
|
|
Packit |
667938 |
.IX Item "debug"
|
|
Packit |
667938 |
\&\f(CW\*(C`debug($type, $message)\*(C'\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Prints the \fImessage\fR on \s-1STDERR\s0 if debugging is enabled for type \fItype\fR.
|
|
Packit |
667938 |
A debug type is enabled if \fItype\fR is in array \f(CW@main::DEBUG\fR.
|
|
Packit |
667938 |
.SH "AUTHORS"
|
|
Packit |
667938 |
.IX Header "AUTHORS"
|
|
Packit |
667938 |
Rainer Bawidamann <Rainer.Bawidamann@rz.uni\-ulm.de>
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
(This Manpage)
|