Solved

Configuring MGRT for multiple devices

Posted on 2010-08-31
11
1,005 Views
Last Modified: 2013-12-16
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
Comment
Question by:Sparboe
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 61

Expert Comment

by:gheist
ID: 33575197
you add them one by one
0
 
LVL 76

Expert Comment

by:arnold
ID: 33575383
An alternative and possibly a better solution is to use cacti from cacti.net
Has templates for various devices/applications.
0
 

Author Comment

by:Sparboe
ID: 33576866
"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
 
LVL 18

Accepted Solution

by:
TobiasHolm earned 350 total points
ID: 33577230
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
 

Author Comment

by:Sparboe
ID: 33577495
"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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 76

Assisted Solution

by:arnold
arnold earned 150 total points
ID: 33579141
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
 

Author Comment

by:Sparboe
ID: 33580030
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
 

Author Comment

by:Sparboe
ID: 33580230
"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
 
LVL 76

Expert Comment

by:arnold
ID: 33581221
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
 
LVL 18

Assisted Solution

by:TobiasHolm
TobiasHolm earned 350 total points
ID: 33581589
>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
 

Author Comment

by:Sparboe
ID: 33590679
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now