Configure MRTG to get IPv4 usage statistics

Posted on 2011-02-19
Last Modified: 2012-05-11
Hello Experts.

I installed MTRG, but I need to configure it to collect statistics to be sent to RIPE, as shown in this example: 

The statistics should show the following:

•the IP capacity for each area/pool of IPs
•the IP usage for each area/pool of IPs (min/avg/max on a daily/weekly/monthly basis)

I have some subnet of IP addresses and to build the statistics, it is assumed that an IP address is used when responding to ping (echo-replay).

I think we can use nmap, changing the script in this example:

you can help me to edit the script?

Question by:usbano
  • 2
LVL 27

Accepted Solution

Nopius earned 500 total points
ID: 34942740

> I have some subnet of IP addresses and to build the statistics, it is assumed that an IP address is used when responding to ping (echo-replay).

Is it assumed by you or by RIPE?
I would suggest another definition is "IP if it reponds to TCP/UDP requests on any port, or it responds to ping or it initiates connections on any TCP/UDP port".

Most firewalled Windows just never respond to ping.

Modified script, that shows exact IP count (not %) is below. It is also faster.



nrup=`nmap -n --min-parallelism 150 --max-retries 1 --host-timeout 1501 -sP $nets 2>&- | grep "hosts up" | cut -d\( -f2 | cut -d" " -f1`

echo $nrup
echo 0

Open in new window


Author Comment

ID: 34972211

the script works!! I' put the script in, ad get this with mrtg.cfg

Target[xyz]:  `/opt/mrtg/`
MaxBytes[xyz]: 2000
Unscaled[xyz]: dwmy
Options[xyz]: growright,gauge,noinfo,nopercent
ShortLegend[xyz]: IP USAGE
Title[xyz]: % IP usage

In attachment a screenshoot of the statistics (daily).
Is possible to change "byte per seconds"  with "IP address" link this like: 



Author Comment

ID: 34974541
I'm resolved. The command is YLegend[xyz]: IP Address


Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SonicWall Max Connection Setting 7 44
SharePoint 2013 Link to File on Network Drive Not Working 3 93
Switch port problems 15 33
Understanding ping command in Ubuntu 5 33
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

726 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