Skip to content

Commit 652c100

Browse files
committed
DMG and latest telegraf config and script
1 parent 258d1fa commit 652c100

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Pansift.dmg

261 Bytes
Binary file not shown.

Preferences/telegraf-osx.conf

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
[[inputs.exec]]
3232
# Machine Metrics -m
3333
commands = ['bash -c "\"$PANSIFT_SCRIPTS\"/osx_default_script.sh -m"']
34-
interval= "10m"
34+
interval= "2h"
3535
timeout = "10s"
3636
data_format = "influx"
3737
[[inputs.exec]]
3838
# Network Metrics -n
3939
commands = ['bash -c "\"$PANSIFT_SCRIPTS\"/osx_default_script.sh -n"']
40-
interval= "60s"
40+
interval= "30s"
4141
timeout = "35s"
4242
data_format = "influx"
4343
[[inputs.exec]]
@@ -66,6 +66,7 @@
6666
[[inputs.system]]
6767
# Takes the interval from the main agent config.
6868
name_prefix = "pansift_osx_default_"
69+
interval= "5m"
6970
[[inputs.cpu]]
7071
name_prefix = "pansift_osx_default_"
7172
## Whether to report per-cpu stats or not
@@ -83,6 +84,7 @@
8384
#[[inputs.diskio]]
8485
[[inputs.mem]]
8586
name_prefix = "pansift_osx_default_"
87+
interval = "1m"
8688
[[inputs.net]]
8789
name_prefix = "pansift_osx_default_"
8890
interfaces = ["en*"]

Scripts/osx_default_script.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ system_measure () {
122122

123123

124124
network_measure () {
125-
if [ $osx_mainline == 11 ]; then
125+
if [[ "$osx_mainline" == "11" ]]; then
126126
netstat4_print_position=4 # 11.x Big Sur onwards
127127
else
128128
netstat4_print_position=6 # 10.x
@@ -159,9 +159,9 @@ network_measure () {
159159
dg6_interface_ether="none"
160160
dg6_router_ether="none"
161161
fi
162-
163-
dg4_response=$(echo -n "$netstat4" | grep -qi default || { echo -n 0; exit 0; }; [[ ! "$dg4_ip" == "none" ]] && ping -c1 -i1 -o "$dg4_ip" | tail -n1 | cut -d' ' -f4 | cut -d'/' -f2 || echo -n 0)
164-
dg6_response=$(echo -n "$netstat6" | grep -qi default || { echo -n 0; exit 0; }; [[ ! "$dg6_ip" == "none" ]] && ping6 -c1 -i1 -o "$dg6_fullgw" | tail -n1 | cut -d' ' -f4 | cut -d'/' -f2 || echo -n 0)
162+
# We've possibly been hitting WLAN powersave in quiet times with dropping packets so increased count to 3
163+
dg4_response=$(echo -n "$netstat4" | grep -qi default || { echo -n 0; exit 0; }; [[ ! "$dg4_ip" == "none" ]] && ping -c3 -i1 -o "$dg4_ip" | tail -n1 | cut -d' ' -f4 | cut -d'/' -f2 || echo -n 0)
164+
dg6_response=$(echo -n "$netstat6" | grep -qi default || { echo -n 0; exit 0; }; [[ ! "$dg6_ip" == "none" ]] && ping6 -c3 -i1 -o "$dg6_fullgw" | tail -n1 | cut -d' ' -f4 | cut -d'/' -f2 || echo -n 0)
165165

166166
if [[ "$dg4_response" > 0 ]] || [[ "$dg6_respone" > 0 ]]; then
167167
locally_connected="true"

0 commit comments

Comments
 (0)