#11551 Fixed os quick in metaconsole

This commit is contained in:
Daniel Maya 2023-06-13 16:34:06 +02:00
parent 6a941f6cda
commit b31a8f23ca

View File

@ -23,9 +23,10 @@ function os_agents_critical($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
critical_count>0 AND id_os=%d', critical_count>0 AND id_os=%d',
$table, $table,
$table,
$id_os $id_os
) )
); );
@ -36,10 +37,11 @@ function os_agents_critical($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
critical_count>0 AND critical_count>0 AND
id_os=%d AND id_grupo IN (%s)', id_os=%d AND id_grupo IN (%s)',
$table, $table,
$table,
$id_os, $id_os,
implode(',', $groups) implode(',', $groups)
) )
@ -60,9 +62,10 @@ function os_agents_ok($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
normal_count=total_count AND id_os=%d', normal_count=total_count AND id_os=%d',
$table, $table,
$table,
$id_os $id_os
) )
); );
@ -73,10 +76,11 @@ function os_agents_ok($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
normal_count=total_count AND normal_count=total_count AND
id_os=%d AND id_grupo IN (%s)', id_os=%d AND id_grupo IN (%s)',
$table, $table,
$table,
$id_os, $id_os,
implode(',', $groups) implode(',', $groups)
) )
@ -97,10 +101,11 @@ function os_agents_warning($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
critical_count=0 AND warning_count>0 critical_count=0 AND warning_count>0
AND id_os=%d', AND id_os=%d',
$table, $table,
$table,
$id_os $id_os
) )
); );
@ -111,10 +116,11 @@ function os_agents_warning($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
critical_count=0 AND warning_count>0 AND critical_count=0 AND warning_count>0 AND
id_os=%d AND id_grupo IN (%s)', id_os=%d AND id_grupo IN (%s)',
$table, $table,
$table,
$id_os, $id_os,
implode(',', $groups) implode(',', $groups)
) )
@ -135,10 +141,11 @@ function os_agents_unknown($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
critical_count=0 AND warning_count=0 AND critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=%d', unknown_count>0 AND id_os=%d',
$table, $table,
$table,
$id_os $id_os
) )
); );
@ -149,10 +156,11 @@ function os_agents_unknown($id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND WHERE %s.disabled=0 AND
critical_count=0 AND warning_count=0 AND critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=%d AND id_grupo IN (%s)', unknown_count>0 AND id_os=%d AND id_grupo IN (%s)',
$table, $table,
$table,
$id_os, $id_os,
implode(',', $groups) implode(',', $groups)
) )
@ -179,7 +187,8 @@ function os_agents_total(int $id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s FROM %s
WHERE tagente.disabled=0 AND id_os=%d', WHERE %s.disabled=0 AND id_os=%d',
$table,
$table, $table,
$id_os $id_os
) )
@ -191,7 +200,8 @@ function os_agents_total(int $id_os)
sprintf( sprintf(
'SELECT COUNT(*) 'SELECT COUNT(*)
FROM %s 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, $table,
$id_os, $id_os,
implode(',', $groups) implode(',', $groups)