From 42de8c364cd4e2af4d846519b6b400e6d5b4808f Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 29 Apr 2015 18:57:19 +0000 Subject: [PATCH] MFC 280721: Allow additional flags to be passed to netstat -i in the daily status check. In particular, this allows an administrator to specify "-h" for human readable output if that is preferred. The default setting passes "-d", so that can be excluded by using a custom setting. git-svn-id: svn://svn.freebsd.org/base/stable/9@282243 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- etc/defaults/periodic.conf | 1 + etc/periodic/daily/420.status-network | 8 +++++--- share/man/man5/periodic.conf.5 | 12 +++++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/etc/defaults/periodic.conf b/etc/defaults/periodic.conf index 8770b7f31..f3bc72882 100644 --- a/etc/defaults/periodic.conf +++ b/etc/defaults/periodic.conf @@ -119,6 +119,7 @@ daily_status_gconcat_enable="NO" # Check gconcat(8) # 420.status-network daily_status_network_enable="YES" # Check network status daily_status_network_usedns="YES" # DNS lookups are ok +daily_status_network_netstat_flags="-d" # netstat(1) flags # 430.status-rwho daily_status_rwho_enable="YES" # Check system status diff --git a/etc/periodic/daily/420.status-network b/etc/periodic/daily/420.status-network index 13ae1e8b8..03166a915 100755 --- a/etc/periodic/daily/420.status-network +++ b/etc/periodic/daily/420.status-network @@ -16,12 +16,14 @@ case "$daily_status_network_enable" in echo "" echo "Network interface status:" + flags="${daily_status_network_netstat_flags}" case "$daily_status_network_usedns" in [Yy][Ee][Ss]) - netstat -id && rc=0 || rc=3;; + ;; *) - netstat -idn && rc=0 || rc=3;; - esac;; + flags="${flags} -n";; + esac + netstat -i ${flags} && rc=0 || rc=3;; *) rc=0;; esac diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 9b8653653..1c37b6d3f 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2015 +.Dd March 26, 2015 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -410,6 +410,16 @@ Set to .Dq Li YES if you want to run .Nm netstat Fl i . +.It Va daily_status_network_netstat_flags +.Pq Vt str +Set to additional arguments for the +.Xr netstat 1 +utility when +.Va daily_status_network_enable +is set to +.Dq Li YES . +The default is +.Fl d . .It Va daily_status_network_usedns .Pq Vt bool Set to -- 2.45.0