Page 1 of 1
check_mrtgtraf: Unable to open MRTG log file
Posted: Tue Mar 03, 2015 8:57 am
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?
Re: check_mrtgtraf: Unable to open MRTG log file
Posted: Tue Mar 03, 2015 11:14 am
by ssax
Please post the output of the following:
Re: check_mrtgtraf: Unable to open MRTG log file
Posted: Wed Mar 04, 2015 8:02 am
by ramil85
Code: Select all
drwxrwxrwx. 2 root root 4096 Feb 26 20:44 /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
Re: check_mrtgtraf: Unable to open MRTG log file
Posted: Wed Mar 04, 2015 12:58 pm
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:
If that doesn't show any differences then you may be hitting this bug:
http://superuser.com/a/641118
Re: check_mrtgtraf: Unable to open MRTG log file
Posted: Thu Mar 05, 2015 6:03 am
by ramil85
ssax wrote:
Are there really 2 files with the same name in that last one or was it a posting error?
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
Re: check_mrtgtraf: Unable to open MRTG log file
Posted: Thu Mar 05, 2015 3:35 pm
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 [email protected]
If you go into the web interface > Services > Click on the mrtg service, what does it say exactly under Status Information and Performance Data?