diff --git a/bash/portal/graphs.sh b/bash/portal/graphs.sh index 7350391..092d077 100755 --- a/bash/portal/graphs.sh +++ b/bash/portal/graphs.sh @@ -40,6 +40,7 @@ PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal" COLLECTD_CONFIG="/etc/collectd/collectd.conf" COLLECTD_CRON_FILE="/etc/cron.d/adsb-receiver-performance-graphs" DUMP1090_MAX_RANGE_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_range.rrd" +DUMP1090_MESSAGES_LOCAL_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_messages-local_accepted.rrd" ### INCLUDE EXTERNAL SCRIPTS @@ -394,6 +395,14 @@ if [ -f "/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_r fi fi +# Increase size of weekly messages table to 8 days +if [ -f ${DUMP1090_MESSAGES_LOCAL_RRD} ]; then + if [[ `rrdinfo ${DUMP1090_MESSAGES_LOCAL_RRD} | grep -c "rra\[6\]\.rows = 1260"` -eq 1 ]] ; then + echo -e "\e[94m Increasing weekly table size to 8 days in messages-local_accepted.rrd...\e[97m" + sudo rrdtool tune ${DUMP1090_MESSAGES_LOCAL_RRD} 'RRA#6:=1440' 'RRA#7:=1440' 'RRA#8:=1440' + fi +fi + ### SETUP COMPLETE # Return to the project root directory. diff --git a/build/portal/graphs/dump1090.py b/build/portal/graphs/dump1090.py index bf1c729..e54d191 100644 --- a/build/portal/graphs/dump1090.py +++ b/build/portal/graphs/dump1090.py @@ -91,14 +91,6 @@ def read_stats_1min(instance_name, host, url): values = [stats['last1min']['local']['noise']], interval = 60) - V.dispatch(plugin_instance = instance_name, - host=host, - type='dump1090_messages', - type_instance='strong_signals', - time=T(stats['last1min']['end']), - values = [stats['last1min']['local']['strong_signals']], - interval = 60) - def read_stats(instance_name, host, url): try: @@ -124,6 +116,15 @@ def read_stats(instance_name, host, url): time=T(stats['total']['end']), values = [counts[i]]) + if stats['total']['local'].has_key('strong_signals'): + V.dispatch(plugin_instance = instance_name, + host=host, + type='dump1090_messages', + type_instance='strong_signals', + time=T(stats['total']['end']), + values = [stats['total']['local']['strong_signals']], + interval = 60) + # Remote message counts if stats['total'].has_key('remote'): counts = stats['total']['remote']['accepted'] diff --git a/build/portal/graphs/make-collectd-graphs.sh b/build/portal/graphs/make-collectd-graphs.sh index 94a700c..6094805 100755 --- a/build/portal/graphs/make-collectd-graphs.sh +++ b/build/portal/graphs/make-collectd-graphs.sh @@ -361,10 +361,10 @@ local_rate_graph() { "DEF:messages=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE" \ "DEF:strong=$2/dump1090_messages-strong_signals.rrd:value:AVERAGE" \ "DEF:positions=$2/dump1090_messages-positions.rrd:value:AVERAGE" \ - "CDEF:y2strong=strong,10,*" \ + "CDEF:y2strong=strong,1.6666666666666,*" \ "CDEF:y2positions=positions,10,*" \ "LINE1:messages#0000FF:Messages Received" \ - "AREA:y2strong#FF0000:Messages > -3dBFS / Hr (RHS)" \ + "AREA:y2strong#FF0000:Messages > -3dBFS / 10min (RHS)" \ "LINE1:y2positions#00c0FF:Positions / Hr (RHS)\c" \ "COMMENT: \n" \ --watermark "Drawn: $nowlit"; @@ -383,6 +383,7 @@ local_trailing_rate_graph() { --units-exponent 0 \ --right-axis 360:0 \ --slope-mode \ + --pango-markup \ "TEXTALIGN:center" \ "DEF:messages=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE" \ "DEF:a=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-86400:start=end-86400" \ @@ -429,8 +430,13 @@ local_trailing_rate_graph() { "CDEF:gmax1=gmax,UN,0,gmax,IF" \ "DEF:strong=$2/dump1090_messages-strong_signals.rrd:value:AVERAGE" \ "DEF:positions=$2/dump1090_messages-positions.rrd:value:AVERAGE" \ - "CDEF:y2strong=strong,10,*" \ + "CDEF:y2strong=strong,1.6666666666666,*" \ "CDEF:y2positions=positions,10,*" \ + "VDEF:strong_total=strong,TOTAL" \ + "VDEF:messages_total=messages,TOTAL" \ + "CDEF:hundred=messages,UN,100,100,IF" \ + "CDEF:strong_percent=strong_total,hundred,*,messages_total,/" \ + "VDEF:strong_percent_vdef=strong_percent,LAST" \ "SHIFT:a1:86400" \ "SHIFT:b1:172800" \ "SHIFT:c1:259200" \ @@ -471,7 +477,8 @@ local_trailing_rate_graph() { "AREA:maxarea#FFFF99:Min/Max:STACK" \ "LINE1:7dayaverage#00FF00:7 Day Average" \ "LINE1:messages#0000FF" \ - "AREA:y2strong#FF0000:Messages > -3dBFS/Hr (RHS)" \ + "AREA:y2strong#FF0000:Messages > -3dBFS/10min (RHS)\g" \ + "GPRINT:strong_percent_vdef: (%1.1lf %% of messages)" \ "LINE1:y2positions#00c0FF:Positions/Hr (RHS)\c" \ --watermark "Drawn: $nowlit"; }