How to configure MRTG to pull interval to 1 minute
How to configure MRTG to pull interval to 1 minute
I have Nagios and MRTG, the mrtg index looks fine but i want to monitor my interfaces of one switch in one interval to 1 minute, not 5, how can i do it?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How to configure MRTG to pull interval to 1 minute
MRTG is run as a CRON job (in /etc/cron.d/mrtg) and looks something like this:
You would need to:
Create a new folder /etc/mrtg/conf.special
Move the specific switch.cfg Config file into that folder (currently located in /etc/mrtg/conf.d/)
Create a copy of the existing /etc/mrtg/mrtg.cfg file (/etc/mrtg/mrtg_special.cfg)
Edit /etc/mrtg/mrtg_special.cfg to point to the /etc/mrtg/conf.special folder
Add an additional cron jon that runs this special file every minute
Fingers crossed that should all work.
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.okCreate a new folder /etc/mrtg/conf.special
Move the specific switch.cfg Config file into that folder (currently located in /etc/mrtg/conf.d/)
Create a copy of the existing /etc/mrtg/mrtg.cfg file (/etc/mrtg/mrtg_special.cfg)
Edit /etc/mrtg/mrtg_special.cfg to point to the /etc/mrtg/conf.special folder
Add an additional cron jon that runs this special file every minute
Code: Select all
*/1 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg_special.cfg --lock-file /var/lock/mrtg/mrtg_special_l --confcache-file /var/lib/mrtg/mrtg_special.okAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: How to configure MRTG to pull interval to 1 minute
It worked with someone?
Re: How to configure MRTG to pull interval to 1 minute
Yes, worked for me:
Edit /etc/mrtg/mrtg_special.cfg and at the bottom change conf.d/*.cfg to conf.special/*.cfg
Added the additional cron job (from Box293's post) that runs this special file every minute.
Code: Select all
mkdir /etc/mrtg/conf.special
chown apache.nagios /etc/mrtg/conf.special
mv /etc/mrtg/conf.d/YOURSWITCH.cfg /etc/mrtg/conf.special/
cp /etc/mrtg/mrtg.cfg /etc/mrtg/mrtg_special.cfg
chown apache.nagios mrtg_special.cfgAdded the additional cron job (from Box293's post) that runs this special file every minute.
Re: How to configure MRTG to pull interval to 1 minute
I have a etc/mrtg/mrtg.cfg , mrtg.cfg is the conf file of my switch right?, because i have monitoring just one
Re: How to configure MRTG to pull interval to 1 minute
When i created the cfgmaker i put this command
so, wheres the cfg file of my switch?
Code: Select all
cfgmaker --global 'WorkDir:/var/www/mrtg' --global 'Options[_]: bits,growright' --output /etc/mrtg/mrtg.cfg public@<yourrouterip>Re: How to configure MRTG to pull interval to 1 minute
It should be in your /etc/mrtg/conf.d directory.
Re: How to configure MRTG to pull interval to 1 minute
I dont have conf.d directory in /etc/mrtg, :C
Re: How to configure MRTG to pull interval to 1 minute
Create the directory and then add the include to mrtg.conf:
The next time mrtg runs, it will parse the files in conf.d.
Code: Select all
mkdir /etc/mrtg/conf.d/
chown apache:nagios /etc/mrtg/conf.d
echo "Include: conf.d/*.cfg" >> /etc/mrtg/mrtg.cfgFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to configure MRTG to pull interval to 1 minute
And after that, start again with the beginning of the post?