2008-07-31 Sancho Lerena <slerena@gmail.com>
* 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
This commit is contained in:
parent
ea8d720267
commit
43efe01d86
|
@ -1,3 +1,16 @@
|
|||
|
||||
2008-07-31 Sancho Lerena <slerena@gmail.com>
|
||||
|
||||
* 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 <rnovoa@artica.es>
|
||||
|
||||
* include/help/en/help_wmiquery.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 "<p align='left'><img src='".$config["homeurl"]."/images/pandora_logo_head.png'>";
|
||||
echo "<font size=14px'><b>Pandora FMS Help System</b></font>";
|
||||
echo "</p><hr width=100% size=1><div style='font-family: verdana, arial; font-size: 11px; text-align:left'>";
|
||||
echo "<div>";
|
||||
echo "<p align=right>";
|
||||
echo "<b>Pandora FMS Help System</b></p>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<hr width=100% size=1><div style='font-family: verdana, arial; font-size: 11px; text-align:left'>";
|
||||
echo "<div style='font-size: 12px; margin-left: 30px; margin-right:25px;'>";
|
||||
include $protofile;
|
||||
echo "</div>";
|
||||
echo "<br><br><hr width=100% size=1><div style='font-family: verdana, arial; font-size: 11px;'>";
|
||||
include "footer.php";
|
||||
|
||||
}
|
||||
else
|
||||
show_help_error();
|
||||
|
|
|
@ -133,20 +133,21 @@ if ($create != ""){
|
|||
// =================================================================
|
||||
|
||||
if (($create != "") OR ($view != "")){
|
||||
|
||||
echo "<h2>".lang_string ("Plugin");
|
||||
|
||||
echo "<h2>";
|
||||
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 "</h2>";
|
||||
|
||||
if ($create == "")
|
||||
echo "<form name=plugin method='post' action='index.php?sec=galertas&sec2=godmode/alerts/plugin&update_plugin=$plugin_id'>";
|
||||
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&update_plugin=$plugin_id'>";
|
||||
else
|
||||
echo "<form name=plugin method='post' action='index.php?sec=galertas&sec2=godmode/alerts/plugin&create_plugin=1'>";
|
||||
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&create_plugin=1'>";
|
||||
|
||||
echo '<table width="600" cellspacing="4" cellpadding="4" class="databox_color">';
|
||||
|
||||
|
@ -154,16 +155,16 @@ if (($create != "") OR ($view != "")){
|
|||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_name" size=30 value="'.$form_name.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string ("Plugin command");
|
||||
echo '<td class="datos">';
|
||||
echo '<tr><td class="datos2">'.lang_string ("Plugin command");
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="form_execute" size=45 value="'.$form_execute.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string ("Max.Timeout");
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_max_timeout" size=5 value="'.$form_max_timeout.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string ("IP address option");
|
||||
echo '<td class="datos">';
|
||||
echo '<tr><td class="datos2">'.lang_string ("IP address option");
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="form_net_dst_opt" size=15 value="'.$form_net_dst_opt.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string ("Port option");
|
||||
|
@ -171,16 +172,16 @@ if (($create != "") OR ($view != "")){
|
|||
echo '<input type="text" name="form_net_port_opt" size=5 value="'.$form_net_port_opt.'"></td>';
|
||||
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string ("User option");
|
||||
echo '<td class="datos">';
|
||||
echo '<tr><td class="datos2">'.lang_string ("User option");
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="form_user_opt" size=15 value="'.$form_user_opt.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string ("Password option");
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_pass_opt" size=15 value="'.$form_pass_opt.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.$lang_label["description"].'</td>';
|
||||
echo '<td class="datos"><textarea name="form_description" cols="50" rows="4">';
|
||||
echo '<tr><td class="datos2">'.$lang_label["description"].'</td>';
|
||||
echo '<td class="datos2"><textarea name="form_description" cols="50" rows="4">';
|
||||
echo $form_description;
|
||||
echo '</textarea></td></tr>';
|
||||
|
||||
|
@ -197,12 +198,12 @@ if (($create != "") OR ($view != "")){
|
|||
}
|
||||
|
||||
else {
|
||||
// If not edition or insert, then list available plugins
|
||||
echo "<h2>".$lang_label["no_plugins"]."</h2>";
|
||||
echo "<h2>". lang_string ("Plugins registered in Pandora FMS")."</h2>";
|
||||
// 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 '<table width="530" cellspacing="4" cellpadding="4" class="databox_color">';
|
||||
echo '<table width="530" cellspacing="4" cellpadding="4" class="databox">';
|
||||
echo "<th>".lang_string("name");
|
||||
echo "<th>".lang_string("execute");
|
||||
echo "<th>".lang_string("delete");
|
||||
|
@ -218,22 +219,22 @@ else {
|
|||
}
|
||||
echo "<tr>";
|
||||
echo "<td class=$tdcolor>";
|
||||
echo "<a href='index.php?sec=galertas&sec2=godmode/alerts/plugin&view=".$row["id"]."'>";
|
||||
echo "<b><a href='index.php?sec=gservers&sec2=godmode/servers/plugin&view=".$row["id"]."'>";
|
||||
echo $row["name"];
|
||||
echo "</a>";
|
||||
echo "</a></b>";
|
||||
echo "<td class=$tdcolor>";
|
||||
echo $row["execute"];
|
||||
echo "<td class=$tdcolor>";
|
||||
echo "<a href='index.php?sec=galertas&sec2=godmode/alerts/plugin&kill_plugin=".$row["id"]."'><img src='images/cross.png' border=0></a>";
|
||||
echo "<a href='index.php?sec=gservers&sec2=godmode/servers/plugin&kill_plugin=".$row["id"]."'><img src='images/cross.png' border=0></a>";
|
||||
}
|
||||
echo "</table>";
|
||||
} else {
|
||||
echo lang_string ("There is no plugins in the system");
|
||||
echo '<div class="nf">'. lang_string ("There is no plugins in the system");
|
||||
echo "<br>";
|
||||
}
|
||||
echo "<table width=530>";
|
||||
echo "<tr><td align=right>";
|
||||
echo "<form name=plugin method='post' action='index.php?sec=galertas&sec2=godmode/alerts/plugin&create=1'>";
|
||||
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&create=1'>";
|
||||
echo "<input name='crtbutton' type='submit' class='sub wand' value='".$lang_label["create"]."'>";
|
||||
echo "</table>";
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<h1>Plugin registration</h1>
|
||||
|
||||
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.
|
||||
<br><br>
|
||||
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.
|
||||
<br><br>
|
||||
This plugin has the following interface:
|
||||
<br>
|
||||
<pre>
|
||||
informix_plugin_pandora -H ip_address -U user -P password -T tablespace -O operation
|
||||
</pre>
|
||||
<br>
|
||||
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:
|
||||
<br><br>
|
||||
|
||||
<table cellpadding=4 cellspacing=4 class=databox width=80%>
|
||||
<tr>
|
||||
<td valign='top'>Plugin Command<td>/usr/share/pandora/util/plugins/informix_plugin_pandora (default location for plugins)
|
||||
<tr>
|
||||
<td>Max_timeout:<td> 15 (for example).
|
||||
<tr>
|
||||
<td>IP Address option:<td> -H
|
||||
|
||||
<tr>
|
||||
<td>Port option<td>Let it blank
|
||||
|
||||
<tr>
|
||||
<td>User option<td>-U
|
||||
|
||||
<tr>
|
||||
<td>Password option<td>-P
|
||||
|
||||
</table>
|
||||
<br>
|
||||
|
||||
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.
|
||||
<br><br>
|
||||
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.
|
||||
<br><br>
|
||||
If you want to use another tablespace, just create another module with different string after "-T".
|
||||
<br><br>
|
||||
Of course, in "Plugin parameter" field, you can put more than one parameter. All data entered there is passed to the plugin "as is".
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue