# SNMP Memory Values



## Ophiuchus (Apr 4, 2012)

Hi,

I want to create a graph template for Cacti and I am able to get these values (below) with the help of net-snmp. It is fairly easy to create a graph by using "size" and "used" values of physical memory but I want to create something more detailed. The numbers I get just don't add up to a total (a +b +c -d = Physical Memory, Real Memory... etc) and that is what I want to show in my graphs.

Actually, I do not have deep knowledge of FreeBSD or Linux memory terms and any help/links will be truly appreciated. 


```
hrStorageDescr.1 = STRING: Physical memory
hrStorageDescr.2 = STRING: Real memory
hrStorageDescr.6 = STRING: Memory buffers
hrStorageDescr.7 = STRING: Cached memory
hrStorageDescr.8 = STRING: Shared virtual memory
hrStorageDescr.9 = STRING: Shared real memory
hrStorageDescr.10 = STRING: Swap space
hrStorageSize.1 = INTEGER: 136009
hrStorageSize.2 = INTEGER: 20444
hrStorageSize.6 = INTEGER: 65024
hrStorageSize.7 = INTEGER: 10737
hrStorageSize.8 = INTEGER: 2759
hrStorageSize.9 = INTEGER: 2220
hrStorageSize.10 = INTEGER: 131040
hrStorageUsed.1 = INTEGER: 33662
hrStorageUsed.2 = INTEGER: 11168
hrStorageUsed.6 = INTEGER: 30464
hrStorageUsed.7 = INTEGER: 3279
hrStorageUsed.8 = INTEGER: 125
hrStorageUsed.9 = INTEGER: 55
hrStorageUsed.10 = INTEGER: 0
```

Regards.


----------



## Ophiuchus (Apr 9, 2012)

*...*

All I want to know is that, if the assigned RAM for a specific system is enough or not. How can I decide? I mostly use vmstat to find out swapping information. Below, I pasted "vmstat 1" output of one of our servers. "pi/po" columns does not indicate any important signs of paging activity (as far as I know). 


```
procs      memory      page                    disks     faults         cpu
 r b w     avm    fre   flt  re  pi  po    fr  sr da0 cd0   in   sy   cs us sy id
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  134 3650 1377  2  3 95
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  162 4535 1599  2  2 96
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  255 6738 2338  2  5 93
 0 0 0    652M    10M     2   0   1   0    59   0   2   0  248 6564 2253  5  6 89
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  348 9077 3113  2  5 93
 0 0 0    652M    10M     1   0   0   0    76   0   2   0  287 7686 2639  3  2 94
 0 0 0    652M    10M     0   0   0   0    76   0   2   0  194 4976 1829  2  4 94
 0 0 0    652M    10M     2   0   0   0    68   0   0   0  129 3264 1252  2  2 96
 2 0 0    652M    10M     1   0   0   0    68   0   0   0  160 4187 1528  5  2 93
 0 0 0    652M    10M     0   0   0   0    68   0   8   0  130 3221 1264  2  3 95
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  194 5051 1801  3  2 95
 0 0 0    652M    10M     0   0   0   0    53   0   0   0  238 6512 2189  3  2 95
 0 0 0    652M    10M   277   0   0   0   332   0   1   0  290 8337 2682  3  4 93
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  287 7851 2596  4  4 92
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  230 6069 2128  4  5 91
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  325 8831 2903  5  3 92
 0 0 0    652M    10M     1   0   0   0    76   0   1   0  153 4348 1542  1  3 95
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  244 6464 2302  5  4 92
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  209 5633 1931  1  2 97
 1 0 0    652M    10M     1   0   0   0    76   0   3   0  231 6037 2104  4  5 91
 0 0 0    652M    10M     0   0   0   0    59   0   1   0  199 5236 1911  5  3 92
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  104 2815 1084  2  2 97
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  170 4499 1647  3  4 94
 3 0 0    652M    10M     0   0   0   0    68   0   0   0  207 5235 1859  2  5 93
 3 0 0    652M    10M     0   0   0   0    68   0   1   0  208 5303 1913  4  2 94
 0 0 0    652M    10M     1   0   0   0    76   0   1   0  228 5723 2052  5  5 90
 2 0 0    652M    10M     0   0   0   0    68   0   0   0  315 7980 2834  4  5 92
 2 0 0    652M    10M     0   0   0   0    68   0   0   0  217 5612 1998  3  4 93
 1 0 0    652M    10M     1   0   0   0    68   0   0   0  201 5078 1816  2  2 96
 0 0 0    652M    10M     0   0   0   0    59   0   1   0  147 3982 1439  3  2 95
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  138 3794 1361  3  3 95
 3 0 0    652M    10M     1   0   0   0    68   0   0   0  169 4462 1645  2  4 94
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  155 4531 1587  2  2 96
 0 0 0    652M    10M     0   0   0   0    76   0   1   0  287 7413 2632  4  3 93
 0 0 0    652M    10M     1   0   0   0    84   0  10   0  214 4124 1677  3  3 93
 0 0 0    652M    10M     2   1   1   0    68   0   1   0  184 4322 1672  2  3 95
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  193 5176 1864  3  3 95
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  148 3916 1490  2  3 95
 0 0 0    652M    10M     0   0   0   0    51   0   0   0  141 3347 1345  3  5 92
 2 0 0    652M    10M     0   0   0   0    76   0   1   0  185 4723 1716  3  2 95
 2 0 0    652M    10M     1   0   0   0    70   0  16   0  240 5811 2206  5  4 91
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  180 5037 1728  3  3 94
 0 0 0    652M    10M     0   0   0   0    76   0   1   0  173 4526 1658  3  4 92
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  205 5409 1952  2  2 96
 0 0 0    652M    10M     0   0   0   0    76   0   2   0  149 4129 1494  2  2 96
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  160 4194 1553  2  3 95
 1 0 0    652M    10M     1   0   0   0    51   0   0   0  103 2423  979  2  1 97
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  179 4407 1653  1  3 96
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  222 5900 2045  3  2 95
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  151 4167 1511  1  3 96
 0 0 0    652M    10M     0   0   0   0    84   0   4   0  140 3512 1345  2  2 96
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  159 3867 1498  1  4 95
 0 0 0    652M    10M     1   0   0   0    68   0   0   0  155 4469 1497  0  5 95
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  127 3154 1262  2  3 95
 0 0 0    652M    10M     0   0   0   0    68   0   0   0  131 3275 1270  1  2 97
 0 0 0    652M    10M     1   0   0   0    51   0   0   0  248 6461 2341  4  4 92
```


I took one more step and got info from *vmstat -s* output (up for 4 days) and that is where I got confused again. 

 What is the difference between pageins/pageouts and pages paged in/out? 
 What are swap pager and vnode pager? Which should I check first where paging is concerned?
 I would say that this server has adequate amount of RAM. Am I dead wrong? Which parameters should you advise me to check?


```
198385903 cpu context switches
 15917318 device interrupts
 19894026 software interrupts
 16686093 traps
456723704 system calls
       17 kernel threads created
    10589  fork() calls
     2021 vfork() calls
        0 rfork() calls
     2458 swap pager pageins
     6187 swap pager pages paged in
     4033 swap pager pageouts
    15621 swap pager pages paged out
     2919 vnode pager pageins
    16263 vnode pager pages paged in
        0 vnode pager pageouts
        0 vnode pager pages paged out
      661 page daemon wakeups
  2202451 pages examined by the page daemon
     5855 pages reactivated
   432323 copy-on-write faults
      467 copy-on-write optimized faults
   697792 zero fill pages zeroed
     5118 zero fill pages prezeroed
     2624 intransit blocking page faults
  1692767 total VM faults taken
        0 pages affected by kernel thread creation
  5384037 pages affected by  fork()
  1080050 pages affected by vfork()
        0 pages affected by rfork()
  1099829 pages cached
 24271754 pages freed
        0 pages freed by daemon
   859090 pages freed by exiting processes
    33241 pages active
     4664 pages inactive
     1499 pages in VM cache
    20093 pages wired down
      634 pages free
     4096 bytes per page
  8360235 total name lookups
          cache hits (60% pos + 1% neg) system 2% per-directory
          deletions 0%, falsehits 0%, toolong 0%
```


----------

