changing device ID number?

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

Moderators: Developers, Moderators

Post Reply
westsyde
Posts: 23
Joined: Tue Sep 23, 2008 12:44 pm

changing device ID number?

Post by westsyde »

Is there a way to change a device ID to a different number, for example if I added a device which had a low device ID and then deleted it, could I change another device's ID number to that now unused device ID number?
ee99ee
Posts: 20
Joined: Sun Oct 18, 2009 9:07 am

Post by ee99ee »

A lot of database queries.... in short, no

-Chris
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Why would you ever want to do such a thing anyways?
westsyde
Posts: 23
Joined: Tue Sep 23, 2008 12:44 pm

Post by westsyde »

I have a bunch of devices that I added that connect via VPN, so when the internet pipe becomes highly utilized I notice that devices with IDs higher than the VPN devices will not get graphed before the poller times out, whereas the ones with a lower ID do get graphed. I know I could delete and re-add the VPN devices but was hoping to make changes to one instead of say, 75-100.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yep, that's a known drawback. And there's no general help. Your idea is quite correct and I did so some months ago. I will see to publish my "script" in case I find it ...
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Here is, what I've come up with (old host id =1121, new host id = 4):

Code: Select all

update data_local set data_local.host_id=4 where data_local.host_id=1121;
update graph_local set graph_local.host_id=4 where graph_local.host_id=1121;
update graph_tree_items set graph_tree_items.host_id=4 where graph_tree_items.host_id=1121;
update host set host.id=4 where host.id=1121;
update host_graph set host_graph.host_id=4 where host_graph.host_id=1121;
update host_snmp_cache set host_snmp_cache.host_id=4 where host_snmp_cache.host_id=1121;
update host_snmp_query set host_snmp_query.host_id=4 where host_snmp_query.host_id=1121;
update poller_item set poller_item.host_id=4 where poller_item.host_id=1121;
update poller_reindex set poller_reindex.host_id=4 where poller_reindex.host_id=1121;
This is on your own risk!
R.
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This scares me....
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?
westsyde
Posts: 23
Joined: Tue Sep 23, 2008 12:44 pm

Post by westsyde »

Thank you gandalf I will try this out on my lab cacti environment.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

TheWitness wrote:This scares me....
of course. But we need a better "load balancing". Remember discussion at San Jose? But for that, we need timings for polling, IMHO.
spine now accepts a host list, that's fine. But cmd.php doesn't.
But how to "compute" that list without timings?
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests