def check_ps():    
    """
    Check if the power supplies are ok, and we have the configured amount
    The check is skipped if --ps=0
    """
    if int(input_pwr_sply) != 0:        
        ps_data = walk_data(sess, oid_ps, helper)[0]
        ps_ok_count = 0
        
        for x, state in enumerate(ps_data, 1):
            # human readable status
            hr_status = normal_state[int(state)]
            if  hr_status != "ok":
                # if the power supply is ok, we will set a critical status and add it to the summary
                helper.add_summary('Power supply status %s: %s' % (x, hr_status))
                helper.status(critical)
            else:
                # if everything is ok, we increase the ps_ok_count
                ps_ok_count += 1
            
            # we always want to see the status in the long output
            helper.add_long_output('Power supply status %s: %s' % (x, hr_status))
        helper.add_long_output('')

        if int(input_pwr_sply) != ps_ok_count:
            # if the confiugred power supplies and power supplies in ok state are different
            helper.add_summary('%s power supplies expected - %s power supplies ok ' % (input_pwr_sply, ps_ok_count))
            helper.status(critical)