def autoconf(self): """Implements Munin Plugin Auto-Configuration Option. @return: True if plugin can be auto-configured, False otherwise. """ ntpinfo = NTPinfo() stats = ntpinfo.getPeerStats() return len(stats) > 0
def autoconf(self): """Implements Munin Plugin Auto-Configuration Option. @return: True if plugin can be auto-configured, False otherwise. """ ntpinfo = NTPinfo() ntpstats = ntpinfo.getHostOffsets(self._remoteHosts) return len(ntpstats) > 0
def retrieveVals(self): """Retrieve values for graphs.""" ntpinfo = NTPinfo() stats = ntpinfo.getPeerStats() if stats: if self.hasGraph("ntp_peer_stratum"): self.setGraphVal("ntp_peer_stratum", "stratum", stats.get("stratum")) if self.hasGraph("ntp_peer_stats"): self.setGraphVal("ntp_peer_stats", "offset", stats.get("offset")) self.setGraphVal("ntp_peer_stats", "delay", stats.get("delay")) self.setGraphVal("ntp_peer_stats", "jitter", stats.get("jitter"))
def retrieveVals(self): """Retrieve values for graphs.""" ntpinfo = NTPinfo() stats = ntpinfo.getHostOffset(self._remoteHost) if stats: graph_name = 'ntp_host_stratum_%s' % self._remoteHost if self.hasGraph(graph_name): self.setGraphVal(graph_name, 'stratum', stats.get('stratum')) graph_name = 'ntp_host_stat_%s' % self._remoteHost if self.hasGraph(graph_name): self.setGraphVal(graph_name, 'offset', stats.get('offset')) self.setGraphVal(graph_name, 'delay', stats.get('delay'))
def retrieveVals(self): """Retrieve values for graphs.""" ntpinfo = NTPinfo() stats = ntpinfo.getPeerStats() if stats: if self.hasGraph('ntp_peer_stratum'): self.setGraphVal('ntp_peer_stratum', 'stratum', stats.get('stratum')) if self.hasGraph('ntp_peer_stats'): self.setGraphVal('ntp_peer_stats', 'offset', stats.get('offset')) self.setGraphVal('ntp_peer_stats', 'delay', stats.get('delay')) self.setGraphVal('ntp_peer_stats', 'jitter', stats.get('jitter'))
def retrieveVals(self): """Retrieve values for graphs.""" ntpinfo = NTPinfo() ntpstats = ntpinfo.getHostOffsets(self._remoteHosts) if ntpstats: for host in self._remoteHosts: hostkey = re.sub("\.", "_", host) hoststats = ntpstats.get(host) if hoststats: if self.hasGraph("ntp_host_stratums"): self.setGraphVal("ntp_host_stratums", hostkey, hoststats.get("stratum")) if self.hasGraph("ntp_host_offsets"): self.setGraphVal("ntp_host_offsets", hostkey, hoststats.get("offset")) if self.hasGraph("ntp_host_delays"): self.setGraphVal("ntp_host_delays", hostkey, hoststats.get("delay"))
def retrieveVals(self): """Retrive values for graphs.""" ntpinfo = NTPinfo() ntpstats = ntpinfo.getHostOffsets(self._remoteHosts) if ntpstats: for host in self._remoteHosts: hostkey = re.sub('\.', '_', host) hoststats = ntpstats.get(host) if hoststats: if self.hasGraph('ntp_host_stratums'): self.setGraphVal('ntp_host_stratums', hostkey, hoststats.get('stratum')) if self.hasGraph('ntp_host_offsets'): self.setGraphVal('ntp_host_offsets', hostkey, hoststats.get('offset')) if self.hasGraph('ntp_host_delays'): self.setGraphVal('ntp_host_delays', hostkey, hoststats.get('delay'))
def retrieveVals(self): """Retrieve values for graphs.""" ntpinfo = NTPinfo() ntpstats = ntpinfo.getHostOffsets(self._remoteHosts) if ntpstats: for host in self._remoteHosts: hostkey = re.sub('\.', '_', host) hoststats = ntpstats.get(host) if hoststats: if self.hasGraph('ntp_host_stratums'): self.setGraphVal('ntp_host_stratums', hostkey, hoststats.get('stratum')) if self.hasGraph('ntp_host_offsets'): self.setGraphVal('ntp_host_offsets', hostkey, hoststats.get('offset')) if self.hasGraph('ntp_host_delays'): self.setGraphVal('ntp_host_delays', hostkey, hoststats.get('delay'))