battery monitoring script