mysql> select a.host_object_id, a.display_name, b.host_object_id, b.service_object_id, b.display_name from icinga_hosts as a, icinga_services as b where a.host_object_id = b.host_object_id and a.display_name='test-1' and b.display_name='ssh'; +----------------+--------------+----------------+-------------------+--------------+ | host_object_id | display_name | host_object_id | service_object_id | display_name | +----------------+--------------+----------------+-------------------+--------------+ | 55 | test-1 | 55 | 74 | ssh | +----------------+--------------+----------------+-------------------+--------------+ 1 row in set (0.00 sec) mysql> select * from icinga_statehistory; +-----------------+-------------+---------------------+-----------------+-----------+--------------+-------+------------+-----------------------+--------------------+------------+-----------------+--------------------------------------+-------------+--------------+--------------------+ | statehistory_id | instance_id | state_time | state_time_usec | object_id | state_change | state | state_type | current_check_attempt | max_check_attempts | last_state | last_hard_state | output | long_output | check_source | endpoint_object_id | +-----------------+-------------+---------------------+-----------------+-----------+--------------+-------+------------+-----------------------+--------------------+------------+-----------------+--------------------------------------+-------------+--------------+--------------------+ | 1 | 1 | 2015-04-10 08:06:38 | 457462 | 74 | 1 | 2 | 0 | 2 | 3 | 0 | 0 | Connection refused | | graphite-2 | 1 | | 2 | 1 | 2015-04-10 08:06:38 | 469619 | 74 | 1 | 2 | 1 | 1 | 3 | 2 | 2 | Connection refused | | graphite-2 | 1 | | 3 | 1 | 2015-04-10 08:06:38 | 490376 | 74 | 1 | 0 | 1 | 1 | 3 | 2 | 0 | SSH OK - OpenSSH_5.3 (protocol 2.0) | | graphite-2 | 1 | +-----------------+-------------+---------------------+-----------------+-----------+--------------+-------+------------+-----------------------+--------------------+------------+-----------------+--------------------------------------+-------------+--------------+--------------------+