| 156 |  | push @data, "NONE:$1:free:free#CCCCFF:NONE:free memory"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 157 |  | push @data, "NONE:$1:total:total#0000FF:NONE:total memory\\n"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 158 |  | push @data, "NONE:$1:cache:cache#0000FF:NONE:cache memory\\n"; | 
 
 
 
 
 
 
 
 
 
 
 | 159 | < | # calculate peruse - note that we only use 'free' if it's less than total | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 160 | < | # (this is to avoid negative percentages :) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 161 | < | push @rawdata, "CDEF:peruse=total,free,total,LT,free,0,IF,-,total,/,100,*"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 162 | < | push @rawdata, "CDEF:percacuse=cache,total,LT,cache,0,IF,total,/,100,*"; | 
 
 
 
 
 
 
 
 
 | 159 | > | # calculate peruse - note that we only use 'free' if it's | 
 
 
 
 
 | 160 | > | # less or equal to total (this is to avoid negative percentages :) | 
 
 
 
 
 | 161 | > | push @rawdata, "CDEF:peruse=total,free,total,LE,free,0,IF,-,total,/,100,*"; | 
 
 
 
 
 | 162 | > | push @rawdata, "CDEF:percacuse=cache,total,LE,cache,0,IF,total,/,100,*"; | 
 
 
 
 
 
 
 
 
 
 
 | 163 |  | # and add it to the graph | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 164 |  | push @rawdata, "AREA:peruse#CCCCFF:% memory in use"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 165 |  | &addlegend(\@rawdata, "peruse"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 194 |  | # although we need it to work out peruse... | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 195 |  | push @data, "NONE:$1:free:free#CCCCFF:NONE:free swap"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 196 |  | push @data, "NONE:$1:total:total#0000FF:NONE:total swap\\n"; | 
 
 
 
 
 
 
 
 
 
 
 | 197 | < | # calculate peruse - note that we only use 'free' if it's less than total | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 198 | < | # (this is to avoid negative percentages :) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 199 | < | push @rawdata, "CDEF:peruse=total,free,total,LT,free,0,IF,-,total,/,100,*"; | 
 
 
 
 
 
 
 
 
 | 197 | > | # calculate peruse - note that we only use 'free' if it's | 
 
 
 
 
 | 198 | > | # less or equal to total (this is to avoid negative percentages :) | 
 
 
 
 
 | 199 | > | push @rawdata, "CDEF:peruse=total,free,total,LE,free,0,IF,-,total,/,100,*"; | 
 
 
 
 
 
 
 
 
 
 
 | 200 |  | # and add it to the graph | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 201 |  | push @rawdata, "AREA:peruse#CCCCFF:% swap in use"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 202 |  | push @rawdata, "--upper-limit=100"; |