Solved

Configuring MGRT for multiple devices

Posted on 2010-08-31
11
1,197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 62

Expert Comment

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

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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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
 
LVL 78

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 78

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

695 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