Validation error, when instaling my own personal plugin

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Developers, Moderators

Post Reply
User avatar
h3ct0r
Posts: 4
Joined: Wed Oct 13, 2010 8:06 pm

Validation error, when instaling my own personal plugin

Post by h3ct0r »

Hi everyone, im using the lastest release of cacti and PA.
Im developing a plugin for my thesis and i cant install it. the error that cacti is showing me is, on a blanc page "Validation error.". The url of this page is "http://localhost/cacti/plugins.php?mode ... ector_test".

The setup.php of my plugin is this:

Code: Select all

<?php
//function plugin_init_hector_test() {
//        global $plugin_hooks;
//        $plugin_hooks['top_header_tabs']['hector_test'] = 'hector_test_show_tab';
//}


function plugin_hector_test_install () {
	global $config;
	api_plugin_register_hook('hector_test', 'top_header_tabs', 'hector_test_show_tab', 'setup.php');
	api_plugin_register_hook('hector_test', 'top_graph_header_tabs', 'hector_test_show_tab', 'setup.php');
}

function plugin_thold_uninstall () {
	// Do any extra Uninstall stuff here
}

function hector_test_version () {
	return plugin_hector_test_version();
}

function plugin_hector_test_version () {
	return array(	
			'name'		=> 'hector_test',
			'version' 	=> '0.0.1',
			'longname'	=> 'hector_test',
			'author'		=> 'Hector AZP',
			'homepage'	=> 'hector_test',
			'email'		=> 'xxxxxxx@gmail.com',
			'url'			=> 'hector_test'
			);
}

function plugin_hector_test_check_config () {
	return true;
}

function hector_test_show_tab () {
	global $config;
	$cp = false;
	if (basename($_SERVER['PHP_SELF']) == 'index.php' || basename($_SERVER['PHP_SELF']) == 'setup.php'){
	       	$cp = true;}
	print '<a href="' . $config['url_path'] . 'plugins/hector_test/setup.php"><img src="' . $config['url_path'] . 'plugins/hector_test/imagenes/tab_hector_test' . ($cp ? '_down': '') . '.gif" alt="hector_test" align="absmiddle" border="0"></a>';
}

?>
Can anybody tell me what im forgotten? ]
Thanks in advice.
Last edited by h3ct0r on Fri Aug 05, 2011 2:53 pm, edited 1 time in total.
User avatar
h3ct0r
Posts: 4
Joined: Wed Oct 13, 2010 8:06 pm

Re: Validation error, when instaling my own personal plugin

Post by h3ct0r »

When i use the old function plugin_init_hector_test(), it works!
But what im doing wrong with the new metod ?

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

Re: Validation error, when instaling my own personal plugin

Post by TheWitness »

Maybe it's the underscore in the plugin name. What are your cacti versions and PIA versions?

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?
User avatar
h3ct0r
Posts: 4
Joined: Wed Oct 13, 2010 8:06 pm

Re: Validation error, when instaling my own personal plugin

Post by h3ct0r »

Hi TheWitness, thanks for the fast reply, the versions are :
Cacti Version: 0.8.7g, Plugin Architecture Version: 2.8!
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Validation error, when instaling my own personal plugin

Post by TheWitness »

Send along the plugin, and ill see what's goofy.

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?
User avatar
h3ct0r
Posts: 4
Joined: Wed Oct 13, 2010 8:06 pm

Re: Validation error, when instaling my own personal plugin

Post by h3ct0r »

Hi TheWitness, thanks for reply!
I did found the error ... i didnt registrer the realm!!!
This code work for me:
api_plugin_register_realm('hector_test', 'hector_test.php', 'View hector_test plugin', 1);
Thanks for the help!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests