Page 1 of 2

Nagios switch-check_mrtgtraf: Unable to open MRTG log file

Posted: Wed Apr 29, 2015 3:51 am
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

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

Posted: Wed Apr 29, 2015 2:28 pm
by Box293
Can you please post your mrtg config file along with your Nagios service definition and the command definition that the service uses.

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

Posted: Mon May 04, 2015 8:37 am
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)

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

Posted: Mon May 04, 2015 11:49 am
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

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

Posted: Wed May 06, 2015 12:47 am
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:

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

Posted: Wed May 06, 2015 1:33 am
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

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

Posted: Wed May 06, 2015 2:41 am
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?

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

Posted: Wed May 06, 2015 11:42 am
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.

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

Posted: Thu May 07, 2015 8:21 am
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?

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

Posted: Thu May 07, 2015 9:23 am
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]