Change default "Re-Index Method"

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

Moderators: Developers, Moderators

ogou
Posts: 17
Joined: Mon Feb 13, 2006 10:36 am
Location: Paris / France

Change default "Re-Index Method"

Post by ogou »

Hi,

I've create a "Host Template" with many Interfaces graph ...
I'd like to know if I can change the default "Re-Index Method".

The default is "Uptime Goes Backwards" but I'd like to have "Index Count Changed".

Thanks,
Olivier
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Once the Data Query is added, there's no chance to change this. Perhaps changing the MySQL table and re-generating the poller_cache would work?
Reinhard
ogou
Posts: 17
Joined: Mon Feb 13, 2006 10:36 am
Location: Paris / France

Post by ogou »

Hi Reinhard,

I just whant to know, when I apply a host template (with Associated Data Queries) if I can have the "Re-Index Method" set to "Index Count Changed" BY DEFAULT.

This is because when I apply a Host Template, the "Re-Index Method" is set to "Uptime Goes Backwards". So I must delete the "Data Queries" and recreate it.

Thanks,
Olivier
Attachments
image.jpg
image.jpg (116.27 KiB) Viewed 21866 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

AFAIK this is not configurable. This will require a code change, but only a very small one. If you're interested in this, I may provide it
Reinhard
ogou
Posts: 17
Joined: Mon Feb 13, 2006 10:36 am
Location: Paris / France

Post by ogou »

Yes Reinhard,

If you could send me the code to change.

Thanks,
Olivier
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please change host.php,

Code: Select all

<?php form_dropdown("reindex_method",$reindex_types,"","","1","","");?>
to

Code: Select all

<?php form_dropdown("reindex_method",$reindex_types,"","","2","","");?>
to get "Index Count changed" etc.
Reinhard
anuraganuj
Cacti User
Posts: 70
Joined: Tue Feb 21, 2006 9:50 am

You can change it!!!!!!!!!!!!!!!

Post by anuraganuj »

you can change re-indexing method any time as i did and tested it also to work.just delete that data query from host and add same data query with new reindexing method that is it.
ogou
Posts: 17
Joined: Mon Feb 13, 2006 10:36 am
Location: Paris / France

Post by ogou »

Thanks Reinhard,

The default "Re-Index Method" is now set to "Index Count Changed" when I add manually "Data Query".

This is ok BUT when I apply a "HOST TEMPLATE" on a new host, the "Re-Index Method" is still "Uptime Goes Backwards" for my data query.

In my example, I apply a host template with this conf :

Graph Template
1) Redback - CPU
2) Redback - Memory
Data Query Name
1) Interfaces 64-bit Stat

The "Interfaces 64-bit Stat" is apply to my host with an "Index Method" set to "Uptime Goes Backwards".
Attachments
hosttemplate.jpg
hosttemplate.jpg (63.84 KiB) Viewed 21813 times
anuraganuj
Cacti User
Posts: 70
Joined: Tue Feb 21, 2006 9:50 am

Post by anuraganuj »

you can change re-indexing method any time as i did and tested it also to work.just delete that data query from host and add same data query with new reindexing method that is it.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

ogou wrote:This is ok BUT when I apply a "HOST TEMPLATE" on a new host, the "Re-Index Method" is still "Uptime Goes Backwards" for my data query.
Ah, yes. Did not realize this fact. Perhaps will have a look, but need some time
Reinhard
dgerow
Posts: 6
Joined: Mon Aug 07, 2006 5:58 am

Post by dgerow »

Any word on this? The Win32_runningprocs template provided in another thread[0] require a re-index method of 'Index Count Changed'. As I'd failed to notice this before adding all required devices, I now have to go through and change the method for a few hundred hosts.

[0]http://forums.cacti.net/viewtopic.php?t ... sc&start=0
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

dgerow wrote:Any word on this? The Win32_runningprocs template provided in another thread[0] require a re-index method of 'Index Count Changed'. As I'd failed to notice this before adding all required devices, I now have to go through and change the method for a few hundred hosts.

[0]http://forums.cacti.net/viewtopic.php?t ... sc&start=0
Assuming you're familiar with sql or at least are using stuff like phpmyadmin, you may have a look at the table `host_snmp_query` to find the field reindex_method. You may try to play around with this on a test system of your own. It is a good idea, to do a mysqldump before.
I won't _really_ suggest using this on a production system, but this depends ... :wink:
Reinhard
dgerow
Posts: 6
Joined: Mon Aug 07, 2006 5:58 am

Post by dgerow »

Yep, that works great for the bulk update (already done and completed), but it would still be nice to not have to add a query to a device every time it's added.

I suppose an option would be to keep the runningprocs in the template, then just do bulk SQL updates every time we import new devices (another few dozen are coming in soon), but, as you said, it's not ideal for a production system.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You may post a Feature Request on this. Neither my code snippet nor the sql hint I gave will be officially supported and may change without notice.
Reinhard
User avatar
tilli
Posts: 22
Joined: Tue Jul 14, 2009 9:16 am

how to change reindex through MySQl

Post by tilli »

If you want to change the reindex value for all of the previously added devices,
it can be done through mysql using the following command

mysql> UPDATE `cacti`.`host_snmp_query` SET `reindex_method` = '2';
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests