addDataset('stratum', 'GAUGE', 0, 1000) ->addDataset('offset', 'GAUGE', -1000, 1000) ->addDataset('frequency', 'GAUGE', -1000, 1000) ->addDataset('jitter', 'GAUGE', -1000, 1000) ->addDataset('noise', 'GAUGE', -1000, 1000) ->addDataset('stability', 'GAUGE', -1000, 1000) ->addDataset('uptime', 'GAUGE', 0, 125000000000) ->addDataset('buffer_recv', 'GAUGE', 0, 100000) ->addDataset('buffer_free', 'GAUGE', 0, 100000) ->addDataset('buffer_used', 'GAUGE', 0, 100000) ->addDataset('packets_drop', 'DERIVE', 0, 125000000000) ->addDataset('packets_ignore', 'DERIVE', 0, 125000000000) ->addDataset('packets_recv', 'DERIVE', 0, 125000000000) ->addDataset('packets_sent', 'DERIVE', 0, 125000000000); $fields = array( 'stratum' => $stratum, 'offset' => $offset, 'frequency' => $frequency, 'jitter' => $jitter, 'noise' => $noise, 'stability' => $stability, 'uptime' => $uptime, 'buffer_recv' => $buffer_recv, 'buffer_free' => $buffer_free, 'buffer_used' => $buffer_used, 'packets_drop' => $packets_drop, 'packets_ignore' => $packets_ignore, 'packets_recv' => $packets_recv, 'packets_sent' => $packets_sent, ); $tags = compact('name', 'app_id', 'rrd_name', 'rrd_def'); data_update($device, 'app', $tags, $fields); update_application($app, $ntpserver_data, $fields);