import socket


def line_protocol(temperature):
    """Create a InfluxDB line protocol with structure:

        iot_sensor,hostname=mine_sensor_12,type=temperature value=68

    :param temperature: the sensor temperature
    :return: Line protocol to write into InfluxDB
    """

    return 'iot_sensor,hostname={},type=temperature value={}'.format(socket.gethostname(), temperature)