[mrtg] SNMP_Session error
Nick Price
np121 at hotmail.com
Thu Jan 12 23:24:08 CET 2017
I have got mrtg running as a daemon now.
I have different .cfg files.
one for each output directory with a line in my crontab for each .cfg file (# out at the moment)
How does this now work when I run mrtg as a daemon, I still need the output to go to different directories.
Do you get the daemon to call the different .cfg or is there a different way of doing it?
Nick
-----Original Message-----
From: Niall O'Reilly [mailto:niall.oreilly at ucd.ie]
Sent: Monday, January 09, 2017 13:09
To: Nick Price <np121 at hotmail.com>
Cc: mrtg at lists.oetiker.ch
Subject: Re: [mrtg] SNMP_Session error
On 8 Jan 2017, at 19:24, Nick Price wrote:
> I use 1 configuration file per user, and output to a folder only the
> user has access to
>
> Each config file can have 1 or more devices in it.
>
> I don't get how to run mrtg with multiple .cfg files
I'm guessing you have a single .cfg file with per-user "Include"
directives.
Is this the way you've set things up ?
With multiple instances of MRTG running, three things are crucial:
(a) identifying the proper .cfg file for each instance,
(b) ensuring that there is no overlap between the .cfg files, and
(c) ensuring that each instance of MRTG is allowed to run only once.
Having more than one instance of MRTG (whether running from cron or
in daemon mode) writing to your data archive (log or RRD files) will
make rubbish of the archive. I'ld suggest running any new configuration
on a test system or with an independent set of output folders so that
anything that goes wrong will not be apparent to your users.
Don't forget that any (residual) cron-based MRTG activity needs to be
taken into consideration when planning to avoid overlap.
Having more than one instance of MRTG poll the same device is probably
not a cause for concern during transition.
What my launcher script is intended to do is described by the
pseudo-code (for the 'start' operation) shown below.
for each configuration file found in the "standard place":
construct a corresponding name for a distinct PID file
start MRTG using this pair of configuration and PID files
Other operations ('status', 'stop') are implement in a similar way.
> I don't get the bit in the documentation about the S file in
> /etc/rc3.d how do I know what number after the S to use and do I
> need to place in all the rc*.d directories.
It used to be that chkconfig would do what's needed to get this right.
I'm not aware that this is different since the introduction of systemd.
There's usually a "loaded" comment in each launcher script which is
used by chkconfig.
> Having never done this before,
You'll need thorough testing.
> the only other thing I install is Nagios and it comes with an
> install-daemon.
Best regards,
Niall O'Reilly
More information about the mrtg
mailing list