Sponsored Content
Top Forums UNIX for Beginners Questions & Answers High Memory threshold notification script Post 303042492 by seenuvasan1985 on Friday 27th of December 2019 04:48:26 AM
Old 12-27-2019
High Memory threshold notification script

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?

Code:
#!/bin/bash
# Shell script to monitor or watch the high Mem-load
# It will send an email to $ADMIN, if the (memroy load is in %) percentage
# of Mem-load is >= 80%
HOSTNAME=`hostname`
LOAD=80.00
CAT=/bin/cat
MAILFILE=/tmp/mailviews
MAILER=/bin/mail
mailto="skrishna1@xxx.com"
MEM_LOAD=`free -t | awk 'FNR == 2 {printf("Current Memory Utilization is : %.2f%"), $3/$2*100}'`
if [[ $MEM_LOAD > $LOAD ]];
then
PROC=`ps -eo pcpu,pid -o comm= | sort -k1 -n -r | head -1`
echo "Please check your processess on ${HOSTNAME} the value of cpu load is $CPU_LOAD % & $PROC" > $MAILFILE
echo "$(ps axo %mem,pid,euser,cmd | sort -nr | head -n 10)" > $MAILFILE
$CAT $MAILFILE | $MAILER -s "Memory Utilization is High > 80%, $MEM_LOAD % on ${HOSTNAME}" $mailto
fi


Last edited by Scrutinizer; 12-27-2019 at 06:53 AM.. Reason: Please use code tags!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix Script to find and kill a process with high memory utilization

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)
Discussion started by: robinforlinux
0 Replies

2. Solaris

How to change CPU threshold high temperature

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)
Discussion started by: Danielz
2 Replies

3. HP-UX

11.31 System Memory too high

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)
Discussion started by: trunecm1
4 Replies

4. Shell Programming and Scripting

help in high memory usage alert script

can any one please help me to shell script high memory usage alert (6 Replies)
Discussion started by: robo
6 Replies

5. Solaris

zone breaching 'capped-memory' threshold

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)
Discussion started by: soliberus
4 Replies

6. UNIX for Dummies Questions & Answers

Threshold for swap memory

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)
Discussion started by: karlochacon
3 Replies

7. Shell Programming and Scripting

Cron job and shell script to kill a process if memory gets to high

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)
Discussion started by: prometheon123
19 Replies

8. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

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)
Discussion started by: edydsuranta
4 Replies

9. Solaris

High Memory Utilization

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)
Discussion started by: myrpthidesis
1 Replies

10. Solaris

How the free memory threshold?

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)
Discussion started by: hicksd8
4 Replies
AMANDA-INTERACTIVIT(7)						    Miscellanea 					    AMANDA-INTERACTIVIT(7)

NAME
amanda-interactivity - Configuring Interactivity with Amanda Amanda DESCRIPTION
Amanda uses interactivity to ask user to load specific volumes when they are needed. This manual page describes the interactivity modules included with Amanda. This is a user-level description of the API, and does not address details that are only of concern to developers of new interactivity plugins. For that purpose, consult the Amanda source code, perldoc 'Amanda::Interactivity' and http://wiki.zmanda.com. DEFINING INTERACTIVITY
Interactivity is specified in amanda.conf(5) as follows: define interactivity $interactivity_name { comment "$comment" plugin "$pluginname" property "$PROPERTY_NAME" "$PROPERTY_VALUE" ... } and then referenced in the global section as interactivity "$interactivity_name" Interactivity properties, like Amanda configuration parameters, are insensitive to case, and - (dash) and _ (underscore) may be used interchangeably. See the individual plugin sections, below for properties applicable to each plugin. INTERACTIVITY MODULES
Amanda provides three interactivity modules, tty, email and tty_email. TTY The tty interactivity module uses the tty to communicate with the user, it works only if a terminal is available, which is the case if amanda is executed from a command line. When promted for a volume, the user must put the requested volume in the changer and type <enter>. User can type the name of another changer if the volume is available in that changer. Typing 'abort' will abort the operation. EMAIL The email interactivity module uses email to send requests to the user, and reads replies from the filesystem. The email module has many properties: check-file If set, amanda will check this file for user input. The user can touch the file to tell amanda that the requested volume was inserted in the changer. If the user writes the name of a changer into the file, Amanda will use that changer. If the user writes the word 'abort' into the file, the scan will be aborted. check-file-delay Default: 10. This integer property indicates the time in seconds between each check of the check-file. mailto Default: global value of mailto. The email addresses to which the email should be sent. If multiple addresses are given, they should be separated by spaces. resend-delay Default 0. The time in seconds between emails. Amanda will resend the same email at this frequency, which can be useful if mailto is a pager or phone. If set to 0, only one email is sent. TTY_EMAIL The tty_email interactivity module uses the tty module if a terminal is available and uses the email module otherwise. Its properties are a combination of properties from each module. EXAMPLE
define interactivity "by-tty-or-email" { comment "Send email on runs from cron; use terminal on command line" plugin "tty_email" property "mailto" "admin1" "admin2" "me@home" property "resend-delay" "1800" #every 30 minutes property "check-file" "/tmp/email_input" property "check-file-delay" "10" #every 10 seconds } SEE ALSO
amanda(8), amanda.conf(5) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHOR
Jean-Louis Martineau <martineau@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Amanda 3.3.1 02/21/2012 AMANDA-INTERACTIVIT(7)
All times are GMT -4. The time now is 06:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy