[mrtg] ERROR: "WorkDir" not specified in mrtg config file - solved

kutasheax rmabeza at gmail.com
Sat May 7 11:49:34 CEST 2011

I got the problem sorted out while i was reading documentation on this site
regarding indexmaker and cfgmaker.

Here's what i did based following the sample presented on this site.

Using cfgmaker, i need to recreate my previous commands based on example 

cfgmaker --global "WorkDir: /var/www/mrtg"           \
          --global "Options[_]: growright,bits"    \
          --ifref=ip                               \
          snmpo at localhost > /etc/mrtg/mrtg9.cfg

after this do this:
 env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg9.cfg

If error appear after executing this command - repeat it again as env LANG=C
is correcting the utf files inside the .cfg files. I made 3 times doing this
and after that mrtg9.cfg went fine.

upon reading the indexmaker options on the documentation, i found additional
options being missed out. So here it is.

[root at kuto3 ~]# indexmaker  --output=/var/www/mrtg/index.html
/etc/mrtg/mrtg.cfg  /etc/mrtg/mrtg9.cfg
[root at kuto3 ~]# 


Restart httpd daemon
[root at kuto3 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root at kuto3 ~]# service snmpd restart
Stopping snmpd:                                            [  OK  ]
Starting snmpd:                                            [  OK  ]
[root at kuto3 ~]#

lastt hing to do is edit  /etc/cron.d/mrtg

add this line:

 */5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
--lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok

It will update your index.html every 5 minutes.

then check your mrtg index.html

mine is in http://localhost/mrtg


View this message in context: http://mrtg-mailinglists.795376.n2.nabble.com/ERROR-WorkDir-not-specified-in-mrtg-config-file-tp6337483p6339831.html
Sent from the MRTG Users Mailinglist mailing list archive at Nabble.com.

More information about the mrtg mailing list