Unverified Commit 7899001d authored by Gavin Brown's avatar Gavin Brown
Browse files

include a node ID in database so data can be aggregated from multiple...

include a node ID in database so data can be aggregated from multiple locations. pre-declare global variables and make them uppercase. sending unknown parameters causes termination
parent a2a03539
...@@ -18,6 +18,7 @@ WriteMakefile( ...@@ -18,6 +18,7 @@ WriteMakefile(
'Net::DNS' => 0, 'Net::DNS' => 0,
'POSIX' => 0, 'POSIX' => 0,
'Pod::Usage' => 0, 'Pod::Usage' => 0,
'Sys::Hostname' => 0,
'Sys::Syslog' => 0, 'Sys::Syslog' => 0,
'Time::HiRes' => 0, 'Time::HiRes' => 0,
}, },
......
...@@ -7,7 +7,7 @@ rdnsd is a remote DNS server monitoring system. ...@@ -7,7 +7,7 @@ rdnsd is a remote DNS server monitoring system.
`rdnsd` can be used to monitor the availability and responsiveness of `rdnsd` can be used to monitor the availability and responsiveness of
remote DNS servers. Given a list of DNS servers, it will periodically remote DNS servers. Given a list of DNS servers, it will periodically
query each server and record whether a response was received, and how query each server and record whether a response was received, and how
quickly. This information can then be queried by querying an SQLite quickly. This information can then be obtained by querying an SQLite
database. database.
# USAGE # USAGE
...@@ -16,7 +16,7 @@ database. ...@@ -16,7 +16,7 @@ database.
# OPTIONS # OPTIONS
The following command line options are supported. The following command line options are supported:
- `--help` - `--help`
...@@ -37,6 +37,7 @@ The following command line options are supported. ...@@ -37,6 +37,7 @@ The following command line options are supported.
`rdnsd` must be configured using a configuration file. The following `rdnsd` must be configured using a configuration file. The following
is an example: is an example:
NodeID my-node-id
UpdateInterval 293 UpdateInterval 293
PidFile /var/run/rdnsd/rdnsd.pid PidFile /var/run/rdnsd/rdnsd.pid
Database /var/run/rdnsd/rdnsd.db Database /var/run/rdnsd/rdnsd.db
...@@ -52,6 +53,16 @@ is an example: ...@@ -52,6 +53,16 @@ is an example:
The directives are explained below. The directives are explained below.
- `NodeID ID`
Default: `$HOSTNAME`
This value is insterted into the \`node\_id\` column of stats database. It
disambiguates the source of each row, allowing data from multiple
monitoring nodes to be aggregated losslessly.
If not set, the system's host name is used.
- `UpdateInterval TIME` - `UpdateInterval TIME`
Default: `293` Default: `293`
...@@ -76,14 +87,15 @@ The directives are explained below. ...@@ -76,14 +87,15 @@ The directives are explained below.
named `rdnsd`, which will contain the following columns: named `rdnsd`, which will contain the following columns:
- `id` - unique row ID - `id` - unique row ID
- `start_time` - date/time the monitoring interval began - `node_id` - node ID/hostname
- `ends_time` - date/time the monitoring interval ended - `start_time` - date+time the monitoring interval began
- `ends_time` - date+time the monitoring interval ended
- `host` - server name - `host` - server name
- `family` - IP version (4 or 6) - `family` - IP version (4 or 6)
- `proto` - transport protocol (UDP or TCP) - `proto` - transport protocol (UDP or TCP)
- `count` - number of queries sent to the server - `count` - number of queries sent to the server
- `success` - number of successful queries - `success` - number of successful queries
- `rate` - response rate as a decimal (0.00 - 1.00) (equivalent - `rate` - response rate as a decimal between 0 and 1 (equivalent
to `success / rate`) to `success / rate`)
- `min_time` - lowest observed RTT in milliseconds - `min_time` - lowest observed RTT in milliseconds
- `time` - average RTT in milliseconds - `time` - average RTT in milliseconds
...@@ -171,11 +183,11 @@ The directives are explained below. ...@@ -171,11 +183,11 @@ The directives are explained below.
Default: none Default: none
**Note:** this is a legacy option to provide backwards compatibility. **Note:** this is a legacy option to provide backwards compatibility with
older versions of `rdnsd`. It specifies a file to which `rdnsd` will
write statistics.
It specifies a file to which `rdnsd` will write statistics. See ["LEGACY STATISTICS FILE FORMAT"](#legacy-statistics-file-format) for further information.
See ["OBTAINING STATISTICS"](#obtaining-statistics) for further information.
# RELOADING CONFIGURATION # RELOADING CONFIGURATION
...@@ -192,12 +204,17 @@ database specified by `Database`, and, if set, the file specified by ...@@ -192,12 +204,17 @@ database specified by `Database`, and, if set, the file specified by
Once the database has been updated, `rdnsd`'s internal data is reset, Once the database has been updated, `rdnsd`'s internal data is reset,
so subsequent signals will produce fresh statistical data. so subsequent signals will produce fresh statistical data.
## (LEGACY) STATISTICS FILE FORMAT ## LEGACY STATISTICS FILE FORMAT
Older versions of `rdnsd` used a flat file format for statistics, which
would be updated every `UpdateInterval` seconds, or when `rdnsd`
received the `USR1` signal. This behaviour is now deprecated in favour
of the SQLite database, but is still supported for backwards
compatibility.
The (legacy) statistics file will contain one line for each server that The statistics file will contain one line for each server. Each line
is being checked. Each line contains the nameserver checked, the contains the nameserver checked, the response rate as a decimal
response rate as a decimal fraction, and the average response time (in fraction, and the average response time (in milliseconds), for example:
milliseconds), for example:
ns0.example.com 1.00 25 ns0.example.com 1.00 25
...@@ -210,11 +227,6 @@ the end of the line: ...@@ -210,11 +227,6 @@ the end of the line:
This value is the response time (in milliseconds) at the given This value is the response time (in milliseconds) at the given
percentile. percentile.
Note that `rdnsd` will not _immediately_ update the file upon
receiving the `USR1` signal. You need to wait up to `Loop` seconds
for the current loop iteration to complete before the stats file is
updated.
# SEE ALSO # SEE ALSO
- [https://www.centralnic.com/](https://www.centralnic.com/) - [https://www.centralnic.com/](https://www.centralnic.com/)
...@@ -230,6 +242,6 @@ the same terms as Perl itself. ...@@ -230,6 +242,6 @@ the same terms as Perl itself.
Hey! **The above document had some coding errors, which are explained below:** Hey! **The above document had some coding errors, which are explained below:**
- Around line 620: - Around line 611:
You forgot a '=back' before '=head1' You forgot a '=back' before '=head1'
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment