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.
Locked
ramil85
Posts: 7
Joined: Thu Feb 26, 2015 2:04 am

check_mrtgtraf: Unable to open MRTG log file

Post by ramil85 »

Hi.
I have installed MRTG. MRTG graphs appear nominal when i open on browser: localhost/mrtg

nagios on web interface give error

Code: Select all

check_mrtgtraf: Unable to open MRTG log file
command:

Code: Select all

sudo -u nagios /usr/lib64/nagios/plugins/check_mrtgtraf -F /var/lib/mrtg/192.168.5.1_15.log -a AVG -w 1000000,1000000 -c 5000000,5000000 -e 10
give same error

Code: Select all

check_mrtgtraf: Unable to open MRTG log file
Usage check_mrtgtraf -F <log_file> -a <AVG|MAX> -w <warning_pair> -c <critical_pair> [-e expire_minutes]
i set 777 permission to all files in /var/lib/mrtg/ but it didnt solved issue. Same error.

OS: centos 6.5
version: nagios 3.x

What might be the reason of this issue?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_mrtgtraf: Unable to open MRTG log file

Post by ssax »

Please post the output of the following:

Code: Select all

ls -ld /var/lib/mrtg

Code: Select all

ls -l /var/lib/mrtg
ramil85
Posts: 7
Joined: Thu Feb 26, 2015 2:04 am

Re: check_mrtgtraf: Unable to open MRTG log file

Post by ramil85 »

ssax wrote:

Code: Select all

ls -ld /var/lib/mrtg

Code: Select all

drwxrwxrwx. 2 root root 4096 Feb 26 20:44 /var/lib/mrtg
ssax wrote:

Code: Select all

ls -l /var/lib/mrtg

Code: Select all

-rwxrwxrwx. 1 root 48408 Feb 26 20:45 192.168.5.1_15.log
-rwxrwxrwx. 1 root 48408 Feb 26 20:45 192.168.5.1_15.log
-rwxrwxrwx. 1 root root 0 Feb 26 21:33 mrtg.ok
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_mrtgtraf: Unable to open MRTG log file

Post by ssax »

Are there really 2 files with the same name in that last one or was it a posting error?

If it wasn't a mistake, please post the output of the following:

Code: Select all

ls -lab /var/lib/mrtg
If that doesn't show any differences then you may be hitting this bug: http://superuser.com/a/641118
ramil85
Posts: 7
Joined: Thu Feb 26, 2015 2:04 am

Re: check_mrtgtraf: Unable to open MRTG log file

Post by ramil85 »

ssax wrote: Are there really 2 files with the same name in that last one or was it a posting error?

Code: Select all

ls -lab /var/lib/mrtg
yes it was posting mistake:
but now i see that is permissions changed from 777 to 644. It seems that MRTG overwriting files permission.

Code: Select all

drwxrwxrwx.  2 root root  4096 Feb 26 21:39 .
drwxr-xr-x. 33 root root  4096 Feb 26 03:12 ..
-rw-r--r--.  1 root root 48428 Feb 26 21:39 192.168.5.1_15.log
-rw-r--r--.  1 root root 48426 Feb 26 21:38 192.168.5.1_15.old
-rwxrwxrwx.  1 root root     0 Feb 26 21:39 mrtg.ok
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_mrtgtraf: Unable to open MRTG log file

Post by ssax »

And you did run the cfgmaker command configured to your html directory where the mrtg html files reside?

Example:

Code: Select all

cfgmaker --global 'WorkDir: /var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/httpd/conf/mrtg.cfg public@192.168.1.15
If you go into the web interface > Services > Click on the mrtg service, what does it say exactly under Status Information and Performance Data?
Locked