How to: Fix Mrtg error “Use of uninitialized value $first in hash element at /usr/bin/indexmaker line 353″

Posted on July 26, 2012
[1] Regenerate config (I backed up existing conf,192.168.1.105.conf.bak)

cfgmaker public@192.168.1.105 > /opt/mrtg/conf/hosts/192.168.1.105.conf
[2] edit config, uncomment Options[_] directive, WorkDir directive, and set WorkDir path

/opt/mrtg/conf/perhost/192.168.1.105.conf
WorkDir path
 
# Created by
# /usr/bin/cfgmaker public@192.168.1.105
 
 
### Global Config Options
 
#  for UNIX
WorkDir: /opt/mrtg/www/perhost/192.168.1.105
#  or for NT
# WorkDir: c:\mrtgdata
 
### Global Defaults
 
#  to get bits instead of bytes and graphs growing to the right
Options[_]: growright, bits
 
 
…snip…
[3] Generate index

indexmaker --sort=descr --section=descr --output=/opt/mrtg/www/hosts/192.168.1.105/index.html /opt/mrtg/conf/hosts/192.168.1.105.conf