2012-06-07 13:44:08 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2011 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// Get critical agents by using the status code in modules.
|
|
|
|
|
|
|
|
function os_agents_critical ($id_os) {
|
|
|
|
|
|
|
|
//TODO REVIEW ORACLE AND POSTGRES
|
|
|
|
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE critical_count>0 AND id_os=$id_os");
|
2012-06-07 13:44:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get ok agents by using the status code in modules.
|
|
|
|
|
|
|
|
function os_agents_ok($id_os) {
|
2012-07-12 20:10:44 +02:00
|
|
|
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE normal_count=total_count AND id_os=$id_os");
|
2012-06-07 13:44:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get warning agents by using the status code in modules.
|
|
|
|
|
|
|
|
function os_agents_warning ($id_os) {
|
2012-07-12 20:10:44 +02:00
|
|
|
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE critical_count=0 AND warning_count>0 AND id_os=$id_os");
|
2012-06-07 13:44:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get unknown agents by using the status code in modules.
|
|
|
|
|
|
|
|
function os_agents_unknown ($id_os) {
|
2012-07-12 20:10:44 +02:00
|
|
|
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE critical_count=0 AND warning_count=0 AND unknown_count>0 AND id_os=$id_os");
|
2012-06-07 13:44:08 +02:00
|
|
|
}
|
|
|
|
|
2012-11-26 17:44:41 +01:00
|
|
|
// Get the name of a group given its id.
|
|
|
|
function os_get_name ($id_os) {
|
|
|
|
return db_get_value ('name', 'tconfig_os', 'id_os', (int) $id_os);
|
|
|
|
}
|
|
|
|
|
2012-06-07 13:44:08 +02:00
|
|
|
?>
|