code: def check_basic_battery_status(the_session, the_helper, the_snmp_value):
      
  
      apc_battery_states = {
          '1' : 'unknown',
          '2' : 'batteryNormal',
          '3' : 'batteryLow',
          '4' : 'batteryInFaultCondition'
          }
      a_state = apc_battery_states.get(the_snmp_value, 'unknown')
  
      if the_snmp_value == '2':
          the_helper.add_status(pynag.Plugins.ok)
      elif the_snmp_value == '3':
          the_helper.add_status(pynag.Plugins.warning)
      else:
          the_helper.add_status(pynag.Plugins.critical)
  
      the_helper.set_summary("UPS batteries state is {}".format(a_state))
docs: OID .1.3.6.1.4.1.318.1.1.1.2.1.1.0
      MIB Excerpt 
      The status of the UPS batteries.  A batteryLow(3) 
      value indicates the UPS will be unable to sustain the 
      current load, and its services will be lost if power is 
      not restored.  The amount of run time in reserve at the 
      time of low battery can be configured by the 
      upsAdvConfigLowBatteryRunTime.
  
      Value List
      unknown (1)
      batteryNormal (2)
      batteryLow (3)
      batteryInFaultCondition (4)