Hello Folks,
I have created the script which use to send email notification when server memory breach the threshold limits. Script works fine, but the issue is sometimes i am receiving mail alerts for lower threshold memory also.
Please let me know why and any updates required in script?
Last edited by Scrutinizer; 12-27-2019 at 07:53 AM..
Reason: Please use code tags!!
What Linux version are you using?
Check the difference between free memory and available memory.
With older Linux versions check the -/+ buffers/cache: line.
The buffers/cache/slab memory is memory that is used to speed up things, but that is available when an application needs it.
So consider leaving that out when reporting memory usage..
--
When used with [[ .. ]] , the < and > operators sort lexicographically using the current locale. So it is a string comparison which may lead to surprising results.
For numerical comparison use either the test utility :
like Neo suggested,
or use bash' s arithmetic comparison
Note: like the test utility, arithmetic comparison in bash cannot handle floating point. So you need to round down / truncate the numbers used in the comparison. So for example use LOAD=80 rather than LOAD=80.00. If you need floating point you need to use an external utility like bc.
Last edited by Scrutinizer; 12-27-2019 at 10:48 AM..
Then you can disregard the stuff about older Linux versions, so check the difference between "free memory" and "available memory", plus the remarks by Neo and I about numerical comparisons..
There are several further mistakes in your script:
Text message in MEM_LOAD (that you cannot compare with a numeric value),
two useless code lines about PROC and CPU_LOAD,
useless use of echo,
useless use of cat,
unnecessary and unsafe use of a /tmp/ file.
These 2 Users Gave Thanks to MadeInGermany For This Post:
If I understand your question correctly, you are asking for an explanation of Solaris memory manager. You'd better ask Oracle that question because you are talking about Solaris kernel internals.
The operating system kernel has no reason to kick a process's memory set out of real memory until... (4 Replies)
Hello Guys,
I have one Solaris server with high memory utilization >90%. As per checking, below is the output for memory usage.
bash-3.00# ps -efo pmem,uid,pid,ppid,pcpu,comm | sort -r
%MEM UID PID PPID %CPU COMMAND
1.7 29496 20668 1 0.0 /opt/app/iw-home/tools/java/bin/java
1.5... (1 Reply)
Hi Experts,
Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing.
Why memory utilization on solaris always looks high?
I have statement about memory on solaris, is this true:
Memory in solaris is used for... (4 Replies)
Hello,
I'd like to set a cron job that runs a shell script every 30 minutes or so to restart a java based service if the memory gets above 80%. Any advice on how to do this?
Thanks in advance!
- Ryan (19 Replies)
hi guys
the monitoring team is using a tool for monitoring linux boxes and they set an alarm for swap memory to 10%(critical) I really has no idea when swap memory usage is high....
Can someone recommend me a threshold for this? when is warning or critical and this parameters can affect... (3 Replies)
Calling upon all Solaris zone experts.
I have a Sun T3-1 that is running a few whole-root zones. I've set the 'capped-memory' setting on all the zones.
However, I have a problem on the one zone. Under load it uses more memory that has been allocated to it.
zonecfg -z sunrep02 export
... (4 Replies)
Hello, I noticed very high system memory utilization on my new 11.31 Itanium systems. System memory is more than 11GB on 32 GB system. Comparing this to 11.23 it's more than double ... How do I find out what is using it? Is there a way to reduce it?
Thank you,
Kubo (4 Replies)
Hi,
I have a NETRA 240 server wich should work on high temperature environment (up to 50 deg celsius). After reaching ~48 deg, the system is shuting down.
The HighShutDownThreshold of the CPU is set to 89 deg
The PowerOffThreshold of the CPU is set to 96 deg
Please help me to change these... (2 Replies)
Hi Unix Gurus i am somewhat new to unix scripting so need your help to
create a script as below.
# This script would find the process consuming memory beyond a certain #limit. if the meemory consumption is more than 100% for a period of 1
# minute for the specific process. the script would... (0 Replies)