getComponents($device_id, $options);
$response[] = array(
'id' => '',
'label' => ' ',
'status' => ' ',
'disable' => '',
'ignore' => '',
);
foreach ($COMPONENTS[$device_id] as $ID => $AVP) {
if ($AVP['status'] == 0) {
$class = "green";
$status = "Ok";
} elseif ($AVP['status'] == 1) {
$class = "grey";
$status = "Warning";
} else {
// Critical
$class = "red";
$status = "Critical";
}
$response[] = array(
'id' => $ID,
'type' => $AVP['type'],
'label' => $AVP['label'],
'status' => "".$status."",
'disable' => '',
'ignore' => '',
);
}//end foreach
$output = array(
'current' => $current,
'rowCount' => $rowCount,
'rows' => $response,
'total' => count($COMPONENTS[$device_id]),
);
echo _json_encode($output);