About Us Tutorials User Articles Files Chad's Blog LIVE! T-Shirts! Glad you could stop by the Linux Basement site. Linux Basement is an informational Podcast about Linux, open source software and lots of other wonderful technology. If you want to find out more about open source technologies, subscribe and have a listen! #linuxbasement is up at irc.freenode.net MP3 Feed Ogg Vorbis Feed MP3 Feed (all episodes) Ogg Feed (all episodes) Video blog (not the show!) The Latest Episodes LB - Episode 70 - Google+ or Minus LB - Episode 69 - Not Dead Yet by Linux Basement LB - Episode 68.5 - Special Bonus Pre-Show Q&A from Ep. 68 more The Latest Tutorials MRTG on Ubuntu Server Drupal 6 Dynamic Content - CCK, Views, and Panels Apache2 Virtual Hosts more Home MRTG on Ubuntu Server Submitted by chad on Tue, 11/11/2008 - 20:12. Lets start by installing the goods. Then we will get into the meat of things. apt-get install snmpd mrtg apache2 When installing MRTG it will ask if you want to only make /etc/mrtg.cfg readable by the MRTG user. In my case, this will be an internal server only, and I do not need to worry about security, so I am going to select NO. If you choose YES, the steps in this tutorial may not work. I have not tested this. However, keep in mind if security is a concern, you may want to go this route and keep MRTG contained in a non-root user environment. Assuming that you want to monitor your networking equipment with MRTG, you need to set up the snmp community on the piece of equipment. Usually its just a matter of enabling snmp, and the default community will be public. If you change the default community to another name, make sure you remember the name for later. Now lets set up MRTG to read the data. With Ubuntu server, MRTG will automatically set up /var/www/mrtg. In other distrobutions, it will set it up in a different area, so you will need to change the 'WorkDir:' variable in the following scenario to the directory where MRTG is installed. I'm going to create an /etc/mrtg directory rather then move the mrtg.cfg file within /etc/ This will make it less confusing in the future. mkdir /etc/mrtg mv /etc/mrtg.cfg /etc/mrtg/ Now we run the cfgmaker command to get things up and running: cfgmaker --global 'WorkDir:/var/www/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/mrtg.cfg public@<yourrouterip> We need to make sure the following lines are correct in /etc/mrtg/mrtg.cfg If they are not there, add them. EnableIPv6: no RunAsDaemon: Yes Interval: 5 Logdir: /var/log/mrtg Now run: indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg Which will build the index so you can view the output. Then I run this command to set an environmental variable env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg and open http://localhost/mrtg/index.html You should now see an output graph. crontab -e 0,5,10,15,20,25,30,35,40,45,50,55 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --logging /var/log/mrtg.log Let cron pick up stats for an hour or so. After a while, you will see that your graphs are picking up data about your bandwidth. Here is mine with several cisco 2811 routers configured to show bandwidth. SNMP and MRTG can monitor much more then bandwidth. For instance you can monitor disk usage, processing use, and more on your servers. There is plenty of documenation on the subject, which leans towards going in and adding snmpd to the servers you want to monitor, setting it up, and then going back and executing the cfgmaker and indexmaker command again so that the new hardware will show up on the page. Because the output of these files is an html page, you can also skin the page and make it look nicer, or embed it into your favorite CMS. I encourage you to play around with MRTG, because it is the foundation program for a lot of software suites that monitor traffic. One of those, we will talk about next time. Until then, keep hackin. I used the following articles and papers to create this tutorial: http://ubuntuforums.org/ showthread.php?t=751309 Support This Site Latest User Articles Their own private stunning wedding gown Author Minikitty VirtualHost on Ubuntu 10.04 Author enald Try OpenBSD Author yoyoned more User login Username: Password: Create new account Request new password Friends of Linux Basement Going Linux Podcast Linux Reality Podcast Lotta Linux Links TLLTS Monsterb.org HPR Linux Cranks Linux Outlaws Linux Trivia Linux in the Ham Shack Terminal Geeks Archive November, 2011 (1) August, 2011 (2) May, 2011 (2) March, 2011 (5) February, 2011 (4) more The Latest videos Bad Video of Morning Keynote SELF lobby? Or is it? Cause I'm Free more Site designed using RoopleTheme . Please visit and support these sites. This work is licensed under a Creative Commons Attribution 3.0 Unported License
MRTG on Ubuntu Server | Linux Basement
Материал перенесён из старой базы знаний ATC-IP и оформлен в едином стиле нового сайта.