Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Jul 28, 2017 12:07 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Action for create_complete_graph_from_template
PostPosted: Tue Feb 21, 2012 5:17 am 
Offline

Joined: Wed Feb 23, 2011 11:53 am
Posts: 41
Hy,
i want to add an action after creation of graph, so in my own plugin i've created a hook for create_complete_graph_from_template :

Code:
api_plugin_register_hook('addGraph', 'create_complete_graph_from_template', 'addGraph_create_complete_graph_from_template', 'addGraph_actions.php');


and the function is :

Code:
function addGraph_create_complete_graph_from_template($data) {
   global $config;

  cacti_log( __FUNCTION__." : ".serialize($data) );

}


but, when i had a grpah to a device, i have this in the cacti log :

02/21/2012 11:14:02 AM - CMDPHP: Poller[0] addGraph_create_complete_graph_from_template : N;

why only "N;" ?

my system : Win32box, cacti 0.8.7i, automn8 and more plugins

_________________
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47


Top
 Profile  
 
 Post subject: Re: Action for create_complete_graph_from_template
PostPosted: Tue Feb 21, 2012 4:47 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Which is the sequence of your plugins? Please make your plugin topmost and retry. In case this works for your plugin, AUTOM8 will break and I will know how to fix that.
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Action for create_complete_graph_from_template
PostPosted: Wed Feb 22, 2012 4:07 am 
Offline

Joined: Wed Feb 23, 2011 11:53 am
Posts: 41
hy,

gandalf wrote:
Which is the sequence of your plugins? Please make your plugin topmost and retry. In case this works for your plugin, AUTOM8 will break and I will know how to fix that.
R.


how can i see this sequence, how can i put my plugin topmost ?

Laurent

_________________
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47


Top
 Profile  
 
 Post subject: Re: Action for create_complete_graph_from_template
PostPosted: Wed Feb 22, 2012 12:44 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Select "Plugin Management" and select "Load Order" column. Then, move your plugin to the top
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Action for create_complete_graph_from_template
PostPosted: Thu Feb 23, 2012 4:11 am 
Offline

Joined: Wed Feb 23, 2011 11:53 am
Posts: 41
gandalf wrote:
Select "Plugin Management" and select "Load Order" column. Then, move your plugin to the top
R.


thanks.

So i've put my plugin on topmost, and modify my code, and now, it's OK.

my code is :

Code:
function addGraph_create_complete_graph_from_template($data) {
   global $config;

  cacti_log( __FUNCTION__." : ".serialize($data) );
 
  return( $data );
}


my new code is the
Code:
return( $data );


without this, i think that other hook for create_complete_graph_from_template won't work.

the function autom8_hook_graph_create_tree($data) doesn't do the same thing, perhaps the pb is here, no ?


Laurent

_________________
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47


Top
 Profile  
 
 Post subject: Re: Action for create_complete_graph_from_template
PostPosted: Thu Feb 23, 2012 3:56 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
lorenplak wrote:
the function autom8_hook_graph_create_tree($data) doesn't do the same thing, perhaps the pb is here, no ?
This is exactly what I wanted to find out. You've got it! And the workaround using the plugin load order will help in the meantime.
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Action for create_complete_graph_from_template
PostPosted: Thu Feb 23, 2012 4:19 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
gandalf wrote:
lorenplak wrote:
the function autom8_hook_graph_create_tree($data) doesn't do the same thing, perhaps the pb is here, no ?
This is exactly what I wanted to find out. You've got it! And the workaround using the plugin load order will help in the meantime.
R.

Patch is in
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group