Page 1 of 1

Nagios bandwidth monitors don't appear to be collecting data

Posted: Tue Dec 11, 2018 12:38 pm
by acentek
Linux Distribution and version?
CentOS Linux release 7.5.1804 (Core)

32 or 64bit?
64bit

VMware Image or Manual Install of XI?
Manual installation

Are there special configurations on your system, ie; is Gnome installed? Are you using a proxy? Are you using SSL?
SSL

A report from my EU is that:

Some new Nagios bandwidth monitors I've created over the past few weeks don't
appear to be collecting data. I tried creating some new ones just this
morning, but they are just constants 0s. (.e.g. ALDL-LAB-903
[1]GigabitEthernet0/1/0 Gi0/1/0- gt ZLND-903 Gi0/5/6 Bandwidth)

This appears to be different than the issue we were having before. Now it's
like the poll process just isn't occurring. It seems to only affect new
graphs, not old ones.

What i've found:
Looking at the bandwidth check i see that nagios is pulling the device mrtg but returning 0Mbps/0Mbps

[[email protected] ~]$ /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/10.10.10.235_19.rrd -w 500.0,500.0 -c 800.0,800.0 -l M
OK - Current BW in: 0Mbps Out: 0Mbps|in=0Mb/s;500.0;800.0 out=0Mb/s;500.0;800.0


I can see the RRD graph ownership is correctly owned by apache:apache

# ll 10.10.10.235_*
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_19.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_1.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_20.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_21.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_22.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_26.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_2.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 10:44 10.10.10.235_9.rrd


Using what i learned with my last ticket is i can work with mrtg

I created a one off of mrtg.cfg to match me only wanting to pull 10.10.10.235


# cat mrtgOneTime.cfg
######################################################################
# Multi Router Traffic Grapher -- Example Configuration File
######################################################################
# This file is for use with mrtg-2.0
#
# Note:
#
# * Keywords must start at the begin of a line.
#
# * Lines which follow a keyword line which do start
# with a blank are appended to the keyword line
#
# * Empty Lines are ignored
#
# * Lines starting with a # sign are comments.

# Where should the logfiles, and webpages be created?

# Minimal mrtg.cfg
#--------------------

HtmlDir: /var/www/mrtg
ImageDir: /var/www/mrtg
LogFormat: rrdtool
LogDir: /var/lib/mrtg
ThreshDir: /var/lib/mrtg
WorkDir: /var/lib/mrtg
Forks: 12
EnableSnmpV3: yes

Include: conf.d/10.10.10.235.cfg

EnableSNMPv3: yes


You can see i modified the include to be specific to 10.10.10.235.cfg instead of *.cfg

Now if i run mrtg on my mrtgOneTime.cfg

# time LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtgOneTime.cfg

real 0m0.200s
user 0m0.140s
sys 0m0.053s


It pulls that device quickly.

# ll 10.10.10.235*
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_19.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_1.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_20.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_21.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_22.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_26.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_2.rrd
-rwxrwxr-- 1 apache apache 105312 Dec 11 11:35 10.10.10.235_9.rrd


And i run the nagios check again.

$ /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/10.10.10.235_19.rrd -w 500.0,500.0 -c 800.0,800.0 -l M
OK - Current BW in: 0Mbps Out: 0Mbps|in=0Mb/s;500.0;800.0 out=0Mb/s;500.0;800.0



So why is that pulling data as 0Mbps?
Is there somewhere i can look for better logging of mrtg checks?

Re: Nagios bandwidth monitors don't appear to be collecting

Posted: Tue Dec 11, 2018 1:29 pm
by npolovenko
Hello, @acentek. What version of XI are you running? Can you show me the content of the following cron file?
/etc/cron.d/mrtg

Re: Nagios bandwidth monitors don't appear to be collecting

Posted: Tue Dec 11, 2018 1:38 pm
by acentek
Nagios XI version info below:

Your Nagios XI installation is up to date.
Latest Available Version: 5.5.7
Installed Version: 5.5.7
Last Update Check: 2018-12-10 12:40:01

Output of mrtg file is below:

# cat /etc/cron.d/mrtg
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg.lock --confcache-file /var/lib/mrtg/mrtg.ok --user=nagios --group=nagios

Re: Nagios bandwidth monitors don't appear to be collecting

Posted: Tue Dec 11, 2018 2:05 pm
by npolovenko
@acentek, Please delete--user=nagios --group=nagios from the cron, save and exit. Then run the following command:
service crond restart

Re: Nagios bandwidth monitors don't appear to be collecting

Posted: Tue Dec 11, 2018 2:39 pm
by acentek
Completed and resulting /var/log/cron shows it ran without the user

Dec 11 13:25:02 nagios CROND[68731]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg.lock --confcache-file /var/lib/mrtg/mrtg.ok )


But the resulting check command still shows.

$ /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/10.10.10.235_1.rrd -w 500.0,500.0 -c 800.0,800.0 -l M
OK - Current BW in: 2.59Mbps Out: 2.75Mbps|in=2.598692Mb/s;500.0;800.0 out=2.755397Mb/s;500.0;800.0

I had my EU run a test traffic. and it seems better now.

Why does the nagios user declared in mrtg's cron job cause this to 0 out traffic?

Re: Nagios bandwidth monitors don't appear to be collecting

Posted: Tue Dec 11, 2018 4:15 pm
by npolovenko
@acentek, We implemented the mrtg related security enhancement in the latest version of XI, but for some reason, some users started having problems where the mrtg cron won't execute because of permission problems. Our developers are currently looking into this issue.
But the resulting check command still shows.
$ /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/10.10.10.235_1.rrd -w 500.0,500.0 -c 800.0,800.0 -l M
OK - Current BW in: 2.59Mbps Out: 2.75Mbps|in=2.598692Mb/s;500.0;800.0 out=2.755397Mb/s;500.0;800.0
Seems like it's working now?

Re: Nagios bandwidth monitors don't appear to be collecting

Posted: Wed Dec 12, 2018 5:10 pm
by acentek
Yea all is working now.

Thanks for the prompt responses and the good work.

Not to say NagiosXI is great but your response was.