how to enable MRTG in nagios

i have configured nagios,  i want to view mrtg graph for bandwidth utilization, but  bandwidth graph is not showing. here is the config which i have done and

########################################################################

###############################################################################
# SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
#
# Last Modified: 10-03-2007
#
# NOTES: This config file assumes that you are using the sample configuration
#        files that get installed with the Nagios quickstart guide.
#
###############################################################################




###############################################################################
###############################################################################
#
# HOST DEFINITIONS
#
###############################################################################
###############################################################################

# Define the switch that we'll be monitoring

define host{
        use             generic-switch          ; Inherit default values from a template
        host_name       54-NSEZ-VERIZON-MPLS            ; The name we're giving to this switch
        alias           54-NSEZ-verizon-mpls    ; A longer name associated with the switch
        address         1.1.1.1          ; IP address of the switch
        hostgroups      switches                ; Host groups this switch is associated with
        }




###############################################################################
###############################################################################
#
# HOST GROUP DEFINITIONS
#
###############################################################################
###############################################################################

# Create a new hostgroup for switches
#define hostgroup{
#       hostgroup_name  switches                ; The name of the hostgroup
#       alias           Network Switches        ; Long name of the group
#       }




###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################

# Create a service to PING to switch

define service{
        use                     generic-service ; Inherit values from a template
        host_name               54-NSEZ-VERIZON-MPLS    ; The name of the host the service is associated with
        service_description     PING            ; The service description
        check_command           check_ping!200.0,20%!600.0,60%  ; The command used to monitor the service
        normal_check_interval   5               ; Check the service every 5 minutes under normal conditions
        retry_check_interval    1               ; Re-check the service every minute until its final/hard state is determined
        }


# Monitor uptime via SNMP

define service{
        use                     generic-service ; Inherit values from a template
        host_name               54-NSEZ-VERIZON-MPLS
        service_description     Uptime
        check_command           check_snmp!-C public -o sysUpTime.0
        }



# Monitor Port 1 status via SNMP
define service{
        use                     generic-service ; Inherit values from a template
        host_name               54-NSEZ-VERIZON-MPLS
        service_description     Port 1 Link Status
        check_command           check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
        }



# Monitor bandwidth via MRTG logs

define service{
        use                     generic-service ; Inherit values from a template
        host_name               54-NSEZ-VERIZON-MPLS
        service_description     Port 1 Bandwidth Usage
        check_command           check_local_mrtgtraf!/var/lib/mrtg/1.1.1.1_1.log!AVG!1000000,1000000!5000000,5000000!10
        }

#######################################################################


mrtg.JPG
pawanopensourceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gaurav SinghHead - Managed ServicesCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pawanopensourceAuthor Commented:
thx for the link, can u please guide me which pluggins i have to install.
Sanga CollinsSystems AdminCommented:
I find pnp4nagios is the easiest way to generate bandwidth graphs as well as other grpahs in nagios

http://www.docs.pnp4nagios.org/start
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

pawanopensourceAuthor Commented:
friend can u plz help me dxb.pawan at the rate gmail dot com
wesly_chenCommented:
1. You need to install and configure MRTG first.
Please check this guide for the setup and configuration
http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html

2. The integrate Nagios with MRTG
You can use Nagiostats utility, which comes with Nagios standard installation.
  Here is the guide (check the "MRTG integration" section)
  http://nagios.manubulon.com/traduction/docs25en/nagiostats.html
Or use some other tool like serverscheck (You need to configure your network device to send out SNMP trap)
http://www.serverscheck.com/sensors/mrtg.asp
pawanopensourceAuthor Commented:
thx wesly for guiding me through steps. i am trying to configure mrtg from the given link

http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html

when i am running mrtg by this command /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg its giving error

[root@xav-ind-lap-48 ~]# /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
-----------------------------------------------------------------------
ERROR: Mrtg will most likely not work properly when the environment
       variable LANG is set to UTF-8. Please run mrtg in an environment
       where this is not the case. Try the following command to start:

       env LANG=C /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
-----------------------------------------------------------------------
wesly_chenCommented:
echo "export LANG=en_US" >> /root/.bashrc
. /root/.bashrc
/usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
pawanopensourceAuthor Commented:
friend this is the output which i am getting when giving those three commands

[root@xav-ind-lap-48 src]# echo "export LANG=en_US" >> /root/.bashrc
[root@xav-ind-lap-48 src]#


[root@xav-ind-lap-48 src]#  /root/.bashrc
-bash: /root/.bashrc: Permission denied



[root@xav-ind-lap-48 src]# /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
-----------------------------------------------------------------------
ERROR: Mrtg will most likely not work properly when the environment
       variable LANG is set to UTF-8. Please run mrtg in an environment
       where this is not the case. Try the following command to start:

       env LANG=C /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
-----------------------------------------------------------------------
wesly_chenCommented:
. /root/.bashrc
you missing the "." and blank space.
pawanopensourceAuthor Commented:
thx for your continuous support, here is the output for the command

[root@xav-ind-lap-48 src]# . /root/.bashrc
[root@xav-ind-lap-48 src]#
wesly_chenCommented:
then this should be ok.
/usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
pawanopensourceAuthor Commented:
[root@xav-ind-lap-48 src]# /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
2011-05-25 10:43:36: ERROR: Creating templock /home/mrtg/cfg/mrtg.cfg_l_16067: No such file or directory at /usr/local/mrtg-2/bin/mrtg line 1968.
wesly_chenCommented:
Which Linux distribution do you have? Fedora 14/RedHat 5x/CentOS 5.x, Ubuntu 10.x or Debian?
There are a lot of requirement for MRTG to install. So install from the Linux distribution repository might be easier for you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.