[mrtg] MRTG Not updating after upgrade

Noob Centos Admin centos.admin at gmail.com
Sun Jul 12 16:14:13 CEST 2009


Hi,

> 1. it is pretty simple to work with. you just have to set up a mrtg.cfg file
> and it should work fine even when you have a very minimal configuration.
> 2. permissions are something that may botter you if there's even one file
> that the daemon can't read/write/execute, but it should be easy to fix when
> you have access to log files.
> 3. try setting up the options for a log directory. add the following line to
> your conf file if you don't have one like that yet:
> Logdir: /etc/mrtg/logs
> make sure the path exists and has the proper permissions.
> 4. make sure that mrtg is being ran under root user and group. if you change
> mrtg's user and group you will have to change all those permissions again.
> 5. use -R with chmod when you change permissions of directories with files
> on it, so it will apply for everything, not only the main directory your
> working with. e.g.: chmod -R 777 /etc/mrtg /var/html/www/mrtg/
> 6. backup all your data from /var/html/www/mrtg/ and delete it from there
> and try to run mrtg as it was it's first time being ran.

I mv away the existing mrtg directory in my /var/html/www directory,
then used cfgmaker public at localhost to create a most minimal cfg file,
adding only the Workdir and Logdir. Basically apart from comment
lines, there appears only to be 3 effective lines, e.g. workdir,
logdir and EnableIPv6: no

The mrtg binary files and the output directories are all under root
currently, permissions on everything in the output folder to 777 to
eliminate any potential permissions problem.

Running from command line, the same thing happens. MRTG recreates the
missing MRTG header pictures in the workdir, including the zero byte
mrtg.ok (is this supposed to be zero byte?). However, no log files are
created in the log folder.

Logging is done, I had tail -f on the file and updates accordingly
with no error message whatsoever.

<pre>
2009-07-12 21:59:53 -- Started mrtg with config
'/var/www/html/mrtg/core/mrtg.cfg'
2009-07-12 21:59:53 -- --base: Creating Lockfiles
/var/www/html/mrtg/core/mrtg.cfg_l,/var/www/html/mrtg/core/mrtg.cfg_l_21308
2009-07-12 21:59:53 -- --base: Reading Config File:
/var/www/html/mrtg/core/mrtg.cfg
2009-07-12 21:59:53 -- --base: Reading Interface Config cache
2009-07-12 21:59:53 -- --base: Checking Config File
2009-07-12 21:59:53 -- --base: Loading default Locale
2009-07-12 21:59:53 -- --base: Starting main Loop
2009-07-12 21:59:53 -- --base: Populate Target object by polling SNMP
and external Datasources
2009-07-12 21:59:53 -- --base: Exit main Loop
2009-07-12 21:59:53 -- --base: Remove Lock Files
2009-07-12 21:59:53 -- --base: Store Interface Config Cache
</pre>

I tried add an example from
http://net-snmp.sourceforge.net/wiki/index.php/TUT:MRTG  where it uses
more advanced MRTG commands with SNMP to monitor CPU usage. This had
the effect of MRTG logging SNMP errors, specifically, the log file now
show actual attempt to get data from SNMP.

So this makes me wonder if the default setup wasn't working and MRTG
was not even polling for data due to some unknown problem. Is there
some way to make MRTG tell what data it is seeing or is it getting any
data when trying to get the default data like load and network
traffic?



More information about the mrtg mailing list