check_mrtgtraf

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_mrtgtraf

Post by dwhitfield »

What's the output of find / -name mrtg.cfg?

You may just need to run mkdir /etc/mrtg/conf.d/ but if you have multiple configs, that might not be all that needs to happen.
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post by jmac727 »

Yeah it looks like I don't have that /conf.d/ folder. Here are my results.

Any advice is appreciated!

Thanks
Attachments
findmrtg.png
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_mrtgtraf

Post by tgriep »

Did you make that folder on your system?
To do that, login as root the the server and run the following to create the folder and to set the permissions.

Code: Select all

mkdir /etc/mrtg/conf.d
chmod nagios.nagios /etc/mrtg/conf.d
chmod 775 /etc/mrtg/conf.d
Then you will have to setup a cron entry to run the mrtg application every 5 minutes which will generate the /var/lib/mrtg rrd files.

If your system has this file on the system

Code: Select all

/etc/cron.d/mrtg
Make sure this line is in that file

Code: Select all

*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
If the /etc/cron.d/mrtg file doesn't exist, create it and add that line to it.

Then restart the cron daemon by running the following to load the changes

Code: Select all

service crond restart
Try that and see if the /var/lib/mrtg rrd files are created.

If not, run the following command as root and post back the /tmp/mrtg.txt file?

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg -debug=cfg,base &> /tmp/mrtg.txt
Be sure to check out our Knowledgebase for helpful articles and solutions!
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post by jmac727 »

Hi

I made the directory. I was unable to chmod nagios.nagios /etc/mrtg/conf.d. I attached the error I got.

I've also attached the .txt file you requested.
Attachments
mrtg.txt
(1.19 KiB) Downloaded 310 times
chmod.png
chmod.png (6.49 KiB) Viewed 3283 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_mrtgtraf

Post by tgriep »

Oops, typo on my part. It should be chown, not chmod.

Code: Select all

chown nagios.nagios /etc/mrtg/conf.d
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_mrtgtraf

Post by tgriep »

Another thing, edit the /etc/mrtg/mrtg.cfg file and remove this line

Code: Select all

Enable SNMPv3: yes
Save the file and see if the rrd files are created in the /var/lib/mrtg folder.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post by jmac727 »

Hi. I did all these things and still nothing :(
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post by jmac727 »

This is in my mrtg cron file
Attachments
crond.png
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_mrtgtraf

Post by tgriep »

Run the following command as root and post back the /tmp/mrtg.txt file?

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg -debug=cfg,base &> /tmp/mrtg.txt
Be sure to check out our Knowledgebase for helpful articles and solutions!
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post by jmac727 »

Here it is.

Thanks again for your patience and diligence in working with me.
Attachments
mrtg (1).txt
(207 Bytes) Downloaded 315 times
Locked