• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1906
  • Last Modified:

Configuring MGRT for multiple devices

I am attempting to configure MGRT on Ubuntu 10.04 Linux.  I have been able to get a single device going but I am missing something in the conversion to multiple devices.  
0
Sparboe
Asked:
Sparboe
  • 5
  • 3
  • 2
  • +1
3 Solutions
 
gheistCommented:
you add them one by one
0
 
arnoldCommented:
An alternative and possibly a better solution is to use cacti from cacti.net
Has templates for various devices/applications.
0
 
SparboeAuthor Commented:
"Arnold:   An alternative and possibly a better solution is to use cacti from cacti.net
Has templates for various devices/applications.
"

Thank you for the tip Arnold. The main reason i am using MRTG is for my Nogios installation for bandwidth monitoring.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
TobiasHolmCommented:
Hi!

Found this: "You need to generate file and append it to main config file. Create config for server1, server2 and router1:        Code:
cfgmaker --global 'WorkDir: /var/www/mrtg' --output /tmp/server1.cfg  public@server1.example.com
cfgmaker --global 'WorkDir: /var/www/mrtg' --output /tmp/server2.cfg  public@server2.example.comcfgmaker --global 'WorkDir: /var/www/mrtg' --output /tmp/router1.cfg  public@router1.example.com
You may wanna manually edit or review file before updating the main mrtg.cfg file. Use vi text editor to view all files:
       Code:
vi /tmp/server{1,2}.cfg
Next, ipdate main config file by updating all /tmp/*.cfg config file:

Code:
cat /tmp/server{1,2}.cfg /tmp/router1.cfg >> /etc/mrtg/mrtg.cfg
Just create graphs for all devices:
       Code:
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
"
Ref: http://nixcraft.com/centos-rhel-fedora/13830-mrtg-multiple-devices.html

Regards, Tobias
0
 
SparboeAuthor Commented:
"gheist: you add them one by one"

How do you add them one at a time?

When i do

cfgmaker --global "WorkDir: /var/www/mrtg" \
--global "EnableIPv6: no" \
--global "RunAsDaemon: yes" \
--global "Options[_]: bits,growright" \
monitor@10.10.0.100 > /etc/mrtg/mrtg.cfg

it over writes everything in the file....

I did see one article that suggested using

cfgmaker --global "WorkDir: /var/www/mrtg" \
--global "EnableIPv6: no" \
--global "RunAsDaemon: yes" \
--global "Options[_]: bits,growright" \
monitor@10.10.0.100 \
monitor@10.10.0.101 \
monitor@10.10.0.1 \
monitor@10.100.0.1 \
monitor@10.30.0.1 \
monitor@10.50.0.1 \
monitor@10.200.0.1 \
monitor@10.60.0.1 \
monitor@10.70.0.1 \
monitor@10.40.0.1\
monitor@10.45.0.1\
monitor@10.20.0.1\
monitor@localhost > /etc/mrtg/mrtg.cfg

the .cfg file seems to have all the information in it.
then running indexmaker

indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html

the webpage contains all the devices however when u click on them they do not link to anywere
the device specific html, log, png are not created.
0
 
arnoldCommented:
instead of > (insert anew)  you use >> (append)

Do you have a cron job that runs mrtg -c /etc/mrtg/mrtg.cfg ?

Performance wise you would be better off using rrdtool to process the data into data files and then the images will only be generated when accessed.

You are also not including what you are monitoring.
 
You need the OID or the logs/scripts from which data points will be provided to mrtg when it runs.

http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Server_Performance#OIDs_And_MIBs
0
 
SparboeAuthor Commented:
After following TobiasHolm suggestion I was able to see the webpage with all the graphs - waiting to see if the graphs fill in.

arnold, it looks like your solution would get the same result. I am not sure how to check cron however the other day i retyped in a command to schedual mgrt and it seemed like it was already there.  What would u change in the configuration for rrdtool
0
 
SparboeAuthor Commented:
"arnold:

Do you have a cron job that runs mrtg -c /etc/mrtg/mrtg.cfg ?"

it seems that the graphs are not updating. this leads me back to your question about cron running..  what commands do you use to verify config? what commands would i use to configure cron to update the mrgt graphs / logs

0
 
arnoldCommented:
The way the data is stored.
http://oss.oetiker.ch/mrtg/doc/mrtg-rrd.en.html

Have a look at cacti.net.  It has templates.
That you can configure the device i.e. provide the type of device, the IP/snmp settings and it will build the polling.  Then you can create the graphs.

It uses RRdtool which means the images are generated only when accessed.
0
 
TobiasHolmCommented:
>I am not sure how to check cron

You can use 'crontab -l' to list cron jobs and you can use 'crontab -e' to edit the cron jobs. This is for the current user. Use sudo to list/edit for root user.

Regards, Tobias
0
 
SparboeAuthor Commented:
I added
 
RunAsDaemon: Yes
interval: 5

to /etc/mrtg/mrtg.cfg

then this in the terminal

env LANG=C /user/bin/mrtg /etc/mrtg/mrtg.cfg

that loaded MRTG as a daemon and has ben populating the graphs

now to award some points and get nagios pointed at the logs.......
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now