Error Writing /var/lib/mrtg/mrtg.ok.ok
comments Sep 102006 Sponsored Link This article is focusing installing and configure MRTG with CPU,Memory and Disk Usage Graphs examples for Debian Ubuntu and Kubuntu Users and may be work for some debian based distributions. MRTG is Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network links. MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic. MRTG Requirements Apache webserver with perl support NET-SNMP GD Libpng zlib If you want to download MRTG you can download from here Preparing you System for MRTG Instalaltion First you need to install the required compilers #apt-get install gcc make g++ Apache 2 Installation with perl support Follow these instructions to install apache2 with perl support MRTG Installation Now we need to install mrtg and snmp Installing MRTG in Debian, Ubuntu and Kubuntu #apt-get install mrtg snmpd The installation will create an mrtg subdirectory where the Apache Web pages reside. On your Debian,ubnutu,kubuntu systems the path of this subdirectory is: /var/www/mrtg Now you need to edit the mrtg configuration file to edit the some of the settings File is located at /etc/mrtg.cfg you need to change the global settings as follows # Global Settings RunAsDaemon: yes EnableIPv6: no WorkDir: /var/www/mrtg Options[_]: bits,growright WriteExpires: Yes Title[^]: Traffic Analysis for You will find a crontab running every 5 minutes as user root # cat /etc/cron.d/mrtg 0-55/5 * * * * root if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; then env LANG=C /usr/bin/mrtg /etc/mrtg.cfg >> /var/log/mrtg/mrtg.log 2>&1; fi Now we need to assign the snmp community name in snmp configration file /etc/snmp/snmpd.conf # sec.name source community # com2sec paranoid default public com2sec r
2009 by iceflatline (20150902) - The steps and script in this post were amended to removing logging -- iceflatline This post will describe how to install and configure Tobi Oetiker's MRTG (Multi Router Traffic Grapher) on your Ubuntu server. All steps assume that the Apache http server is installed and operating correctly. Once configured, you'll be able to use MRTG to monitor the traffic in and out of your network using the SNMP capability in your network's gateway\router. MRTG generates static HTML pages containing PNG images which provide a visual representation of this traffic. MRTG typically produces daily, weekly, monthly, and yearly graphs. MRTG is written in perl and works on Unix/Linux as well as Windows. MRTG is free http://www.debianadmin.com/mrtg-installation-and-configuration-in-debian-based-distributions-2.html software licensed under the GNU GPL. Software versions used in this post were as follows: Ubuntu Server v14.04 x64 LTS) mrtg_2.17.4-2ubuntu2_amd64 So, let's get started. Download and Install First, update your package list: sudo apt-get update 1 sudo apt-get update Then download and install MRTG: sudo apt-get install mrtg 1 sudo apt-get install mrtg If this is the first time installing MRTG on your server you'll likely be presented with the following message (See Figure 1). Answering https://www.iceflatline.com/2009/08/how-to-install-and-configure-mrtg-on-ubuntu-server/ "Yes" means that the MRTG configuration file will not be readable by others (file permissions set to 640). Answering "No" means that the file is readable by others (file permissions set to 644). In this example we're going to accept the default Yes. Figure 1 MRTG installs a sample configuration file /etc/mrtg.cfg used to hold the SNMP information obtained from your gateway\router. For a full listing of what MRTG installs and where, run the locate command: sudo updatedb && locate mrtg 1 sudo updatedb && locate mrtg Technically speaking, mrtg.cfg could remain in /etc, but just to keep things tidy let's create a directory for it and move it into that directory: sudo mkdir /etc/mrtg && sudo mv /etc/mrtg.cfg /etc/mrtg 1 sudo mkdir /etc/mrtg && sudo mv /etc/mrtg.cfg /etc/mrtg That's it for installing MRTG. Now let's move on and configure it. Configure MRTG includes a script called cfgmaker that will help us populate /etc/mrtg/mrtg.cfg with the information obtained from your gateway\router. But before you run cfgmaker, you should setup the SNMP service in your gateway\router. This usually involves logging into your gateway\router and enabling SNMP. The default SNMP community name is typically "public." If you change the SNMP community name to something else, make note of it. Now, run the following command, substituting your SNMP community name, if you've changed it, and adding the IP address of y
Party Docs Support Github Project Sponsors Cast Gold Sponsors Silver Sponsors ... oss.oetiker.ch Web The MRTG 2.17.4 Linux/Unix Installation Guide DESCRIPTION MRTG comes to http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html you in Source Code. This means that you have to compile http://www.cyberciti.biz/faq/centos-fedora-linux-multi-router-traffic-grapher-tutorial/ parts of it before you can use it on a Unix machine. These instructions help you to do so. PREPARATION In order to compile and use mrtg you need a C compiler and a copy of perl installed on your machine. In most cases this will error writing already be available. In case it is not, here are some starting points. Below I'll give you a detailed run through the whole compilation process. GCC The GNU C compiler comes preinstalled on most of the free Unicies out there. For commercial derivatives you may have to download and compile it first. If you have no compiler at error writing /var/lib/mrtg/mrtg.ok.ok all there is a chicken and egg problem, but there are also precompiled versions of gcc available for most operating systems. http://gcc.gnu.org/ Perl Large parts of the MRTG system are written in the Perl scripting language. Make sure there is a recent copy of perl on your machine (try perl -v). At least version 5.005 is required for mrtg to work well. If you use SNMPV3 and other new features you should use at least 5.8. You can get the latest perl from http://www.perl.com/ MRTG generates traffic graphs in the PNG format. To be able to do this it needs several 3rd party libraries. When compiling these libraries I urge you to make sure you compile them as static libraries. There is just much less trouble ahead if you are doing it like this. See the Instructions in the next section for inspiration. Note that many free unices have all the required libraries already in place so there is no need to install another copy. To check it is best to
Networking, Package Management, RedHat and Friends, Security, Troubleshooting, UNIXHow do I install and configure MRTG under Fedora Linux or CentOS Linux v5.x server to monitor the traffic load on network-links including routers? The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic. You need the following packages:
mrtg : Multi Router Traffic Graphernet-snmp and net-snmp-utils : SNMP (Simple Network Management Protocol) is a protocol used for network management. The NET-SNMP project includes various SNMP tools. net-snmp package contains the snmpd and snmptrapd daemons, documentation, etc. You also want to install the net-snmp-utils package, which contains NET-SNMP utilities.This FAQ works with RHEL / CentOS and Fedora Linux.Step # 1: Install MRTGType the following command to install packages using yum command under CentOS / Fedora Linux: # yum install mrtg net-snmp net-snmp-utilsStep # 2: Configure snmpdIf you need to monitor localhost including interface and other stuff such as CPU, memory etc, configure snmpd. Open /etc/snmp/snmpd.conf, enter: # vi /etc/snmp/snmpd.conf Update it as follows to only allow access from localhost:com2sec local localhost public group MyRWGroup v1 local group MyRWGroup v2c local group MyRWGroup usm local view all included .1 80 access MyRWGroup "" any noauth exact all all none syslocation VSNL, India syscontact Root# service snmpd restart Make sure you see interface IP, by running the following command: # snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex Sample Outputs:IP-MIB::ipAdEntIfIndex.123.xx.yy.zzz = INTEGER: 2 IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1Step # 3: Configure MRTGUse cfgmaker command to creates /etc/mrtg/mrtg.cfg file, enter: # cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@localhost-global ‘WorkDir: /var/www/mrtg' : add global config entries i.e. set workdir to store MRTG gr