Discussion:
ERROR: "WorkDir" not specified in mrtg config file
(too old to reply)
kutasheax
2011-05-06 12:48:29 UTC
Permalink
Raw Message
Hi all,

I am having problem installing mrtg on RHEL6

The commands I followed are the following:

/usr/bin/cfgmaker --output=/etc/mrtg/mrtg.cfg --global "WorkDir:
/var/www/mrtg" --global "options[_]: growright,bits" ***@192.168.0.197

it creates the mrtg.cfg with the following info:

# Created by
# /usr/bin/cfgmaker --output=/etc/mrtg/mrtg.cfg --global "WorkDir:
/var/www/mrtg" --global "options[_]: growright,bits" ***@192.168.0.197


### Global Config Options

# for UNIX
# WorkDir: /home/http/mrtg

# or for NT
# WorkDir: c:\mrtgdata

### Global Defaults

# to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits

EnableIPv6: no
WorkDir: /var/www/mrtg
options[_]: growright,bits

######################################################################

then:
[***@kuto3 ~]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

And then:
[***@kuto3 ~]# indexmaker /var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
ERROR: unable to open config file: /var/www/mrtg/index.html
[***@kuto3 ~]# touch /var/www/mrtg/index.html
[***@kuto3 ~]# chmod 777 /var/www/mrtg/index.html

This is where the problem start when i populate /var/www/mrtg

[***@kuto3 ~]# indexmaker /var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
Use of uninitialized value $first in pattern match (m//) at
/usr/bin/../lib/mrtg2/MRTG_lib.pm line 611.
ERROR: "WorkDir" not specified in mrtg config file

I dont know where the problem is coming from as my directives are found in
my mrtg.cfg

[***@kuto3 ~]# rpm -qa | grep -i mrtg
mrtg-libs-2.16.2-5.el6.i686
mrtg-2.16.2-5.el6.i686

[***@kuto3 ~]# rpm -qa | grep -i snmp
net-snmp-utils-5.5-27.el6.i686
net-snmp-libs-5.5-27.el6.i686
net-snmp-5.5-27.el6.i686
perl-SNMP_Session-1.12-4.el6.noarch
[***@kuto3 ~]#

I need help on solving problem =((

Thanks.


--
View this message in context: http://mrtg-mailinglists.795376.n2.nabble.com/ERROR-WorkDir-not-specified-in-mrtg-config-file-tp6337483p6337483.html
Sent from the MRTG Users Mailinglist mailing list archive at Nabble.com.
Eric Brander
2011-05-06 13:45:48 UTC
Permalink
Raw Message
In my experience you must put the "--output=" parameter last. It's been a
while though so I could be mistaken.
kutasheax
2011-05-07 09:49:34 UTC
Permalink
Raw Message
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 \
***@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.

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

Voila!!!

Restart httpd daemon
[***@kuto3 ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[***@kuto3 ~]# service snmpd restart
Stopping snmpd: [ OK ]
Starting snmpd: [ OK ]
[***@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

Done!!!




--
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.
Loading...