MRTG help.

Hi,

I have SNMP and MRTG running on my FreeBSD 9.2 machine.

However, I am seeing an issue with the Cron entry to get the graphs running correctly.

The guide I used said to use this entry:

Code:
*/5     *       *       *       *       root    /usr/bin/env LANG=C /usr/local/bin/mrtg /path/to/mrtg.cfg --logging /var/log/mrtg.log

That fails for me. I get the following output back.

Code:
Can't locate MRTG_lib.pm in @INC (@INC contains: /usr/local/bin/../lib/mrtg2 /usr/local/bin
/usr/local/lib/perl5/5.14.2/BSDPAN /usr/local/lib/perl5/site_perl/5.14.2/mach
/usr/local/lib/perl5/site_perl/5.14.2 /usr/local/lib/perl5/5.14.2/mach
/usr/local/lib/perl5/5.14.2 .) at /usr/local/bin/mrtg line 89.
BEGIN failed--compilation aborted at /usr/local/bin/mrtg line 89.

Basically, I cannot run this command /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg from anywhere but the MRTG work directory located here:

root@yeaguy:/usr/ports/net-mgmt/mrtg/work/mrtg-2.17.4/lib/mrtg2 # /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg
root@yeaguy:/usr/ports/net-mgmt/mrtg/work/mrtg-2.17.4/lib/mrtg2 #


Error from home directory:

root@yeaguy:~ # /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg
Can't locate MRTG_lib.pm in @INC (@INC contains: /usr/local/bin/../lib/mrtg2 /usr/local/bin /usr/local/lib/perl5/5.14.2/BSDPAN /usr/local/lib/perl5/site_perl/5.14.2/mach /usr/local/lib/perl5/site_perl/5.14.2 /usr/local/lib/perl5/5.14.2/mach /usr/local/lib/perl5/5.14.2 .) at /usr/local/bin/mrtg line 89.
BEGIN failed--compilation aborted at /usr/local/bin/mrtg line 89.
root@yeaguy:~ #


line 89 of /usr/local/bin/mrtg is
Code:
use MRTG_lib "2.100016";

I tried to make some symbolic links but I'm still stuck. Can run the mrtg error free unless I'm in /usr/ports/net-mgmt/mrtg/work/mrtg-2.17.4/lib/mrtg2

Any help would be appreciated.
 
I may have figured it out. I just copied all the files from
Code:
/usr/ports/net-mgmt/mrtg/work/mrtg-2.17.4/lib/mrtg2
to
Code:
/usr/local/bin
and was able to manually run the mrtg command.

We'll see how crontab handles it.
 
manilaboy1vic said:
I may have figured it out. I just copied all the files from
Code:
/usr/ports/net-mgmt/mrtg/work/mrtg-2.17.4/lib/mrtg2
to
Code:
/usr/local/bin
and was able to manually run the mrtg command.
This sounds like you didn't do a make install after you built the MRTG port.
 
Back
Top