diff --git a/pandora_console/include/functions_os.php b/pandora_console/include/functions_os.php index 64020cb6aa..19c0bb57b5 100755 --- a/pandora_console/include/functions_os.php +++ b/pandora_console/include/functions_os.php @@ -23,9 +23,10 @@ function os_agents_critical($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND critical_count>0 AND id_os=%d', $table, + $table, $id_os ) ); @@ -36,10 +37,11 @@ function os_agents_critical($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND critical_count>0 AND id_os=%d AND id_grupo IN (%s)', $table, + $table, $id_os, implode(',', $groups) ) @@ -60,9 +62,10 @@ function os_agents_ok($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND normal_count=total_count AND id_os=%d', $table, + $table, $id_os ) ); @@ -73,10 +76,11 @@ function os_agents_ok($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND normal_count=total_count AND id_os=%d AND id_grupo IN (%s)', $table, + $table, $id_os, implode(',', $groups) ) @@ -97,10 +101,11 @@ function os_agents_warning($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND critical_count=0 AND warning_count>0 AND id_os=%d', $table, + $table, $id_os ) ); @@ -111,10 +116,11 @@ function os_agents_warning($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND critical_count=0 AND warning_count>0 AND id_os=%d AND id_grupo IN (%s)', $table, + $table, $id_os, implode(',', $groups) ) @@ -135,10 +141,11 @@ function os_agents_unknown($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND critical_count=0 AND warning_count=0 AND unknown_count>0 AND id_os=%d', $table, + $table, $id_os ) ); @@ -149,10 +156,11 @@ function os_agents_unknown($id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND + WHERE %s.disabled=0 AND critical_count=0 AND warning_count=0 AND unknown_count>0 AND id_os=%d AND id_grupo IN (%s)', $table, + $table, $id_os, implode(',', $groups) ) @@ -179,7 +187,8 @@ function os_agents_total(int $id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND id_os=%d', + WHERE %s.disabled=0 AND id_os=%d', + $table, $table, $id_os ) @@ -191,7 +200,8 @@ function os_agents_total(int $id_os) sprintf( 'SELECT COUNT(*) FROM %s - WHERE tagente.disabled=0 AND id_os=%d AND id_grupo IN (%s)', + WHERE %s.disabled=0 AND id_os=%d AND id_grupo IN (%s)', + $table, $table, $id_os, implode(',', $groups)