code: def check_battery_replace_indicator(the_session, the_helper, the_snmp_value):
      
  
      apc_states = {
          '1' : 'Battery does not need to be replaced',
          '2' : 'Battery needs to be replaced!'}
      a_state = apc_states.get(the_snmp_value, "Unknown battery replacement state!")
  
      if the_snmp_value == '1':
          the_helper.add_status(pynag.Plugins.ok)
      else:
          the_helper.add_status(pynag.Plugins.critical)
  
      the_helper.set_summary(a_state)
docs: OID .1.3.6.1.4.1.318.1.1.1.2.2.4.0
      MIB Excerpt
      Indicates whether the UPS batteries need replacing.
      Value List
      noBatteryNeedsReplacing (1)
      batteryNeedsReplacing (2)