diff options
author | Renato Botelho <renato@netgate.com> | 2015-12-18 17:28:40 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-12-18 17:28:40 -0200 |
commit | 73e3aa2148b9fe3f8a264732f627273699797d7e (patch) | |
tree | ac8d412f7d0461d8ac220c8f4ad3836bf16e2242 /src/etc/inc/rrd.inc | |
parent | a982330cef68591293cf75bedbc2e4bc5743ad0e (diff) | |
download | pfsense-73e3aa2148b9fe3f8a264732f627273699797d7e.zip pfsense-73e3aa2148b9fe3f8a264732f627273699797d7e.tar.gz |
Rework dpinger related code to new version
- s/-U/-u/
- Add -i GW_NAME to get this info on logs and make life easier
- Since -i parameter will be send to alert_cmd, remove it from command
- Add source and target IP addresses on pid/socket filename since status
doesn't provide it
- add more details on return of running_dpinger_processes
- srcip
- targetip
- pidfile
- socket
- Simplify stop_dpinger() logic
- Check if alarm is on based on config values in get_dpinger_status()
because dpinger status doesn't return alarm status
- Read gateway friendly name from status on updaterrdb.sh
Diffstat (limited to 'src/etc/inc/rrd.inc')
-rw-r--r-- | src/etc/inc/rrd.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/etc/inc/rrd.inc b/src/etc/inc/rrd.inc index 11bab43..50d7b42 100644 --- a/src/etc/inc/rrd.inc +++ b/src/etc/inc/rrd.inc @@ -959,8 +959,15 @@ for sock in {$g['varrun_path']}/dpinger_*.sock; do if [ ! -S "\$sock" ]; then continue fi - loss=\$(/usr/bin/nc -U \$sock | awk '{ print \$3 }') - delay=\$(/usr/bin/nc -U \$sock | awk '{ print \$1 }') + + gw=\$(/usr/bin/nc -U \$sock | awk '{ print \$1 }') + + if [ -z "\$gw" ]; then + continue + fi + + delay=\$(/usr/bin/nc -U \$sock | awk '{ print \$2 }') + loss=\$(/usr/bin/nc -U \$sock | awk '{ print \$4 }') if echo "\$loss" | grep -Eqv '^[0-9]+\$'; then loss="U" @@ -972,7 +979,6 @@ for sock in {$g['varrun_path']}/dpinger_*.sock; do delay=\$(echo "scale=7; \$delay / 1000 / 1000" | /usr/bin/bc) fi - gw=\$(echo \$sock | sed 's,^.*dpinger_,,; s,\.sock,,') if [ ! -f {$rrddbpath}\$gw-quality.rrd ]; then {$rrdtool} create {$rrddbpath}\$gw-quality.rrd --step 60 \\ DS:loss:GAUGE:120:0:100 \\ |