";
echo "
" . $label;
echo " | " . $data;
echo " | ";
echo "";
}
}
$console_mode = 1;
if (!isset($argc))
$console_mode = 0;
if ($console_mode == 1) {
echo "\nPandora FMS PHP diagnostic tool v1.0 (c) Artica ST 2009 \n";
if ($argc == 1 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) {
echo "\nThis command line script gives information about Pandora FMS database.
This program only can be executed from console, and need a parameter, the
full path to Pandora FMS 'config.php' file.
Usage:
php pandora_diag.php path_to_pandora_console
Example:
php pandora_diag.php /var/www/pandora_console
";
exit;
}
include $argv[1]."/include/config.php";
} else {
session_start ();
include "../include/config.php";
global $config;
// Not from console, this is a web session
if ((!isset($config["id_user"])) OR (!check_acl ($config["id_user"], 0, "PM"))) {
echo "You don't have privileges to use diagnostic tool
";
echo "Please login with an administrator account before try to use this tool
";
exit;
}
echo "Pandora FMS Diag tool v3.0.0
";
echo "
";
echo "";
echo "Table/Item | ";
echo "Data items |
";
}
render_row ($build_version, "Pandora FMS Build");
render_row ($pandora_version, "Pandora FMS Version");
render_row ($config["homedir"], "Homedir");
render_row ($config["homeurl"], "HomeUrl");
render_info ("tagente");
render_info ("tagent_access");
render_info ("tagente_datos");
render_info ("tagente_datos_string");
render_info ("tagente_estado");
render_info ("tagente_modulo");
render_info ("talert_actions");
render_info ("talert_commands");
render_info ("talert_template_modules");
render_info ("talert_snmp");
render_info ("tevento");
render_info ("tlayout");
render_info ("tlocal_component");
render_info ("tplanned_downtime");
render_info ("tplugin");
render_info ("trecon_task");
render_info ("tserver");
render_info ("treport");
render_info ("ttrap");
render_info ("tusuario");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'customer_key';", "Update Key");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'keygen_path'", "Keygen path");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'current_update'", "Current Update #");
if ($console_mode == 0) {
echo "
";
}
?>