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.
mkdir /etc/mrtg
mv /etc/mrtg.cfg /etc/mrtg/
Now we run the cfgmaker command to get things up and running:
cfgmaker --global 'WorkDir:/var/www/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/mrtg.cfg public@<yourrouterip>
We need to make sure the following lines are correct in /etc/mrtg/mrtg.cfg If they are not there, add them.
EnableIPv6: no
RunAsDaemon: Yes
Interval: 5
Logdir: /var/log/mrtg
Now run:
indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
Which will build the index so you can view the output.
Then I run this command to set an environmental variable
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
and open http://localhost/mrtg/index.html
but, iif i want now to add one router how can i do?, i tried to use the same steps but to the router ip and doesnt work
Do you have SNMP enabled and configured on the router?
Can you run the following from your Nagios system to see if the router has the SNMP port open? Replace xxx with the routers IP address.
Sorry now i can do, it just to change to other directory, example mrtg/router, and i put localhost/mrtg/router/index.html and shows the interface, but, very thanks!
Yeah the problem is solved, just one question, for each device that i want to monitor (switch or router) , is the same mrtg.cfg?, for every devices that i want to add with the cfgmaker i put mrtg.cfg always?, or mrtg1.cfg, mrtg2.cfg, mrtg3.cfg,?
Depending on the settings in the /etc/mrtg/mrtg.cfg file, you shouldn't have to add it to the cfgmaker command at all.
Can you post your mrtg.cfg file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
I found that you could just generate a different .cfg file with cfgmaker and append it to main config file or create a different cfg file and add that to your crontab file.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Without knowing how your system is setup, I cannot give you any details, but the crontab file that currently runs the mrtg command every 5 minutes needs to be edited and just duplicate the current command and change the name of the cfg file to the new on that you created.
Then restart the cron daemon and it should start collecting the data.
Be sure to check out our Knowledgebase for helpful articles and solutions!