Items polling order

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
pet
Posts: 15
Joined: Wed Jun 30, 2004 9:00 am

Items polling order

Post by pet »

Hi all,

i have one question about cacti polling order.
Which function or select determine items polling sequence ?
First I thought this is determined by the order of item inserted into system.
When I ask feature View Poller Chache to see there is other order of items polling than in reality, which is logged in cacti.log
Also I tried to Clear Poller cache.
How could I change the order of items which Cacti will poll ?
It's seems like irrelevant, but I have almost 3000 items to poll and some items needs to be poll sooner than other, cause they're very important
Thanks a lot for an answers
pet
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

They are ordered by the hostid.

But if you are using more than one thread, making any changes to the query will break your polling.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
pet
Posts: 15
Joined: Wed Jun 30, 2004 9:00 am

Post by pet »

Thanks for your answer Tony

I found when cacti uses one poller it will use select something like "select from poller_item order by host_id "
This is not a problem but problem is that I have almost 100 items with host_id=0 ( my scripts about smtp, icmp and other hosts availabilities around the world) and it takes 10-15 minutes to finish these host_id=0 items, then cacti continues with next snmp hosts
It means , important snmp routers will finish after 20 minutes.
So I decided to use more than one cmd.php pollers but this will mix order of polling items randomly

How could I change this order ?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

takes 10-15 minutes
My friend you have bigger issues. Please take a look at getting cactid working, or at minimum, figure out why those scripts are taking so long. You poller should not exceed the 5 minute window of the polling cycle. Doing so will just lead to a progressive failure where you will have system resources being eaten up by more and more pollers and has the load gets higher, the pollers will take longer and longer to execute. Not to mention the issues you will have with partial or duplicate updates to the RRD's due to more than one poller running at a time.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Agreed that Cactid is the way to go. However, it won't help the Host=0 so much if those 100 scripts take more than 5 minutes to complete. I would likely want to migrate them to host based scripts and get them off of host=0.

Just so that you know, the host=0 is depricated. It still works (in Cactid 0.8.6e only, see announcements forum), but the poller is designed around hosts and will bog down with 100+ scripts.

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?
pet
Posts: 15
Joined: Wed Jun 30, 2004 9:00 am

Post by pet »

Thanks a lot for your answers

My scrpits takes long time cause they must. For example I measure routers availabilities through entire world, from China to Lima and it takes 10-15 second responds, so it;s normal. Unfortunately, I got many hosts like these.
So it takes 10 -15 minutes to finish.
I thought about the same think as Witness wrote, to get rid off host_id=0.
Could I associate these host_id=0 with any ( or some test) host ? Just to ensure that there's no host_id=0

Thanks , pet
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This is what you should do. For each device that you poll, make sure that it has an associated device in the device table. Then your polling will complete very quickly. Please keep in mind that the hosts will have to be reachable via either snmp or ping.

Regards,

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests