How delete custom data from custom Databases?

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Developers, Moderators

Post Reply
mercolino
Posts: 25
Joined: Wed Aug 29, 2007 6:14 pm

How delete custom data from custom Databases?

Post by mercolino »

Hi, i am trying to write a plugin and i have some troubles about how to delete custom data from custom tables. For example when a device is created I write some custom data in a custom table created just for this plugin.

But when I delete the device choosing actions I can't delete the data wrote by the plugin to the database related to de device that I want to delete. I thought that maybe device_action_execute could do the job, but with a quick review to host.php is called only when you add something new to the actions array and do not work with the default actions...

There is a way to do this or a workaraund or someone had the same problem and manage to get through of this?


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

Post by TheWitness »

Please send a PM to Cigamit. I have the same issue presently with another plugin development and need the same hook.

However, Cigamit needs to add to other sections of the code (hosts, data sources, graphs), and needs to do this consistently.

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?
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

There currently isn't a hook for everything, as they have been added on an as needed basis so far. I will see about adding a hook for the next PA to do this.

An easy work around would be to hook into top_header, page_header, etc... and check for the correct page and $_REQUEST variable combination, then remove the items you need to remove.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest