RELEASED: < 1 Minute to 5 Minute Polling Interval Patch

Important information about Cacti developments that all users should be interested in.

Moderators: Developers, Moderators

Post Reply
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You'll have to thank either Jeff Pasnak or Reinhard Schrek for the documentation. I just wrote the code and asked one of them, it's been a long time, to write the doco. But it's pretty understandable.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
hramirez
Posts: 8
Joined: Mon Apr 16, 2007 2:39 pm

Post by hramirez »

TheWitness wrote:You'll have to thank either Jeff Pasnak or Reinhard Schrek for the documentation. I just wrote the code and asked one of them, it's been a long time, to write the doco. But it's pretty understandable.

TheWitness
Jeff Pasnak, Reinhard Schrek Thank you! It really was quite understandable. I really appreciated how much it guided you, I just started with Cacti, and it made it real comfortable to follow.

TheWitness, major thanks to you for this great plugin!
clem.s
Posts: 8
Joined: Wed Apr 11, 2007 9:31 am
Location: Cannes, France

Post by clem.s »

Hi I just intalled cacti from the .exe (beta windows intaller v1.5)

I've downloaded "PollingIntervalsPatchv8.zip" and replace the file in the directory "C:\Inetpub\wwwroot\cacti".

I changed all the parameters with the help of the pdf.

but I have this message in the log file

04/18/2007 04:50:00 PM - CMDPHP: Poller[0] ERROR: The PHP Script: CMD.PHP Must be started using the full path to the file and in lower case. This is a PHP Bug!!!

What this mean ????


Thanks for your help
clem.s
Posts: 8
Joined: Wed Apr 11, 2007 9:31 am
Location: Cannes, France

Post by clem.s »

I just use http://forums.cacti.net/viewtopic.php?t ... c&start=15

and change the code in the cmd.php and it's ok and I see the graphs :wink:
clem.s
Posts: 8
Joined: Wed Apr 11, 2007 9:31 am
Location: Cannes, France

Post by clem.s »

Hi it's me again, I would like to know how to use the windows task manager to poll every 30s instead of 1 min, because I can choose 1min as minimum :-?

I in cacti I have to change only the timespan in the rra's section ????


Thanks for your answers
wapz
Posts: 1
Joined: Fri Apr 20, 2007 10:19 am

Post by wapz »

After a day of trying I finally got it work. Is there a set of checks that I can import that are already set for 1 minute? Saves me a lot of clicking work. And, what are the plans for putting 1 minute support into the next full release, maybe 0.8.7?

That would be great :)
tekbot
Posts: 49
Joined: Tue Jun 07, 2005 7:42 pm
Location: Venice, CA

Post by tekbot »

Hi Everyone!

I wanted to post my experience with the < 1 min poller and give some information running it at sub 1 min intervals.

Currently, I'm graphing WMI data that I'm getting from nrpe_nt / check_nrpe every 10 seconds. I'll spare you all the details of that setup for another post. I will, however, elaborate on the necessary configuration for a 10 second polling interval, as well as creating graphs that are updated every 10 seconds.

First, get familiar with TheWitness' pdf document at the start of the thread. Learn the difference between a Data Source, a Data Input, and a Data Template.

The first thing we're going to do is create additional RRAs for our sub-1 minute graphs. This is done in a similar fashion to the 1 minute RRAs you create in the first step of the PDF. Below are my prefered values:

Code: Select all

Name                       Steps Rows Timespan
30 Minutes - 10 Second Average  1  500  1800    
1 Hourly - 15 Second Average  1  500  3600    
4 Hourly - 20 Second Average  1  500  14400    
6 Hourly - 30 Second Average  1  500  21600    
12 Hourly (1 Minute Average)  1  500  43200   
This may or may not be self-explanatory. This is where cacti determines what graphs to create based on the output it gets. These will be associated later with some Graph Templates. In this case, my 10 second graphs are 30-min long, my 15 second graphs 1 hour long, 20 second graphs are 4 hours long, etc, etc.

Next, you want to create a new DataTemplate and associate these RRAs. Cloning a template is recommended. Don't Modify Data or Graph Templates that are used in Production -- EVER!

Make sure you associate all your new RRAs.

Important : If you want graphs with 10 second granularity, you need to set 'Step' to 10 (not 60). I did not modify Heartbeat (I left it at 120 as set for 1 min graphing).

If you've already followed TheWitness' doc and created a duplicate Graph Template, you do not need to revisit that step. The Graph Template will already be associated with your modified Data Template. You will, however, need to create new or recreate your existing 1-min graphs to get your 10s granularity (I setup a new Cacti server for this project so I could start from scratch).

Adjusting the Data Query (5.0 in the PDF) did not apply to me, as I am using Data Input Methods (scripts) not Data Queries (snmpwalks).

Now, all you need to do is to run your poller every 10 seconds, and tell cacti that you've done so. Here's how I did it.

I did NOT use mcron. I tried it, and I *hated* it. It seemed to me that it would have been so easy to add a seconds feild to the Vixie-cron syntax, but unfortunately, they decided to reinvent the wheel, (and make it a lot less round...).

So, we're going to write a very simple shell script that we will replace our line in crontab with. Here's what mine looks like:
/etc/crontab

Code: Select all

*/1 * * * * cacti /home/cacti/RunPoller > /dev/null 2>&1
/home/cacti/RunPoller

Code: Select all

#!/bin/bash

/usr/bin/php /path/to/cacti/poller.php & sleep 10
/usr/bin/php /path/to/cacti/poller.php & sleep 10
/usr/bin/php /path/to/cacti/poller.php & sleep 10
/usr/bin/php /path/to/cacti/poller.php & sleep 10
/usr/bin/php /path/to/cacti/poller.php & sleep 10
/usr/bin/php /path/to/cacti/poller.php & sleep 10
All this does is start a poller, background it (&), and immediately start sleeping. When the sleep command returns (exactly 10 seconds later) it starts another poller and repeats this. It does this 6 times per minute, once every 10 seconds.

Now, all that's left is to edit your settings parameter in Console -> Settings -> Poller -> Interval to 10 seconds and you're ready to create some new graphs!

Keep in mind, that if you keep your existing one min graphs, you will see new data in new graphs for the RRAs we configured at the beginning. However, those are averaged over the course of a minute! The RRDs that make those graphs are only updated once per minute unless you create new graphs.

The other caveat to this is system resources. Running a poller every 10 seconds can really grill your machine. I'm currently working on optimizing the configuration on my server using cacti's configuration paramaters. I'll post my solutions as I find them. In the interim, here's one of my 10 second graphs. Have Fun!



--tekbot
Attachments
*That's* Granularity!
*That's* Granularity!
QWEVIXScreen.PNG (17.38 KiB) Viewed 13982 times
rprague
Posts: 25
Joined: Fri Jul 25, 2003 12:44 pm
Location: Portland OR
Contact:

Post by rprague »

SOLVED: I wasn't running version j, but tried to use the zipfiles for j, that was my problem. Polling happily at 1 minute now.

Just working on getting this running, unzipped the patch in the cacti directory, made sure my ownership was right, followed the PDF to the letter, yet the rra file isn't being created for the box I'm testing this on.

The data source debug looks right:

Code: Select all

/usr/bin/rrdtool create \
/var/www/localhost/htdocs/cactibak/rra/portland_3600_mpls_router_traffic_out_231.rrd \
--step 60  \
DS:traffic_in:COUNTER:120:0:1544000 \
DS:traffic_out:COUNTER:120:0:1544000 \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \
I'm fairly certain I haven't missed anything at all in reading the instructions... I went over it 3 times step by step. The only difference I saw was that step 2.1 tells you to click 'devices' then 'rra', but as far as I know, its 'data sources' then 'rra'.

Did I miss something simple?

I was able to create the .rra files myself by copying/pasting the data debug mode info... I don't know if that's going to fix it.
....
Sascha Henken
Posts: 6
Joined: Wed Apr 25, 2007 1:06 pm

Post by Sascha Henken »

johngillespie wrote:I've got it working, some of the settings were wrong.
How did you get it working and what was wrong? I get the same Error:

Code: Select all

Either there are no items in the cache or polling is disabled
peppermint
Cacti User
Posts: 58
Joined: Fri May 11, 2007 1:11 pm
Location: NY

Data source is missing?

Post by peppermint »

I am using the patched made by TheWitiness posted at the topic beginning.

It worked most part on my server, the only problem I have is I created new Graphs and those graphs show in the Graph Management lists, however the data sources for those graphs are missing. It only happens with 1 mins polling templetes. If I add others, it works. I remember I was able to see data source first time when I added graphs, somehow during the later operation like delete(both charts and data source)/recreate the graphs, it starts to occur...

Does anyone have the same experince or any troubleshooting steps?

Thanks.

Mint
Bazou
Posts: 28
Joined: Tue Apr 10, 2007 7:45 am
Location: Brussels/Belgium

Post by Bazou »

TheWitness wrote:Several. Look in the scripts directory.

TheWitness
Hi all,

Is the patch for 0.8.6i (with PlugArch 1.1) still available somewhere?

Thx
ogiljae
Posts: 19
Joined: Wed Apr 04, 2007 11:15 pm

show me a image plz

Post by ogiljae »

himohit wrote:I got it. I had to make my changes in the Data Query section and point to the right location.
Thanks for all your help.
I have the same problem as you. It was great to find your post.
but i cannot really understand what you are talking.

It will be really great help if you show me a image that you changeed according to gandalf's advice.

I am looking forward to hearing from you ASAP.
zeki
Cacti User
Posts: 92
Joined: Fri Feb 09, 2007 10:55 pm
Location: So. Cal
Contact:

Post by zeki »

thanks tekbot got the 10 sec poller working :)
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Bazou wrote:Is the patch for 0.8.6i (with PlugArch 1.1) still available somewhere?
As of an hour ago, the Multi polling patch has now been added to the Plugin Architecture SVN (so basically now you only need 1 patch!). I have also made a few minor enhancements to it, mainly to protect you from setting the interval to a setting, but having the cron run at a different interval. So basically, if your cron is set to 1 minute / 10 sec / whatever, and you have Cacti set to a 5 Minute interval, it will still only poll every 5 minutes no matter what the cron is set to run.

I will probably push out the new version tomorrow after some more testing.
crieur.com
Posts: 19
Joined: Fri Mar 11, 2005 3:35 pm
Contact:

Some little corrections to Cacti_Polling_Intervals.pdf

Post by crieur.com »

2.1 Click 'Devices' then 'RRA's

replace by

2.1 Click 'Data sources' then 'RRA's


3.3Select your new template and:
3.3.1. Select all RRAs
3.3.2. Change 'Step' to '60'
3.3.3. Change Traffic In 'Heartbeat' to '120'
3.3.4. Change Traffic Out 'Heartbeat' to '120'

As there is 2 tabs you have to save your page between the 2 tabs


5.0 Adjust Data Query
Click "Add"



and finally it doesn't work non of my old datasources are updating so I'm re patching back with 0.8.6j files


anyone ?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests