Nagios XI unable to load MRTG log file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ljblom
Posts: 31
Joined: Tue Feb 16, 2016 7:24 pm

Nagios XI unable to load MRTG log file

Post 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
        }
Last edited by tmcdonald on Wed Jun 29, 2016 10:54 am, edited 1 time in total.
Reason: Please use [code][/code] tags around terminal output
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios XI unable to load MRTG log file

Post 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
Former Nagios Employee
ljblom
Posts: 31
Joined: Tue Feb 16, 2016 7:24 pm

Re: Nagios XI unable to load MRTG log file

Post by ljblom »

-rw-r--r-- 1 nagios nagios 49732 Jun 28 22:10 /var/www/mrtg/10.x.x.x_x.log
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios XI unable to load MRTG log file

Post 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
Locked