report.netsnmp.swapinout uses incorrect units and scale

Description

From the MIB:

ssSwapIn OBJECT-TYPE
SYNTAX Integer32
UNITS "kB"
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The average amount of memory swapped in from disk,
calculated over the last minute."
::= { systemStats 3 }

Units are kB, but the report divides the number gathered by 100, when it should be 1024, the base should also be set to 1024:

This diff is for the monolithic snmp-graph.properties file, but the same diff applies to the .d equivalent.

diff --git a/etc/snmp-graph.properties b/etc/snmp-graph.properties
index fefc27f..0232e2c 100644
— a/etc/snmp-graph.properties
+++ b/etc/snmp-graph.properties
@@ -7049,18 +7049,20 @@ report.netsnmp.swapinout.name=Swap
report.netsnmp.swapinout.columns=SwapIn, SwapOut
report.netsnmp.swapinout.type=nodeSnmp
report.netsnmp.swapinout.command=--title="Swap" \ + --vertical-label="Bytes" \ + --base=1024 \ DEF:swapin={rrd1}:SwapIn:AVERAGE \ DEF:minSwapin={rrd1}:SwapIn:MIN \ DEF:maxSwapin={rrd1}:SwapIn:MAX \ DEF:swapout={rrd2}:SwapOut:AVERAGE \ DEF:minSwapout={rrd2}:SwapOut:MIN \ DEF:maxSwapout={rrd2}:SwapOut:MAX \ - CDEF:floatin=swapin,100,/ \ - CDEF:minFloatin=minSwapin,100,/ \ - CDEF:maxFloatin=maxSwapin,100,/ \ - CDEF:floatout=swapout,100,/ \ - CDEF:minFloatout=minSwapout,100,/ \ - CDEF:maxFloatout=maxSwapout,100,/ \ + CDEF:floatin=swapin,1024,/ \ + CDEF:minFloatin=minSwapin,1024,/ \ + CDEF:maxFloatin=maxSwapin,1024,/ \ + CDEF:floatout=swapout,1024,/ \ + CDEF:minFloatout=minSwapout,1024,/ \ + CDEF:maxFloatout=maxSwapout,1024,/ \ LINE2:floatin#0000ff:"In " \ GPRINT:floatin:AVERAGE:"Avg
: %10.2lf %s" \ GPRINT:floatin:MIN:"Min
: %10.2lf %s" \

Environment

Linux 3.2.0-0.bpo.1-amd64 #1 SMP Sat Feb 11 08:41:32 UTC 2012 x86_64 GNU/Linux - Oracle Java 1.7.0+update21

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Details

Assignee

Reporter

Labels

Affects versions

Priority

PagerDuty

Created January 22, 2014 at 7:29 AM
Updated September 21, 2021 at 6:21 PM