def sql_ping(host):
    """Connect to SQL Server instance and return version string"""

    sql = 'SELECT @@VERSION'
    rows = execute_sql(host, sql)
    if type(rows) is dict: return rows

    message = rows[0][0]

    return {'code':'OK', 'msg': message}
Connect to SQL Server instance and return version string
recipes/Python/577599_Nagios_plugmonitoring_database/recipe-577599.py