$value[0], 'state_descr' => $value[1], 'state_draw_graph' => $value[2], 'state_value' => $value[3], 'state_generic_value' => $value[4] ); dbInsert($insert, 'state_translations'); } // get fans (6) and temp (5) sensor only from walk $ers_sensors = array(); foreach ($oid as $key => $value) { if ($key[s5ChasComGrpIndx] == 5 || $key[s5ChasComGrpIndx] == 6) { $ers_sensors[$key] = $value; } } foreach ($ers_sensors as $index => $entry) { //Get unit number $unit_array = explode(".", $index); $unit = floor($unit_array[1]/10); $descr = "Unit $unit: $entry[s5ChasComDescr]"; //Discover Sensors discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, "s5ChasComOperState.$index", $state_name, $descr, '1', '1', null, null, null, null, $entry[s5ChasComOperState]); //Create Sensor To State Index create_sensor_to_state_index($device, $state_name, "s5ChasComOperState.$index"); } } }