Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 7th September 2010, 18:15
kheimbuch kheimbuch is offline
Junior Member
 
Join Date: Sep 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

falko- No I had tried that already and it did not work... Thanks for the suggestion though.

Gads - This worked out for me as well. The only thing I had to do was modify some of the file location paths. Since I am monitoring multiple switches I had to modify some things.

Using the "env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg" command would not work for multiple switches. I had to change the output to look something like this "env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg_252.cfg". This was done for each switch so that I knew which output file to point the nagios check_mrtgtraf command to in the switch.cfg file.

I also had to make the appropriate change within the crontab file as well. Other wise it would not update that file and it would give the error "MRTG data has expired".

Only thing I have noticed is that the output files from mrtg only list ports that are listed as being up. Well I shouldn't say that, they are in the log file but are commented out so in nagios it will still show the error: "check_mrtgtraf: Unable to open MRTG log file". Once something is plugged into the port it will start reading the bandwidth once it refreshes.

Awesome job figuring this out gads.
Reply With Quote
Sponsored Links
  #12  
Old 12th October 2010, 06:55
chiragvaidya chiragvaidya is offline
Junior Member
 
Join Date: Oct 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default graphs not geting generated in pnp nagios

Hi,

i m making graph for my 2950 cisco switch, i can able to get data but still graphs not getting generated. here im attaching some screenshots so taht u can help me better.
Attached Images
  
Reply With Quote
  #13  
Old 24th October 2011, 12:57
RAYNM3N RAYNM3N is offline
Junior Member
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!


No need to have a different config file for every switch.
Just append the following configs to the same mrtg.conf file and then point to the ip_port on Nagios.
There is also no need to extra add any line in crontab.

Hope this helped!
Reply With Quote
  #14  
Old 24th October 2011, 13:02
RAYNM3N RAYNM3N is offline
Junior Member
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!

I have written a reply - at the bottom of all messages - in response to your message.
I hope that will help you get rid on some extra work.

Cheers.
Reply With Quote
  #15  
Old 21st November 2012, 00:01
ilyar ilyar is offline
Junior Member
 
Join Date: Nov 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default still having trouble

Hello All!

I need some help. I followed gads instructions and still receiving the error: check_mrtgtraf: Unable to open MRTG log file

I don't understand what is going on at this point. Please help. I checked the following:

The html file works
http://10.0.1.85/mymrtg/10.0.1.1_2.html

The switch.cfg is configured
define service{
use generic-service ; Inherit values from a template
host_name Router_San_Rafael
service_description Port 2 Bandwidth Usage
check_command check_local_mrtgtraf!/var/www/html/mymrtg/10.0.1.1_2.log!AVG!1000000,1000000!5000000,5000000 !10
}

The commands.cfg is configured
# 'check_local_mrtgtraf' command definition
define command{
command_name check_local_mrtgtraf
command_line $USER1$/check_mrtgtraf -F $LOGFILE$ -a $ARG1$ -w $ARG3$ -c $ARG4$ -e $ARG5$
}
Reply With Quote
  #16  
Old 21st November 2012, 09:07
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

What output does this command give you?
Code:
ls -al /var/www/html/mymrtg/10.0.1.1_2.log
__________________
Real men don't backup... Real men cry!

http://www.e-rave.nl/
Reply With Quote
  #17  
Old 21st November 2012, 18:46
ilyar ilyar is offline
Junior Member
 
Join Date: Nov 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Mark_NL View Post
What output does this command give you?
Code:
ls -al /var/www/html/mymrtg/10.0.1.1_2.log

-rw-r--r--. 1 root root 55171 Nov 21 09:40 /var/www/html/mymrtg/10.0.1.1_2.log
Reply With Quote
  #18  
Old 21st November 2012, 23:13
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

What happens when you run the check command from a shell:

Code:
/usr/lib/nagios/plugins/check_local_mrtgtraf -F /var/www/html/mymrtg/10.0.1.1_2.log -a AVG -w 1000000,1000000 -c 5000000,5000000 -e 10
__________________
Real men don't backup... Real men cry!

http://www.e-rave.nl/
Reply With Quote
  #19  
Old 21st November 2012, 23:17
ilyar ilyar is offline
Junior Member
 
Join Date: Nov 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Mark_NL View Post
What happens when you run the check command from a shell:

Code:
/usr/lib/nagios/plugins/check_local_mrtgtraf -F /var/www/html/mymrtg/10.0.1.1_2.log -a AVG -w 1000000,1000000 -c 5000000,5000000 -e 10

after I run this i get:

-bash: /usr/lib/nagios/plugins/check_local_mrtgtraf: No such file or directory

by the way when i installed nagios i ran this command:

yum install nagios nagios-devel nagios-plugins* gd gd-devel httpd php gcc glibc glibc-common

so i am not sure where the plugins are located if they were installed. i believe my nagios is installed in /etc/nagios but i don't see a plugins directory there.

thanks.
Reply With Quote
  #20  
Old 22nd November 2012, 00:02
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
 
Default

ow damn, the command is wrong, should be "check_mrtgtraf"

try to cd into /usr/lib/nagios/plugins, does that dir exist?

find your nagios plugin dir (should be defined in your nagios config somewhere)
then correct the command to reflect the correct location and run it.
__________________
Real men don't backup... Real men cry!

http://www.e-rave.nl/
Reply With Quote
Reply

Bookmarks

Tags
check_mrtgtraf, nagios

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix delivery problem erebus Installation/Configuration 8 29th July 2014 20:17
Can't access to my website - after install problem pallermo Installation/Configuration 18 4th June 2010 13:29
Hosting multiple websites and webmail dmwcool Installation/Configuration 8 30th March 2010 03:15
Mail System doesnt work! crichton Installation/Configuration 3 17th September 2007 23:49
ERROR: The PHP binary coming with ISPConfig does not work properly on your system! qvindesland Installation/Configuration 22 21st May 2007 16:05


All times are GMT +2. The time now is 23:20.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.