def METHOD_NAME(self, event=None):
    stat = DiagnosticStatus()
    stat.level = DiagnosticStatus.WARN
    stat.name = '%s NTP Offset' % self.diag_hostname
    stat.message = 'No Data'
    stat.hardware_id = self.diag_hostname
    stat.values = []
    try:
        for st,host,off in [(stat, self.ntp_server, self.offset)]:
            p = Popen(["ntpdate", "-q", host], stdout=PIPE, stdin=PIPE, stderr=PIPE)
            retcode = p.wait()
            stdout, stderr = p.communicate()
            try:
                stdout = stdout.decode()  #python3
                stderr = stderr.decode()  #python3
            except (UnicodeDecodeError, AttributeError):
                pass
            if retcode != 0:
                st.level = DiagnosticStatus.ERROR
                st.message = 'ntpdate Error'
                st.values = [ KeyValue(key = 'ntpdate Error', value = stderr),
                              KeyValue(key = 'Output', value = stdout) ]
                continue
            measured_offset = float(re.search("offset (.*),", stdout).group(1))*1000000
            st.level = DiagnosticStatus.OK
            st.message = "OK"
            st.values = [ KeyValue("NTP Server" , self.ntp_server),
                          KeyValue("Offset (us)", str(measured_offset)),
                          KeyValue("Offset tolerance (us)", str(off)),
                          KeyValue("Offset tolerance (us) for Error", str(self.error_offset)) ]
            if (abs(measured_offset) > off):
                st.level = DiagnosticStatus.WARN
                st.message = "NTP Offset Too High"
            if (abs(measured_offset) > self.error_offset):
                st.level = DiagnosticStatus.ERROR
                st.message = "NTP Offset Too High"
    except Exception as e:
        stat.level = DiagnosticStatus.ERROR
        stat.message = 'ntpdate Exception'
        stat.values = [ KeyValue(key = 'Exception', value = str(e)), KeyValue(key = 'Traceback', value = str(traceback.format_exc())) ]
    self.msg = DiagnosticArray()
    self.msg.header.stamp = rospy.get_rostime()
    self.msg.status = [stat]