From 2f2ec46b1cc998ad8b0e08cffae76a62642dc997 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 31 Jul 2008 16:14:04 +0000 Subject: [PATCH] 2008-07-31 Sancho Lerena * include/help/en/help_plugin_definition.php: New help page for plugin register section. * include/javascript/pandora.js: Help window now shows scrollbar. * general/pandora_help.php: Better layout for help system. * godmode/servers/plugin.php: Fixed position / menu issues and other menor bugs in plugin editor. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@993 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 13 +++++ pandora_console/general/pandora_help.php | 14 ++++-- pandora_console/godmode/servers/plugin.php | 45 ++++++++--------- .../help/en/help_plugin_definition.php | 49 +++++++++++++++++++ pandora_console/include/javascript/pandora.js | 2 +- 5 files changed, 97 insertions(+), 26 deletions(-) create mode 100644 pandora_console/include/help/en/help_plugin_definition.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 59a75d409c..86d4582fc1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ + +2008-07-31 Sancho Lerena + + * include/help/en/help_plugin_definition.php: New help page for + plugin register section. + + * include/javascript/pandora.js: Help window now shows scrollbar. + + * general/pandora_help.php: Better layout for help system. + + * godmode/servers/plugin.php: Fixed position / menu issues and other + menor bugs in plugin editor. + 2008-07-31 Ramon Novoa * include/help/en/help_wmiquery.php, diff --git a/pandora_console/general/pandora_help.php b/pandora_console/general/pandora_help.php index 1840380439..557168a552 100644 --- a/pandora_console/general/pandora_help.php +++ b/pandora_console/general/pandora_help.php @@ -15,10 +15,18 @@ if (isset($_GET["id"])) { $id = $_GET["id"]; $protofile = $config["homedir"]."/include/help/".$config["language"]."/help_".$id.".php"; if (file_exists ($protofile)){ - echo "

"; - echo "Pandora FMS Help System"; - echo "


"; + echo "
"; + echo "

"; + echo "Pandora FMS Help System

"; + echo "
"; + + echo "
"; + echo "
"; include $protofile; + echo "
"; + echo "


"; + include "footer.php"; + } else show_help_error(); diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 16ada108a1..c8fb368ee1 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -133,20 +133,21 @@ if ($create != ""){ // ================================================================= if (($create != "") OR ($view != "")){ - - echo "

".lang_string ("Plugin"); + + echo "

"; if ($create != "") - echo lang_string ("creation"); + echo lang_string ("Plugin creation"); else { - echo lang_string ("update"); + echo lang_string ("Plugin update"); $plugin_id = get_parameter ("view",""); } + pandora_help("plugin_definition"); echo "

"; if ($create == "") - echo "
"; + echo ""; else - echo ""; + echo ""; echo ''; @@ -154,16 +155,16 @@ if (($create != "") OR ($view != "")){ echo ''; - echo ''; echo ''; - echo ''; echo ''; - echo ''; echo ''; - echo ''; - echo ''; @@ -197,12 +198,12 @@ if (($create != "") OR ($view != "")){ } else { -// If not edition or insert, then list available plugins - echo "

".$lang_label["no_plugins"]."

"; + echo "

". lang_string ("Plugins registered in Pandora FMS")."

"; + // If not edition or insert, then list available plugins $sql1='SELECT * FROM tplugin ORDER BY name'; $result=mysql_query($sql1); if (mysql_num_rows($result) > 0){ - echo '
'; echo '
'.lang_string ("Plugin command"); - echo ''; + echo '
'.lang_string ("Plugin command"); + echo ''; echo '
'.lang_string ("Max.Timeout"); echo ''; echo '
'.lang_string ("IP address option"); - echo ''; + echo '
'.lang_string ("IP address option"); + echo ''; echo '
'.lang_string ("Port option"); @@ -171,16 +172,16 @@ if (($create != "") OR ($view != "")){ echo '
'.lang_string ("User option"); - echo ''; + echo '
'.lang_string ("User option"); + echo ''; echo '
'.lang_string ("Password option"); echo ''; echo '
'.$lang_label["description"].'
'; + echo '
'; echo ""; echo "
".lang_string("name"); echo "".lang_string("execute"); echo "".lang_string("delete"); @@ -218,22 +219,22 @@ else { } echo "
"; - echo ""; + echo ""; echo $row["name"]; - echo ""; + echo ""; echo ""; echo $row["execute"]; echo ""; - echo ""; + echo ""; } echo "
"; } else { - echo lang_string ("There is no plugins in the system"); + echo '
'. lang_string ("There is no plugins in the system"); echo "
"; } echo ""; echo "
"; - echo ""; + echo ""; echo ""; echo "
"; diff --git a/pandora_console/include/help/en/help_plugin_definition.php b/pandora_console/include/help/en/help_plugin_definition.php new file mode 100644 index 0000000000..8b1200fb23 --- /dev/null +++ b/pandora_console/include/help/en/help_plugin_definition.php @@ -0,0 +1,49 @@ +

Plugin registration

+ +Pandora FMS Plugin registration tool is used to define what parameters needs Pandora FMS Plugin server to use in each plugin, and what kind of data pass after that parameter. +

+For example, you have a plugin to check Informix tablespace called "Aleph", under IP address "192.168.50.2" and with username "Calabria" and password "malcolm45". This plugin could return if tablespace it's ok, number of queries per second, load, fragmentation level and memory usage. +

+This plugin has the following interface: +
+
+	informix_plugin_pandora -H ip_address -U user -P password -T tablespace -O operation
+
+
+Operation could be status, qps, load, fragment and memory. It returns a single value, used by Pandora FMS. To define this plugin in pandora, you need to fill fields in this way: +

+ + + + + + + + +
Plugin Command/usr/share/pandora/util/plugins/informix_plugin_pandora (default location for plugins) +
Max_timeout: 15 (for example). +
IP Address option: -H + +
Port optionLet it blank + +
User option-U + +
Password option-P + +
+
+ +When you need to create a module that uses this plugin, you need to choose plugin (this new plugin will apear in the combo to select it). And you only need to fill IP Address, Username, and Password. Pandora FMS will put this data into appopiate fields when exec external plugin. +

+There is always some kind of parameters that cannot be "generic", in this example, you have "tablespace" parameter. This is very particular for Informix, but each example could have it's own exception. You have a field called "Plugin parameter", that it's used to pass "as is" to the plugin. In this particular case you need to put "-T tablespace" there. +

+If you want to use another tablespace, just create another module with different string after "-T". +

+Of course, in "Plugin parameter" field, you can put more than one parameter. All data entered there is passed to the plugin "as is". + + + + + + + diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 37a77b7a1f..7b4143f2be 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -15,7 +15,7 @@ function winopeng (url, wid) { } function pandora_help(help_id) { - open ("general/pandora_help.php?id="+help_id, "pandorahelp", "width=600,height=500,status=no,toolbar=no,menubar=no,scrollbar=yes"); + open ("general/pandora_help.php?id="+help_id, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0"); } /**