check_mrtgtraf: Unable to open MRTG log file
check_mrtgtraf: Unable to open MRTG log file
I am sorry if there is a solution already and I missed it but I tried everything and I could not get it working.
http://support.nagios.com/forum/viewtop ... 23&p=78499
http://support.nagios.com/forum/viewtop ... f=7&t=8606
I think MRTG is working as I can see only one graph here but error in nagios Core Version 4.0.8.
http://192.168.3.2/mrtg/index.html
Permissions are as follows
-rwxr-xr-x 1 nagios nagios 110343 Oct 2 14:50 /usr/local/nagios/libexec/check_mrtgtraf
ls -la /etc/mrtg/
drwxr-xr-x. 2 root root 4096 Oct 2 15:27 .
drwxr-xr-x. 120 root root 12288 Oct 2 13:53 ..
-rw-r--r-- 1 root root 0 Oct 2 10:36 mrtg_252.cfg_l
-rw-r--r-- 1 root root 25078 Oct 2 12:04 mrtg2.cfg
-rw-r--r-- 1 nagios nagios 25078 Oct 2 15:30 mrtg.cfg
-rw-r--r-- 1 root root 0 Oct 2 13:48 mrtg.cfg_l
-rw-r--r--. 1 root root 45727 Sep 29 10:53 mrtg.cfg.rpmsave
-rw-r--r--. 1 root root 0 Oct 2 10:53 mrtg.ok
-rw-r--r-- 1 root root 25094 Oct 2 15:16 mymrtg.cfg
-rw-r--r-- 1 root root 0 Sep 29 11:10 mymrtg.ok
[root@nagios tmp]# ls -lad /etc/mrtg/
drwxr-xr-x. 2 root root 4096 Oct 2 15:27 /etc/mrtg/
I have spent over a week on it. FYI I am just a beginner on Linux but I can find my way around thanks to all your help.
http://support.nagios.com/forum/viewtop ... 23&p=78499
http://support.nagios.com/forum/viewtop ... f=7&t=8606
I think MRTG is working as I can see only one graph here but error in nagios Core Version 4.0.8.
http://192.168.3.2/mrtg/index.html
Permissions are as follows
-rwxr-xr-x 1 nagios nagios 110343 Oct 2 14:50 /usr/local/nagios/libexec/check_mrtgtraf
ls -la /etc/mrtg/
drwxr-xr-x. 2 root root 4096 Oct 2 15:27 .
drwxr-xr-x. 120 root root 12288 Oct 2 13:53 ..
-rw-r--r-- 1 root root 0 Oct 2 10:36 mrtg_252.cfg_l
-rw-r--r-- 1 root root 25078 Oct 2 12:04 mrtg2.cfg
-rw-r--r-- 1 nagios nagios 25078 Oct 2 15:30 mrtg.cfg
-rw-r--r-- 1 root root 0 Oct 2 13:48 mrtg.cfg_l
-rw-r--r--. 1 root root 45727 Sep 29 10:53 mrtg.cfg.rpmsave
-rw-r--r--. 1 root root 0 Oct 2 10:53 mrtg.ok
-rw-r--r-- 1 root root 25094 Oct 2 15:16 mymrtg.cfg
-rw-r--r-- 1 root root 0 Sep 29 11:10 mymrtg.ok
[root@nagios tmp]# ls -lad /etc/mrtg/
drwxr-xr-x. 2 root root 4096 Oct 2 15:27 /etc/mrtg/
I have spent over a week on it. FYI I am just a beginner on Linux but I can find my way around thanks to all your help.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_mrtgtraf: Unable to open MRTG log file
Can you show us the cron that you currently have set up? Can you also manually run the command that you have in that cron and show us the output?
Re: check_mrtgtraf: Unable to open MRTG log file
Here is the output:
[root@nagios ~]# */5 * * * * /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
-bash: */5: No such file or directory
[root@nagios ~]# */5 * * * * /usr/bin/env LANG=C /usr/bin/mrtg /etc/httpd/conf/mrtg.cfg --logging /var/log/mrtg.log
-bash: */5: No such file or directory
[root@nagios ~]#
[root@nagios ~]# */5 * * * * /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
-bash: */5: No such file or directory
[root@nagios ~]# */5 * * * * /usr/bin/env LANG=C /usr/bin/mrtg /etc/httpd/conf/mrtg.cfg --logging /var/log/mrtg.log
-bash: */5: No such file or directory
[root@nagios ~]#
Re: check_mrtgtraf: Unable to open MRTG log file
This morning I changed my service def as well to
define service{
use generic-service
host_name Master
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/www/mrtg/192.168.3.40_1.log!AVG!1000000,2000000!5000000,5000000!10
}
and restarted nagios service. Now I get MRTG data has expired (5619 minutes old) .
define service{
use generic-service
host_name Master
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/www/mrtg/192.168.3.40_1.log!AVG!1000000,2000000!5000000,5000000!10
}
and restarted nagios service. Now I get MRTG data has expired (5619 minutes old) .
Re: check_mrtgtraf: Unable to open MRTG log file
Sorry it has gone back to same error
check_mrtgtraf: Unable to open MRTG log file
check_mrtgtraf: Unable to open MRTG log file
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_mrtgtraf: Unable to open MRTG log file
You can't run that command as it is posted in the crontab, you need to run it as a typical linux command:
Code: Select all
/usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.logRe: check_mrtgtraf: Unable to open MRTG log file
Hi,
Just run it or copy it in cron?
Just run it or copy it in cron?
Re: check_mrtgtraf: Unable to open MRTG log file
You need to run the command that slansing posted from the command line, and post the output.
Former Nagios employee
Re: check_mrtgtraf: Unable to open MRTG log file
I have run the command and I did not see any output
[root@nagios ~]# /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
[root@nagios ~]#
[root@nagios ~]# /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
[root@nagios ~]#
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_mrtgtraf: Unable to open MRTG log file
What is the output of:
I'm curious to see both the permissions, as well as the size and last update time.
Code: Select all
ls -la /var/log/mrtg.log