SlideShare a Scribd company logo
1 of 5
Download to read offline
Revision: 2

                                                                  Date: 2010-12-20




                                    MRTG
                  Configuration in Nagios




                            ICT4RD-TANZANIA
                           Isafjordsgatan 39, Kista

              http://csd.xen.ssvl.kth.se/csdlive/content/buruca

Page 1 of 5
                          Buruca Team – Building Rural Africa
                             ICT 4 Rural Development
Document History


Revision Number   Revision Date                   Summary of             Author(s)
                                                   changes
2                 2010-12-20                 The document was        Narayanan
                                             modified                Anandpadmanabhan




Page 2 of 5
                               Buruca Team – Building Rural Africa
                                  ICT 4 Rural Development
Table of Contents
  1. Configuration of MRTG in Nagios……………………………………..……………….4
  2. Solution for errors..................................................................................................... 5




Page 3 of 5
                                           Buruca Team – Building Rural Africa
                                              ICT 4 Rural Development
1. The configuration of the Nagios for MRTG is done as follows

STEP1: Goto Services.cfg [1] and add the following documents for enabling MRTG
analysis
define service{
use generic-service      ; Inherit values from a template
host_name localhost
service_description Bandwidth Usage
check_command
check_local_mrtgtraf!/var/lib/mrtg/127.0.0.1_1.log!AVG!1000000,2000000!5000000,
5000000!10
      }
##ROUTER AT TTCL
define service{
use generic-service ; Inherit values from a template
host_name router-at-TTCL-eth0
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/196.43.72.33_6.log!AVG!
1000000,2000000!5000000,5000000!10
    }
##BUNDA
define service{
use generic-service ; Inherit values from a template
host_name router-at-bunda-eth1
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/196.43.72.34_1.log!AVG!
1000000,2000000!5000000,5000000!10
  }

define service{
use generic-service ; Inherit values from a template
host_name router-at-bunda-eth4
service_description Port 1 Bandwidth Usage
 check_command check_local_mrtgtraf!/var/lib/mrtg/172.16.96.1_2.log!AVG!
1000000,2000000!5000000,5000000!10
}
###NATA
define service{
use generic-service ; Inherit values from a template
host_name router-at-nata-eth1
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/172.16.96.7_3.log!AVG!
1000000,2000000!5000000,5000000!10
}
STEP2: Save the file.
STEP3: Restart Nagios.
Page 4 of 5
                              Buruca Team – Building Rural Africa
                                 ICT 4 Rural Development
2. Solution for errors
After the configuration of the MRTG plugin in Nagios and once we restarted
Nagios, we were repeatedly getting the error "check_mrtgtraf: Unable to open
MRTG log file". [1]

In the Commands.cfg file we had the configuration as
# 'check_local_mrtgtraf' command definition
define command{
       command_name check_local_mrtgtraf
       command_line      $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2 -w
$ARG3$,$ARG4$ -c $ARG5$,$ARG6$
       }

So there was no “LOGFILE” option defined in this file. This was the main cause for
the error. So to fix this we changed the commands.cfg file as below

# 'check_local_mrtgtraf' command definition
define command{
      command_name check_local_mrtgtraf
      command_line       $USER1$/check_mrtgtraf -F $LOGFILE$ -a $ARG1$ -w
$ARG3$,$ARG4$ -c $ARG5$,$ARG6$
      }

References
[1] http://nagios.sourceforge.net/docs/nagios-3.pdf




Page 5 of 5
                              Buruca Team – Building Rural Africa
                                 ICT 4 Rural Development

More Related Content

Viewers also liked

Computer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardwareComputer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardwareShripal Oswal
 
GTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesGTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesTOPS Technologies
 
Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...IT Tech
 
Plugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlowPlugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlowNetFlow Analyzer
 
Central management of network and call services
Central management of network and call servicesCentral management of network and call services
Central management of network and call servicesNazmul Hossain Rakib
 
How to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco RoutersHow to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco RoutersSolarWinds
 
Line cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switchesLine cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switchesIT Tech
 
Packet Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-logPacket Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-logRafat Khandaker
 

Viewers also liked (10)

Computer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardwareComputer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardware
 
Nagios nrpe
Nagios nrpeNagios nrpe
Nagios nrpe
 
GTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesGTU PHP Project Training Guidelines
GTU PHP Project Training Guidelines
 
Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...
 
Plugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlowPlugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlow
 
Central management of network and call services
Central management of network and call servicesCentral management of network and call services
Central management of network and call services
 
How to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco RoutersHow to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco Routers
 
Line cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switchesLine cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switches
 
Packet Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-logPacket Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-log
 
Netflow slides
Netflow slidesNetflow slides
Netflow slides
 

Similar to 5. mrtg in nagios1 0

Chittagong GSM_2G BM DT Report
Chittagong GSM_2G  BM DT Report  Chittagong GSM_2G  BM DT Report
Chittagong GSM_2G BM DT Report Hassan Imam
 
mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018정대 천
 
Sprint 131
Sprint 131Sprint 131
Sprint 131ManageIQ
 
Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...
Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...
Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...IJCSIS Research Publications
 
IPLOOK GGSN product information
IPLOOK GGSN product information IPLOOK GGSN product information
IPLOOK GGSN product information IPLOOK Networks
 
INOVA GIS Platform - TeleCAD-GIS & IGS (2018)
INOVA GIS Platform - TeleCAD-GIS & IGS (2018)INOVA GIS Platform - TeleCAD-GIS & IGS (2018)
INOVA GIS Platform - TeleCAD-GIS & IGS (2018)Maksim Sestic
 
FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...
FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...
FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...Vince Garr
 
Document nsn
Document nsnDocument nsn
Document nsnLm Tài
 
PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...
PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...
PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...Piccoli Green Technology Piccoli
 
Deploying with JRuby
Deploying with JRubyDeploying with JRuby
Deploying with JRubyJoe Kutner
 
25934 400 aal2 qo s optimization
25934 400 aal2 qo s optimization25934 400 aal2 qo s optimization
25934 400 aal2 qo s optimizationadelekejare
 
The 2nd half. Scaling to the next^2
The 2nd half. Scaling to the next^2The 2nd half. Scaling to the next^2
The 2nd half. Scaling to the next^2Haggai Philip Zagury
 
Configuration of Residential Network using Enhanced Interior Gateway Routing ...
Configuration of Residential Network using Enhanced Interior Gateway Routing ...Configuration of Residential Network using Enhanced Interior Gateway Routing ...
Configuration of Residential Network using Enhanced Interior Gateway Routing ...ijtsrd
 
50 gsm bss network ps kpi (download rate) optimization manual[1].doc
50 gsm bss network ps kpi (download rate) optimization manual[1].doc50 gsm bss network ps kpi (download rate) optimization manual[1].doc
50 gsm bss network ps kpi (download rate) optimization manual[1].doctharinduwije
 

Similar to 5. mrtg in nagios1 0 (20)

Chittagong GSM_2G BM DT Report
Chittagong GSM_2G  BM DT Report  Chittagong GSM_2G  BM DT Report
Chittagong GSM_2G BM DT Report
 
mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018
 
Sprint 131
Sprint 131Sprint 131
Sprint 131
 
Ir33 40 gprs
Ir33 40 gprsIr33 40 gprs
Ir33 40 gprs
 
Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...
Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...
Botnet Detection and Prevention in Software Defined Networks (SDN) using DNS ...
 
3 gpp tr 23.907v1.2.0
3 gpp tr 23.907v1.2.03 gpp tr 23.907v1.2.0
3 gpp tr 23.907v1.2.0
 
IPLOOK GGSN product information
IPLOOK GGSN product information IPLOOK GGSN product information
IPLOOK GGSN product information
 
INOVA GIS Platform - TeleCAD-GIS & IGS (2018)
INOVA GIS Platform - TeleCAD-GIS & IGS (2018)INOVA GIS Platform - TeleCAD-GIS & IGS (2018)
INOVA GIS Platform - TeleCAD-GIS & IGS (2018)
 
dc09ttp-2011-thesis
dc09ttp-2011-thesisdc09ttp-2011-thesis
dc09ttp-2011-thesis
 
FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...
FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...
FFM_–_Technical_Brief_–_Network_Solutions_for_Intelligence_Surveillance_and_R...
 
Franquia green sharing IOT Scooters devices
Franquia green sharing  IOT Scooters devicesFranquia green sharing  IOT Scooters devices
Franquia green sharing IOT Scooters devices
 
Document nsn
Document nsnDocument nsn
Document nsn
 
PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...
PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...
PICCOLI GREEN TECHNOLOGY , PICCOLI MOTORS , PGT GROUP, Franquia Piccoli Green...
 
Deploying with JRuby
Deploying with JRubyDeploying with JRuby
Deploying with JRuby
 
25934 400 aal2 qo s optimization
25934 400 aal2 qo s optimization25934 400 aal2 qo s optimization
25934 400 aal2 qo s optimization
 
3 g m gw
3 g m gw3 g m gw
3 g m gw
 
The 2nd half. Scaling to the next^2
The 2nd half. Scaling to the next^2The 2nd half. Scaling to the next^2
The 2nd half. Scaling to the next^2
 
Configuration of Residential Network using Enhanced Interior Gateway Routing ...
Configuration of Residential Network using Enhanced Interior Gateway Routing ...Configuration of Residential Network using Enhanced Interior Gateway Routing ...
Configuration of Residential Network using Enhanced Interior Gateway Routing ...
 
50 gsm bss network ps kpi (download rate) optimization manual[1].doc
50 gsm bss network ps kpi (download rate) optimization manual[1].doc50 gsm bss network ps kpi (download rate) optimization manual[1].doc
50 gsm bss network ps kpi (download rate) optimization manual[1].doc
 
Fulltext02
Fulltext02Fulltext02
Fulltext02
 

Recently uploaded

Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 

Recently uploaded (20)

Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 

5. mrtg in nagios1 0

  • 1. Revision: 2 Date: 2010-12-20 MRTG Configuration in Nagios ICT4RD-TANZANIA Isafjordsgatan 39, Kista http://csd.xen.ssvl.kth.se/csdlive/content/buruca Page 1 of 5 Buruca Team – Building Rural Africa ICT 4 Rural Development
  • 2. Document History Revision Number Revision Date Summary of Author(s) changes 2 2010-12-20 The document was Narayanan modified Anandpadmanabhan Page 2 of 5 Buruca Team – Building Rural Africa ICT 4 Rural Development
  • 3. Table of Contents 1. Configuration of MRTG in Nagios……………………………………..……………….4 2. Solution for errors..................................................................................................... 5 Page 3 of 5 Buruca Team – Building Rural Africa ICT 4 Rural Development
  • 4. 1. The configuration of the Nagios for MRTG is done as follows STEP1: Goto Services.cfg [1] and add the following documents for enabling MRTG analysis define service{ use generic-service ; Inherit values from a template host_name localhost service_description Bandwidth Usage check_command check_local_mrtgtraf!/var/lib/mrtg/127.0.0.1_1.log!AVG!1000000,2000000!5000000, 5000000!10 } ##ROUTER AT TTCL define service{ use generic-service ; Inherit values from a template host_name router-at-TTCL-eth0 service_description Port 1 Bandwidth Usage check_command check_local_mrtgtraf!/var/lib/mrtg/196.43.72.33_6.log!AVG! 1000000,2000000!5000000,5000000!10 } ##BUNDA define service{ use generic-service ; Inherit values from a template host_name router-at-bunda-eth1 service_description Port 1 Bandwidth Usage check_command check_local_mrtgtraf!/var/lib/mrtg/196.43.72.34_1.log!AVG! 1000000,2000000!5000000,5000000!10 } define service{ use generic-service ; Inherit values from a template host_name router-at-bunda-eth4 service_description Port 1 Bandwidth Usage check_command check_local_mrtgtraf!/var/lib/mrtg/172.16.96.1_2.log!AVG! 1000000,2000000!5000000,5000000!10 } ###NATA define service{ use generic-service ; Inherit values from a template host_name router-at-nata-eth1 service_description Port 1 Bandwidth Usage check_command check_local_mrtgtraf!/var/lib/mrtg/172.16.96.7_3.log!AVG! 1000000,2000000!5000000,5000000!10 } STEP2: Save the file. STEP3: Restart Nagios. Page 4 of 5 Buruca Team – Building Rural Africa ICT 4 Rural Development
  • 5. 2. Solution for errors After the configuration of the MRTG plugin in Nagios and once we restarted Nagios, we were repeatedly getting the error "check_mrtgtraf: Unable to open MRTG log file". [1] In the Commands.cfg file we had the configuration as # 'check_local_mrtgtraf' command definition define command{ command_name check_local_mrtgtraf command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2 -w $ARG3$,$ARG4$ -c $ARG5$,$ARG6$ } So there was no “LOGFILE” option defined in this file. This was the main cause for the error. So to fix this we changed the commands.cfg file as below # 'check_local_mrtgtraf' command definition define command{ command_name check_local_mrtgtraf command_line $USER1$/check_mrtgtraf -F $LOGFILE$ -a $ARG1$ -w $ARG3$,$ARG4$ -c $ARG5$,$ARG6$ } References [1] http://nagios.sourceforge.net/docs/nagios-3.pdf Page 5 of 5 Buruca Team – Building Rural Africa ICT 4 Rural Development