added the new option 'extra_args' in 'ntp.pm' to be able to include extra arguments to the command executed

This commit is contained in:
Jordi Sanfeliu 2015-10-13 11:29:23 +02:00
parent 6656de112c
commit 35b3e8f6a8
3 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,9 @@
N.N.N - DD-MMM-2015 N.N.N - DD-MMM-2015
==================== ====================
- Added support in ZFS graph for versions older than 0.6.4. - Added support in ZFS graph for versions older than 0.6.4.
- Added the new option 'extra_args' in 'ntp.pm' to be able to include extra
arguments to the command executed by Monitorix.
(suggested by Matti Pentti, Matti.Pentti AT cimcorp.com)
- Fixed a missing identifier in sprintf(). [#109] - Fixed a missing identifier in sprintf(). [#109]
- Fixed a message of 'use of uninitialized value' in 'port.pm'. [#110] - Fixed a message of 'use of uninitialized value' in 'port.pm'. [#110]
- Fixed the Y-axis title in 'fail2ban.pm'. [#111] - Fixed the Y-axis title in 'fail2ban.pm'. [#111]

View File

@ -136,6 +136,7 @@ sub ntp_update {
my ($package, $config, $debug) = @_; my ($package, $config, $debug) = @_;
my $rrd = $config->{base_lib} . $package . ".rrd"; my $rrd = $config->{base_lib} . $package . ".rrd";
my $ntp = $config->{ntp}; my $ntp = $config->{ntp};
my $args = $ntp->{extra_args} || "";
my @data; my @data;
my $del; my $del;
@ -150,7 +151,7 @@ sub ntp_update {
my $e = 0; my $e = 0;
foreach my $h (split(',', $ntp->{list})) { foreach my $h (split(',', $ntp->{list})) {
$h = trim($h); $h = trim($h);
open(IN, "ntpq -pn $h |"); open(IN, "ntpq -pn $args $h |");
@data = <IN>; @data = <IN>;
close(IN); close(IN);
$cod = $str = $del = $off = $jit = 0; $cod = $str = $del = $off = $jit = 0;

View File

@ -1827,6 +1827,17 @@ For more information on these NTP codes:
.P .P
The maximum number of codes allowed for each hostname is 10. The maximum number of codes allowed for each hostname is 10.
.RE .RE
.P
.BI extra_args
.RS
This option includes any extra argument to the NTP command executed by Monitorix, which is "ntpq -pn". This is specially useful if you want to force using IPv4, in this case just define this option like this:
.P
.RS
extra_args = "-4"
.RE
.P
Monitorix will add this extra argument to the NTP command which will become as "ntpq -pn -4".
.RE
.SS Fail2ban statistics (fail2ban.rrd) .SS Fail2ban statistics (fail2ban.rrd)
This graph is able to monitor an unlimited number of Fail2ban jails. This graph is able to monitor an unlimited number of Fail2ban jails.
.P .P