diff --git a/doc/Extensions/Applications.md b/doc/Extensions/Applications.md index 4c0539d86b..7fa2a28e54 100644 --- a/doc/Extensions/Applications.md +++ b/doc/Extensions/Applications.md @@ -7,6 +7,7 @@ Different applications support a variety of ways collect data: by direct connect 1. [BIND9/named](#bind9-aka-named) - Agent 2. [MySQL](#mysql) - Agent 3. [NGINX](#nginx) - Agent +4. [NTPD] (#ntpd-server) - extend SNMP, Agent 4. [PowerDNS](#powerdns) - Agent 5. [PowerDNS Recursor](#powerdns-recursor) - Agent 6. [TinyDNS/djbdns](#tinydns-aka-djbdns) - Agent @@ -83,6 +84,25 @@ location /nginx-status { } ``` +### NTPD Server +Supports NTPD Server (not client, that is separate) + +##### Extend SNMP +1. Download the script onto the desired host (the host must be added to LibreNMS devices) +``` +wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/ntpd-server.php -o /etc/snmp/ntpd-server.php +``` +2. Make the script executable (chmod +x /etc/snmp/ntdp-server.php) +3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add: +``` +extend ntpdserver /etc/snmp/ntpd-server.php +``` +4. Restart snmpd on your host +5. On the device page in Librenms, edit your host and check the `Ntpd-server` under the Applications tab. + +##### Agent +Support is built into the agent, and this app will be automatically enabled. + ### PowerDNS An authoritative DNS server: https://www.powerdns.com/auth.html diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 19e396a7a8..acf19f2132 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -71,6 +71,9 @@ function nicecase($item) case 'nfs-v3-stats': return 'NFS v3 Stats'; + case 'ntpd': + return 'NTPD (Server)'; + case 'os-updates': return 'OS Updates'; diff --git a/includes/polling/applications/ntpd-server.inc.php b/includes/polling/applications/ntpd-server.inc.php deleted file mode 100644 index 04942e9288..0000000000 --- a/includes/polling/applications/ntpd-server.inc.php +++ /dev/null @@ -1,54 +0,0 @@ - $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', 'rdd_name', 'rrd_def'); -data_update($device, 'app', $tags, $fields); diff --git a/includes/polling/applications/ntpd.inc.php b/includes/polling/applications/ntpd.inc.php new file mode 100644 index 0000000000..6a5a90314a --- /dev/null +++ b/includes/polling/applications/ntpd.inc.php @@ -0,0 +1,58 @@ + $data[0], + 'offset' => $data[1], + 'frequency' => $data[2], + 'jitter' => $data[3], + 'noise' => $data[4], + 'stability' => $data[5], + 'uptime' => $data[6], + 'buffer_recv' => $data[7], + 'buffer_free' => $data[8], + 'buffer_used' => $data[9], + 'packets_drop' => $data[10], + 'packets_ignore' => $data[11], + 'packets_recv' => $data[12], + 'packets_sent' => $data[13], + ); +} + +$tags = compact('name', 'app_id', 'rdd_name', 'rrd_def'); +data_update($device, 'app', $tags, $fields); diff --git a/sql-schema/127.sql b/sql-schema/127.sql new file mode 100644 index 0000000000..4d2a97d6db --- /dev/null +++ b/sql-schema/127.sql @@ -0,0 +1 @@ +UPDATE `applications` SET `app_type` = 'ntpd' WHERE `applications`.`app_type` = 'ntpd-server';