Page 1 of 1

Nagios XI unable to load MRTG log file

Posted: Tue Jun 28, 2016 4:50 pm
by ljblom
I'm trying to monitor bandwidth on one of my routers and have tried setting up "check_mrtgtraf" to do so. When I do a manual check of my service through the Core Config Manager, I get a successful output:

"OUTPUT: Traffic OK - Avg. In = 21.0 B/s, Avg. Out = 450.0 B/s|in=21.000000B/s;1000000.000000;5000000.000000;0.000000 out=450.000000B/s;1000000.000000;5000000.000000;0.000000".

I get the same result through the command line on my server. However, when I applied the service to Nagios XI, it just errors out, "check_mrtgtraf: Unable to open MRTG log file". I've included my service config below. I've followed several other forum posts with a similar issues, but have yet to have any success. Any help is greatly appreciated, as always.

Code: Select all

define service {
        host_name                       I53US - Gateway
        service_description             I53US - Bandwidth
        check_command                   check_mrtgraf!/var/www/mrtg/10.x.x.x_x.log!AVG!1000000,1000000!5000000,5000000!10!!!
        max_check_attempts              2
        retry_interval                  1
        notification_interval           480
        first_notification_delay        15
        contact_groups                  WATC Tech
        register                        1
        }

Re: Nagios XI unable to load MRTG log file

Posted: Tue Jun 28, 2016 4:54 pm
by rkennedy
This is usually related to permissions, as the test check command will use a different user then nagios. When nagios runs the check, it's as the nagios user.

What are the permissions of the file? ls -l /var/www/mrtg/10.x.x.x_x.log

Re: Nagios XI unable to load MRTG log file

Posted: Tue Jun 28, 2016 5:11 pm
by ljblom
-rw-r--r-- 1 nagios nagios 49732 Jun 28 22:10 /var/www/mrtg/10.x.x.x_x.log

Re: Nagios XI unable to load MRTG log file

Posted: Wed Jun 29, 2016 11:07 am
by ssax
That looks fine, please post the output of these commands:

Code: Select all

grep "User \|Group " /etc/httpd/conf/httpd.conf
grep nag /etc/group
ls -ld /var
ls -ld /var/www
ls -ld /var/www/mrtg
Thank you