<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_accesspoints(sess):
 """ check the status of all connected access points """

    ap_names              = walk_data(sess, name_ap_oid, helper)[0]
    ap_operationals       = walk_data(sess, operational_ap_oid, helper)[0]
    ap_availabilitys      = walk_data(sess, availability_ap_oid, helper)[0]
    ap_alarms             = walk_data(sess, alarm_ap_oid, helper)[0]
    #ap_ip                = walk_data(sess, ip_ap_oid, helper) # no result
    
    helper.add_summary("Access Points Status")

    for x in range(len(ap_names)):
        ap_name              = ap_names[x]
        ap_operational       = ap_operationals[x]
        ap_availability      = ap_availabilitys[x]
        ap_alarm             = ap_alarms[x]               

        # Add all states to the long output
        helper.add_long_output("%s - Operational: %s - Availabilty: %s - Alarm: %s" % (ap_name, operational_states[int(ap_operational)], availability_states[int(ap_availability)], alarm_states[int(ap_alarm)]))

        # Operational State
        if ap_operational != "1" and ap_operational != "4":
            helper.status(critical)
            helper.add_summary("%s Operational State: %s" % (ap_name, operational_states[int(ap_operational)]))

        # Avaiability State
        if ap_availability != "3":
            helper.status(critical)
            helper.add_summary("%s Availability State: %s" % (ap_name, availability_states[int(ap_availability)]))

        # Alarm State
        if ap_alarm == "2":
            helper.status(warning)
            helper.add_summary("%s Controller Alarm State: %s" % (ap_name, alarm_states[int(ap_alarm)]))
        
        if ap_alarm == "3" or ap_alarm == "4":
            helper.status(critical)
            helper.add_summary("%s Controller Alarm State: %s" % (ap_name, alarm_states[int(ap_alarm)]))