Solaris SNMP Swap

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ahmad.zuhd
Posts: 44
Joined: Sun Jul 01, 2012 2:33 am

Solaris SNMP Swap

Post by ahmad.zuhd »

I have a Solris SPARC machine that we are using the snmp to monitor it.

I have different readings for the total swap when using the snmp value vs the OS value as follows.

this is the plugin used and the output:

Code: Select all

$USER1$/check_snmp_storage_wizard.pl -H $HOSTADDRESS$ -C public --v2c -m 'Swap' -w 80 -c 90 -f
Swap Space: 48%used(12955MB/27271MB) (<80%) : OK | 'Swap_Space'=12955MB;21817;24544;0;27271
when getting to solaris commands, i can see that we only have 8192M of total swap as follows:

Code: Select all

#swap -s; swap -l;df -kh ; top -b

total: 11423752k bytes allocated + 3649744k reserved = 15073496k used, 11893848k available
swapfile             dev  swaplo blocks   free
/dev/zvol/dsk/rpool/swap 256,1      16 16777200 16777200

Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/s10s_u9wos_14a
                       134G    93G    31G    76%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                    11G   424K    11G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr/libc_psr_hwcap2.so.1
                       124G    93G    31G    76%    /platform/sun4v/lib/libc_psr.so.1
/platform/SUNW,SPARC-Enterprise-T5220/lib/sparcv9/libc_psr/libc_psr_hwcap2.so.1
                       124G    93G    31G    76%    /platform/sun4v/lib/sparcv9/libc_psr.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                    11G   728K    11G     1%    /tmp
swap                    11G    48K    11G     1%    /var/run
rpool/export           134G    23K    31G     1%    /export
rpool/export/home      134G    69M    31G     1%    /export/home
rpool                  134G    97K    31G     1%    /rpool
10.201.64.34:/export/RCD
                       123G    53G    69G    44%    /RCD/backup


load averages:  3.21,  3.74,  3.74;                    up 164+12:41:58 15:34:13
215 processes: 212 sleeping, 3 on cpu
CPU states: 95.2% idle,  2.5% user,  2.3% kernel,  0.0% iowait,  0.0% swap
Memory: 32G phys mem, 9013M free mem, 8192M total swap, 8192M free swap
 
   PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
  2107 rcd       56   0    0 1514M 1486M cpu/37 2152.8  1.53% java
24225 rcd        1   0    0 5928K 2536K sleep   21.7H  0.39% cs_updater_daem
29744 rcd        1  24    0 6280K 5328K cpu/56   0:00  0.20% ssh
   213 daemon    15  59    0 9160K 4944K sleep  144.0H  0.10% kcfd
22381 rcd      423  59    0   10G 8645M sleep   41.1H  0.09% java
29644 rcd        1  51    0 3664K 2600K cpu/28   0:00  0.03% top
24206 rcd        1  34    0 3368K 1752K sleep   24:38  0.02% cs_sync_daemon
29796 rcd        1   0    0 1736K 1456K sleep    0:00  0.01% hostname
  4518 rcd       92  59    0  317M  280M sleep   43.7H  0.01% java
   184 root      39  59    0   20M   15M sleep   38.1H  0.00% nscd
  8552 rcd       35  53    2  101M   16M sleep   14:28  0.00% java
  5960 rcd       35  53    2  101M   16M sleep   14:28  0.00% java
16254 rcd       35  53    2  101M   16M sleep   14:33  0.00% java
11063 rcd       35  53    2  101M   16M sleep   14:27  0.00% java
15261 rcd       35  53    2  101M   16M sleep   14:36  0.00% java

scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Solaris SNMP Swap

Post by scottwilkerson »

This is going to use the information in SNMP to give the values, so that is where you would need to check what the machine is reporting.

you would need to run something like this to get all the needed values and perform the calculations in order to see what the server is reporting via snmp

Code: Select all

snmpwalk -v 2c -c public <SPARC_SERVER_ADDRESS> 1.3.6.1.2.1.25.2
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ahmad.zuhd
Posts: 44
Joined: Sun Jul 01, 2012 2:33 am

Re: Solaris SNMP Swap

Post by ahmad.zuhd »

sure it will be the same value i get from the command.
from your reply i guess it is an snmp issue... right?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Solaris SNMP Swap

Post by scottwilkerson »

The walk will give you a bunch of values, and you will need to multiply the hrStorageSize * hrStorageAllocationUnits
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ahmad.zuhd
Posts: 44
Joined: Sun Jul 01, 2012 2:33 am

Re: Solaris SNMP Swap

Post by ahmad.zuhd »

the problem is that snmp output is different than the actual swap space as resulted from the command swap -s.

in general i can note many problems with RAM and SWAP values using different script and snmp plugins.

my question is now general... what is special about solaris Physical and Swap memory..
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Solaris SNMP Swap

Post by lmiltchev »

what is special about solaris Physical and Swap memory..
Can you elaborate on this?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ahmad.zuhd
Posts: 44
Joined: Sun Jul 01, 2012 2:33 am

Re: Solaris SNMP Swap

Post by ahmad.zuhd »

-- Concerning the memory:

Code: Select all

# ./check_mem -u -w 80 -c 90
Memory WARNING - 87.3% (1379944 kB) used
# ./check_mem.pl -u -w 80 -c 90 -C
CRITICAL - 92.8% (1787488 kB) used!|TOTAL=1926120KB;;;; USED=1787488KB;;;; FREE=138632KB;;;; CACHES=0KB;;;;

from prstat (like top)
# prstat -Z
ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE
     0       59  224M  141M   7.3%  28:37:22 0.2% global

# prtconf | grep Memo
Memory size: 1920 Megabytes
also when using the check_snmp_storage_wizard.pl i got a usage of 92.8%
what is the correct reading??



-- Concerning the Swap:
After some search, i found that the snmp return the swap size + some additional memory. This is clear after i use the below commands

Code: Select all

# ./check_swap.pl -h
Check swap space on local machine.

Usage: check_swap [-v] -w <percent_free>% -c <percent_free>%
       check_swap [-v] -w <amount_free> -c <amount_free>

Options:
 -h, --help
    Print detailed help screen
 -V, --version
    Print version information
 -w, --warning=INTEGER[kMGT]
    Exit with WARNING status if less than INTEGER amount of swap space is free
 -w, --warning=PERCENT%%
    Exit with WARNING status if less than PERCENT of swap space is free
 -c, --critical=INTEGER[kMGT]
    Exit with CRITICAL status if less than INTEGER amount of swap space is free
 -c, --critical=PERCENT%%
    Exit with CRITCAL status if less than PERCENT of swap space is free
 -m, --method
    "top" - uses top to determine swap usage (default)
                top must be installed separately, but top method does not include RAM in
                calculation
        "swap" - uses swap to determine swap usage
                swap is provided with Solaris, but includes physical RAM in it calculation
 -v, --verbose
    Increase the level of verbosity (maximum value of 3)
After comparing between the output of swap and top

Code: Select all

./check_swap.pl -w 20% -c 10%
OK: Available swap (88.0%) > warning threshold (20.0%)|available=884MB total=1004MB

./check_swap.pl -w 20% -c 10% -m swap
OK: Available swap (82.2%) > warning threshold (20.0%)|available=1215024kB allocated=237024kB reserved=26632kB used=263656kB
my question, what is that amount of memory and is it dynamic or fixed.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Solaris SNMP Swap

Post by scottwilkerson »

/check_swap.pl is a totally different plugin than the one you were asking about.

I'm not familiar with this plugin, do you know who the author is?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ahmad.zuhd
Posts: 44
Joined: Sun Jul 01, 2012 2:33 am

Re: Solaris SNMP Swap

Post by ahmad.zuhd »

lets get back to the first post. where the snmp reported a total swap space of 27251MB, where it is actually 8192MB.

as i can see from the snmp command, this is the virtual memory, what i know is that swap is different than the virtual memory.

what is the snmp oid that could be used in solaris to get the right swap space?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Solaris SNMP Swap

Post by scottwilkerson »

Can you attach the output from the following command

Code: Select all

snmpwalk -v 2c -c <COMMUNITY_STRING> <SPARC_SERVER_ADDRESS> 1.3.6.1.2.1.25.2
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked