Hi,
My bosses want to know how NCPA gets it's figures for swap because it alerts too many times when it is not really used up
I tried to reverse engineer it
can you give me the commands you use to compute swap
example right now it says swap is at 100 % on a machine , that they say is a false alarm
We use the standard check
/usr/local/nagios/libexec/check_ncpa.py -H pupmas01 -t 'radial' -P 5693 -M memory/swap -u Gi -w 90 -c 95
CRITICAL: Used swap was 100.00 % (Total: 1.13 GiB, Used: 1.13 GiB, Free: 0.00 GiB) | 'total'=1.13GiB;90;95; 'used'=1.13GiB;90;95; 'free'=0.00GiB;90;95;
{
"memory": {
"swap": {
"total": [
378540032,
"B"
],
"percent": [
100.0,
"%"
],
"free": [
0,
"B"
],
"used": [
378535936,
"B"
]
},
"virtual": {
"available": [
1485025280,
"B"
],
"total": [
12161556480,
"B"
],
"percent": [
87.8,
"%"
],
"free": [
719921152,
"B"
],
"used": [
9951240192,
"B"
]
}
}
}
How does NCPA compute swap use
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: How does NCPA compute swap use
Hello @jenstar13,
NCPA uses the python module psutil to fetch system info for memory checks. You can view the documentation here:
https://psutil.readthedocs.io/en/latest/
Try running the check command again and compare the results of the free command. Also, take a look at this blog post for some background on comparing the results.
How Do NCPA Memory Stats and Linux Utility Free Stack Up?
NCPA uses the python module psutil to fetch system info for memory checks. You can view the documentation here:
https://psutil.readthedocs.io/en/latest/
Try running the check command again and compare the results of the free command. Also, take a look at this blog post for some background on comparing the results.
How Do NCPA Memory Stats and Linux Utility Free Stack Up?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How does NCPA compute swap use
ok, thank you, i will use those docs, you can close this
thank you
Jen
thank you
Jen