Nagios switch-check_mrtgtraf: Unable to open MRTG log file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
lsazzad
Posts: 72
Joined: Tue Apr 07, 2015 6:52 am
Location: ​Osnabrück, Deutschland
Contact:

Nagios switch-check_mrtgtraf: Unable to open MRTG log file

Post by lsazzad »

I juts have added one switch with my Nagios. Ping service is ok. But having error on different service. I have installed MRTG. But i think MRTG isn't working properly. Have the bellow snap.
Error
Error
Regards
Sazzad
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by Box293 »

Can you please post your mrtg config file along with your Nagios service definition and the command definition that the service uses.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
lsazzad
Posts: 72
Joined: Tue Apr 07, 2015 6:52 am
Location: ​Osnabrück, Deutschland
Contact:

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by lsazzad »

Extremely sorry for the late reply. I have tried two sites to get help & i think i have mixed up all. Do, you have recommended site? So that i can get help step by step? It would be great help for me.

*Please note that i am using Ubuntu 15.04 (GNU/Linux 3.16.0-36-generic x86_64)
Regards
Sazzad
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by ssax »

It looks like you don't have the check_snmp plugin installed, see if /usr/local/nagios/libexec/check_snmp exists.

If you don't, you need to install the net-snmp packages and recompile your plugins:

Code: Select all

yum install net-snmp net-snmp-utils
cd /tmp
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
tar zxf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
For MRTG graphs reference: http://nagios.sourceforge.net/docs/nagi ... raphs.html

A simple guide: http://bigunix.blogspot.com/2009/07/how ... g-and.html
lsazzad
Posts: 72
Joined: Tue Apr 07, 2015 6:52 am
Location: ​Osnabrück, Deutschland
Contact:

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by lsazzad »

1. Downloaded required plugin. But there bellow plugins are not present. I have checked it. But i have downloaded all required plugins using following command:

Code: Select all

wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
net-snmp, net-snmp-devel, net-snmp-libs, net-snmp-utils, beecrypt-devel,
elfutils-devel, elfutils-devel-static, lm_sensors
2. For Downloading "check_snmp"
- To install check_snmp I download the plugin from this location. check_snmp
I have gone through following link:

https://exchange.icinga.org/exchange/Ad ... face+Check

There i don't find any check_snmp.tar file available? :roll: :roll:
Regards
Sazzad
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by Box293 »

check_snmp comes with Nagios Plugins however it requires net-snmp modules to be installed before compiling.

Here's a guide:

http://sites.box293.com/nagios/guides/i ... centos-6-5

After this install Nagios Plugins:
http://sites.box293.com/nagios/guides/i ... centos-6-5
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
lsazzad
Posts: 72
Joined: Tue Apr 07, 2015 6:52 am
Location: ​Osnabrück, Deutschland
Contact:

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by lsazzad »

Dear Box293,
Thanks for your document. Its pretty good organized. check_snmp is working now.
Capture.JPG
Do, you have similiar document for MRTG installation on Ubuntu OS?
Regards
Sazzad
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by tgriep »

I found this link for installing Nagios Core and graphing on Ubuntu. You could take a look at that.
https://raymii.org/s/tutorials/Nagios_C ... 12.04.html

Could you run the check_mrtgtraf command from the command line on the Nagios server and post how the command was run and the error message it generates?

We will also need to see how the mrtg.cfg file is setup on the server.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lsazzad
Posts: 72
Joined: Tue Apr 07, 2015 6:52 am
Location: ​Osnabrück, Deutschland
Contact:

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by lsazzad »

1. Thanks for tutorial. That issue solved & now facing another :( :(
Capture.JPG
SNMP is UP but its showing critical in status. :( :( :(

2. I have config cfgmaker under : /var/www/html/mrtg path:

Now i just have added one(172.19.254.61) Switch using following command:

Code: Select all

cfgmaker --global 'WorkDir:/var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/mrtg.cfg [email protected]
I can see the graph also in GUI. Its ok.

Problem is that
, how can i add multiple NE? Like i have tried to add another switch using following command:

Code: Select all

cfgmaker --global 'WorkDir:/var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/mrtg.cfg [email protected]
Unfortunately the mrtg.cfg file is being replaced with new switch IP(172.19.254.62) :( :( :(
I dont understand why its happening?
Regards
Sazzad
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios switch-check_mrtgtraf: Unable to open MRTG log fi

Post by ssax »

Please post your service configuration under Configure > Core Config Manager > Services and find the port 24 service and screenshot it.

For the MRTG issue, you need to place the output files in /etc/mrtg/conf.d, that is where you put multiple files so that MRTG will process them.

Change it from:

Code: Select all

cfgmaker --global 'WorkDir:/var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/mrtg.cfg [email protected]
To:

Code: Select all

cfgmaker --global 'WorkDir:/var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/conf.d/172.19.254.61.cfg [email protected]
And then on your next one you add:

Code: Select all

cfgmaker --global 'WorkDir:/var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/conf.d/172.19.254.62.cfg [email protected]
Locked