Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[os::windows::snmp::plugin] - real-swap shows 191% usage #1198

Closed
joschi99 opened this issue Oct 29, 2018 · 12 comments
Closed

[os::windows::snmp::plugin] - real-swap shows 191% usage #1198

joschi99 opened this issue Oct 29, 2018 · 12 comments
Assignees

Comments

@joschi99
Copy link
Contributor

If I want to monitor the windows swap memory using plugins 20181019 I got more then 100% of usage and other wrong values:

 /usr/lib/centreon/plugins/os-windows-snmp.pl --hostname=x.x.x.x --snmp-community=public --snmp-version=1 --plugin=os::windows::snmp::plugin --mode=swap --warning=80 --critical=90 --real-swap
CRITICAL: Swap Total: 21.48 GB Used: 41.04 GB (191.02%) Free: -20995571712.00 B (-91.02%) | 'used'=44062343168B;0:18453417164;0:20760094310;0;23066771456
@cgagnaire
Copy link
Contributor

Hi @joschi99,
Can you try without --real-swap option and compare it to the actual swap consumption ?
Thanks.

@garnier-quentin
Copy link
Contributor

I think we cannot solve it. It s an issue with 32 bits overflow.

@joschi99
Copy link
Contributor Author

Hi @garnier-quentin,
sorry for my late answer. I missed your question from Oct 29. We have the problem only if we enable the --real-swap parameter.

This is a screenshot of hosts where swap is wrong (--real-swap)
2018-12-16 20_39_14-centreon - it network monitoring

Without the option --real-swap
2018-12-16 20_41_47-centreon - it network monitoring
and all other hosts similar to them

@garnier-quentin
Copy link
Contributor

garnier-quentin commented Dec 16, 2018

I think i have found the issue. In the mode, we substract the physical memory but we don t use the right allocation units. So if the allocation unit is the same for real and virtual memory, it s ok. Otherwise...

You don t miss my question ;)

@garnier-quentin garnier-quentin self-assigned this Dec 16, 2018
@joschi99
Copy link
Contributor Author

If you have a fix I can do some test.

@garnier-quentin
Copy link
Contributor

I have done a patch. Could you test it with the following archive ?
https://github.com/garnier-quentin/centreon-plugins/archive/bug-win-real-swap.zip

@joschi99
Copy link
Contributor Author

Hi @garnier-quentin,
I have done a test and the bug seem's still there. Below you can find the test output:

[root@ivertix-bypy centreon-plugins-bug-win-real-swap]# ./centreon_plugins.pl --hostname=xxx.xxx.xxx.xxx --snmp-community=xyxyxy --snmp-version=1 --plugin=os::windows::snmp::plugin --mode=swap --warning=80 --critical=90
OK: Swap Total: 9.25 GB Used: 2.41 GB (26.01%) Free: 6.84 GB (73.99%) | 'used'=2583232512B;0:7945270067;0:8938428825;0;9931587584
[root@ivertix-bypy centreon-plugins-bug-win-real-swap]# ./centreon_plugins.pl --hostname=xxx.xxx.xxx.xxx --snmp-community=xyxyxy --snmp-version=1 --plugin=os::windows::snmp::plugin --mode=swap --warning=80 --critical=90 --real-swap
CRITICAL: Swap Total: 1.25 GB Used: -1034878976.00 B (-77.10%) Free: 2.21 GB (177.10%) | 'used'=-1034878976B;0:1073741824;0:1207959552;0;1342177280

@garnier-quentin
Copy link
Contributor

Could you provide a snmpwalk of following OID .1.3.6.1.2.1.25.2.3 ?

@joschi99
Copy link
Contributor Author

HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1
HOST-RESOURCES-MIB::hrStorageIndex.2 = INTEGER: 2
HOST-RESOURCES-MIB::hrStorageIndex.3 = INTEGER: 3
HOST-RESOURCES-MIB::hrStorageIndex.4 = INTEGER: 4
HOST-RESOURCES-MIB::hrStorageIndex.5 = INTEGER: 5
HOST-RESOURCES-MIB::hrStorageType.1 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.2 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.3 = OID: HOST-RESOURCES-TYPES::hrStorageCompactDisc
HOST-RESOURCES-MIB::hrStorageType.4 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory
HOST-RESOURCES-MIB::hrStorageType.5 = OID: HOST-RESOURCES-TYPES::hrStorageRam
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: C:\\ Label:  Serial Number 14b1885f
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: D:\\ Label:DOC  Serial Number deea7e5b
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: F:\\
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: Virtual Memory
HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: Physical Memory
HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.2 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 0 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.4 = INTEGER: 65536 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.5 = INTEGER: 65536 Bytes
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 15638527
HOST-RESOURCES-MIB::hrStorageSize.2 = INTEGER: 707755263
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: 151544
HOST-RESOURCES-MIB::hrStorageSize.5 = INTEGER: 131064
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 4194473
HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 576151736
HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.4 = INTEGER: 39422
HOST-RESOURCES-MIB::hrStorageUsed.5 = INTEGER: 55249
HOST-RESOURCES-MIB::hrStorageAllocationFailures.1 = Counter32: 0
HOST-RESOURCES-MIB::hrStorageAllocationFailures.2 = Counter32: 0
HOST-RESOURCES-MIB::hrStorageAllocationFailures.3 = Counter32: 0
HOST-RESOURCES-MIB::hrStorageAllocationFailures.4 = Counter32: 0
HOST-RESOURCES-MIB::hrStorageAllocationFailures.5 = Counter32: 0

@garnier-quentin
Copy link
Contributor

Ok that's not working. Doing a substract was a wrong idea. To monitor swap, you should use nsclient and performance counter like 'Memory, Committed Bytes', 'Memory, Pages Output/Sec'. I think we should remove that option.

@joschi99
Copy link
Contributor Author

I agree with you

garnier-quentin pushed a commit that referenced this issue Dec 20, 2018
@garnier-quentin
Copy link
Contributor

I close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants