SlideShare a Scribd company logo
1 of 2
"################Anar Godjaev##############################"
"################Vyg Manitor###############################"
[ora92@dbanar ]$ cat /usr/local/bin/vyg_monitor_mail.sh
SISTEMSTATE=0
DISKEXCLUDE="/usr/local/bin/vyg_monitor.sh.EXL"
HOSTNAME=`hostname`
SISTEMMESSAGE="$HOSTNAME : `date '+%d.%m.%Y %H:%M:%S '`"
WARNINGLOAD=`cat /proc/cpuinfo |grep processor| wc -l` #4
degerden yuksek ise calisir
WARNINGLOAD=$[WARNINGLOAD*2]
CRITICALLOAD=$[WARNINGLOAD*3/2]

# Sistem yuku bu

WARNINGMEM=1 #YUZDE OLARAK BOS KISIM ICIN KULLANILIR
CRITICALMEM=0 #YUZDE OLARAK BOS KISIM ICIN KULLANILIR
WARNINGPROCMEM=10000000
CRITICALPROCMEM=20000000
WARNINGDISK=90 #YUZDE OLARAK DOLULUK ORANI ICIN KULLANILIR
CRITICALDISK=95 #YUZDE OLARAK DOLULUK ORANI ICIN KULLANILIR
### Sistemde Cok Fazla Ram Tuketen Processi Kontrol Eder ####
topmem=`ps -aux|sort -nr +3|head -1|awk '{print $6}'`
if [ $topmem -gt $CRITICALPROCMEM ]
then
SISTEMSTATE=2
SISTEMMESSAGE="$SISTEMMESSAGE.n `hostname` sunucuda $[topmem/1024/1024] GB
ram kullanan process var!!! "
elif [ $topmem -gt $WARNINGPROCMEM ]
then
if [ $SISTEMSTATE -lt 1 ]; then SISTEMSTATE=1; fi
SISTEMMESSAGE="$SISTEMMESSAGE.n `hostname` sunucuda $[topmem/1024/1024] GB
ram kullanan process var!!! "
fi

#### Sistemdeki Yuku Kontrol Eder #####
LOAD=`uptime|awk -F, '{ print $4,$5,$6 }'|awk -F: '{print $2}'`
ACTIVELOAD=`echo $LOAD|awk '{print $1}'|awk -F. '{ print $1 }'`
if [[ $ACTIVELOAD -ge $CRITICALLOAD ]] ;then
SISTEMSTATE=2
SISTEMMESSAGE="$SISTEMMESSAGE.n Asiri Yuk. Yuk=$[ACTIVELOAD] "
elif [[ $ACTIVELOAD -ge $WARNINGLOAD ]] ;then
SISTEMSTATE=1
SISTEMMESSAGE="$SISTEMMESSAGE.n Yuk Artiyor. Yuk=$[ACTIVELOAD] "
fi
#### Sistemdeki BELLEGI Kontrol Eder #####
TOTALMEM=`free|grep Mem|awk '{print $2}'`
FREEMEM=`free|grep Mem|awk '{print $4}'`
FREEPERC=$[FREEMEM*100/TOTALMEM]
if [[ $CRITICALMEM -ge $FREEPERC ]] ;then
SISTEMSTATE=2
SISTEMMESSAGE="$SISTEMMESSAGE.n Bos Bellek Kalmadi. Bos Bellek=$[FREEPERC]%"
elif [[ $WARNINGMEM -ge $FREEPERC ]] ;then
if [ $SISTEMSTATE -lt 1 ]; then SISTEMSTATE=1; fi
SISTEMMESSAGE="$SISTEMMESSAGE.n Bos Bellek Azaldi. Bos Bellek=$[FREEPERC]%"
fi
### Disklerdeki Bos Alani Kontrol Eder #####
for DEV in `df -h|awk '{print $1}'|grep "/"`
do
SIZE=`df -h|grep $DEV|awk '{print $2}'`
AVAILSIZE=`df -h|grep $DEV|awk '{print $4}'`
USEPERC=`df -h|grep $DEV|awk '{print $5}'|awk -F % '{print $1}'`
MOUNTEDON=`df -h|grep $DEV|awk '{print $6}'`
if [ `grep -w $MOUNTEDON $DISKEXCLUDE|wc -l` -eq 0 ] ;then
if [[ $USEPERC -ge $CRITICALDISK ]] ;then
SISTEMSTATE=2
SISTEMMESSAGE="$SISTEMMESSAGE.n $MOUNTEDON Da Cok Az Yer
Kaldi.Kalan=$AVAILSIZE"
elif [[ $USEPERC -ge $WARNINGDISK ]] ;then
if [ $SISTEMSTATE -lt 1 ]; then SISTEMSTATE=1; fi
SISTEMMESSAGE="$SISTEMMESSAGE.n $MOUNTEDON Da Az Yer
Kaldi.Kalan=$AVAILSIZE"
fi
fi
done
echo $SISTEMMESSAGE > /tmp/vyg_monitor_mail.log
if [ $SISTEMSTATE -gt 0 ]; then
/usr/local/bin/mailtome "`hostname` ONEMLI" /tmp/vyg_monitor_mail.log
fi

More Related Content

What's hot

Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Puppet
 
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...Vi Grey
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked aboutTatsuhiko Miyagawa
 
Laporan setting dns
Laporan setting dnsLaporan setting dns
Laporan setting dnsSeptian Adi
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooYasuharu Nakano
 
London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)Dennis Knochenwefel
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetWalter Heck
 
LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js drshade
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regexbrian d foy
 
Process monitoring in UNIX shell scripting
Process monitoring in UNIX shell scriptingProcess monitoring in UNIX shell scripting
Process monitoring in UNIX shell scriptingDan Morrill
 
What is suid, sgid and sticky bit
What is suid, sgid and sticky bit  What is suid, sgid and sticky bit
What is suid, sgid and sticky bit Meenu Chopra
 
Up.Php
Up.PhpUp.Php
Up.Phpwsoom
 
Make WordPress realtime.
Make WordPress realtime.Make WordPress realtime.
Make WordPress realtime.Josh Hillier
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdRicardo Signes
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challengervanphp
 

What's hot (20)

Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
 
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
Sql inyection
Sql inyectionSql inyection
Sql inyection
 
Laporan setting dns
Laporan setting dnsLaporan setting dns
Laporan setting dns
 
Linux basic3
Linux basic3Linux basic3
Linux basic3
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring Roo
 
London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
Talk NullByteCon 2015
Talk NullByteCon 2015Talk NullByteCon 2015
Talk NullByteCon 2015
 
Process monitoring in UNIX shell scripting
Process monitoring in UNIX shell scriptingProcess monitoring in UNIX shell scripting
Process monitoring in UNIX shell scripting
 
050 qaaf
050 qaaf050 qaaf
050 qaaf
 
Shell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbaiShell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbai
 
What is suid, sgid and sticky bit
What is suid, sgid and sticky bit  What is suid, sgid and sticky bit
What is suid, sgid and sticky bit
 
Up.Php
Up.PhpUp.Php
Up.Php
 
Make WordPress realtime.
Make WordPress realtime.Make WordPress realtime.
Make WordPress realtime.
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challenger
 

Viewers also liked

Flashback (Practical Test)
Flashback (Practical Test)Flashback (Practical Test)
Flashback (Practical Test)Anar Godjaev
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOpsFrank Munz
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and RecoveryAnar Godjaev
 
How to add storage to esxi 5.5
How to add storage to esxi 5.5How to add storage to esxi 5.5
How to add storage to esxi 5.5Osama Mustafa
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productionsOsama Mustafa
 
Enable oracle database vault
Enable oracle database vaultEnable oracle database vault
Enable oracle database vaultOsama Mustafa
 
How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4Osama Mustafa
 
Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Osama Mustafa
 
Apache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script ShellApache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script ShellAnar Godjaev
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2Osama Mustafa
 
HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListMainstreethost
 
J2ee user managment using dwh builder
J2ee user managment using dwh builderJ2ee user managment using dwh builder
J2ee user managment using dwh builderOsama Mustafa
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed FilesAnar Godjaev
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOsama Mustafa
 

Viewers also liked (20)

Flashback (Practical Test)
Flashback (Practical Test)Flashback (Practical Test)
Flashback (Practical Test)
 
Database Security
Database SecurityDatabase Security
Database Security
 
11 g RAC -ASM
11 g RAC -ASM11 g RAC -ASM
11 g RAC -ASM
 
LogMiner
LogMinerLogMiner
LogMiner
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOps
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
How to add storage to esxi 5.5
How to add storage to esxi 5.5How to add storage to esxi 5.5
How to add storage to esxi 5.5
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
 
Enable oracle database vault
Enable oracle database vaultEnable oracle database vault
Enable oracle database vault
 
How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4
 
Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6
 
Oracle autovue
Oracle autovueOracle autovue
Oracle autovue
 
Apache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script ShellApache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script Shell
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2
 
HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive List
 
J2ee user managment using dwh builder
J2ee user managment using dwh builderJ2ee user managment using dwh builder
J2ee user managment using dwh builder
 
Ebs clone r12.2.4
Ebs clone r12.2.4Ebs clone r12.2.4
Ebs clone r12.2.4
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed Files
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c Installation
 

Similar to Vyg monitor

R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2ady36
 
LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6umapst
 
Getfilestruct zbksh(1)
Getfilestruct zbksh(1)Getfilestruct zbksh(1)
Getfilestruct zbksh(1)Ben Pope
 
Getfilestruct zbksh
Getfilestruct zbkshGetfilestruct zbksh
Getfilestruct zbkshBen Pope
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
 
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Amazon Web Services
 
Bloqueador cmd-sh
Bloqueador cmd-shBloqueador cmd-sh
Bloqueador cmd-shmsbertoldi
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
 
Shell Script Disk Usage Report and E-Mail Current Threshold Status
Shell Script  Disk Usage Report and E-Mail Current Threshold StatusShell Script  Disk Usage Report and E-Mail Current Threshold Status
Shell Script Disk Usage Report and E-Mail Current Threshold StatusVCP Muthukrishna
 
Mining Ruby Gem vulnerabilities for Fun and No Profit.
Mining Ruby Gem vulnerabilities for Fun and No Profit.Mining Ruby Gem vulnerabilities for Fun and No Profit.
Mining Ruby Gem vulnerabilities for Fun and No Profit.Larry Cashdollar
 

Similar to Vyg monitor (20)

Nop2
Nop2Nop2
Nop2
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
 
R57.Php
R57.PhpR57.Php
R57.Php
 
LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6
 
Getfilestruct zbksh(1)
Getfilestruct zbksh(1)Getfilestruct zbksh(1)
Getfilestruct zbksh(1)
 
Getfilestruct zbksh
Getfilestruct zbkshGetfilestruct zbksh
Getfilestruct zbksh
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
My shell
My shellMy shell
My shell
 
Ph 2
Ph 2Ph 2
Ph 2
 
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
 
serverstats
serverstatsserverstats
serverstats
 
Abstract Shambix Giovani & Impresa
Abstract Shambix Giovani & ImpresaAbstract Shambix Giovani & Impresa
Abstract Shambix Giovani & Impresa
 
distill
distilldistill
distill
 
Speeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorallSpeeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorall
 
Bloqueador cmd-sh
Bloqueador cmd-shBloqueador cmd-sh
Bloqueador cmd-sh
 
Daily notes
Daily notesDaily notes
Daily notes
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
Shell Script Disk Usage Report and E-Mail Current Threshold Status
Shell Script  Disk Usage Report and E-Mail Current Threshold StatusShell Script  Disk Usage Report and E-Mail Current Threshold Status
Shell Script Disk Usage Report and E-Mail Current Threshold Status
 
Mining Ruby Gem vulnerabilities for Fun and No Profit.
Mining Ruby Gem vulnerabilities for Fun and No Profit.Mining Ruby Gem vulnerabilities for Fun and No Profit.
Mining Ruby Gem vulnerabilities for Fun and No Profit.
 
Ipad gump
Ipad gumpIpad gump
Ipad gump
 

More from Anar Godjaev

Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from Anar Godjaev
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...Anar Godjaev
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaultAnar Godjaev
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin GüvenliğiAnar Godjaev
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden GateAnar Godjaev
 
Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumAnar Godjaev
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon ExportAnar Godjaev
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Anar Godjaev
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Anar Godjaev
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeAnar Godjaev
 
Conditional Control
Conditional ControlConditional Control
Conditional ControlAnar Godjaev
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasiAnar Godjaev
 

More from Anar Godjaev (20)

Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vault
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin Güvenliği
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
 
Contraints
ContraintsContraints
Contraints
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL Blocks
 
Wait Interface
Wait InterfaceWait Interface
Wait Interface
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasi
 
Tuning SGA
Tuning SGATuning SGA
Tuning SGA
 
Parallel Server
Parallel ServerParallel Server
Parallel Server
 
Table Partitions
Table PartitionsTable Partitions
Table Partitions
 

Vyg monitor

  • 1. "################Anar Godjaev##############################" "################Vyg Manitor###############################" [ora92@dbanar ]$ cat /usr/local/bin/vyg_monitor_mail.sh SISTEMSTATE=0 DISKEXCLUDE="/usr/local/bin/vyg_monitor.sh.EXL" HOSTNAME=`hostname` SISTEMMESSAGE="$HOSTNAME : `date '+%d.%m.%Y %H:%M:%S '`" WARNINGLOAD=`cat /proc/cpuinfo |grep processor| wc -l` #4 degerden yuksek ise calisir WARNINGLOAD=$[WARNINGLOAD*2] CRITICALLOAD=$[WARNINGLOAD*3/2] # Sistem yuku bu WARNINGMEM=1 #YUZDE OLARAK BOS KISIM ICIN KULLANILIR CRITICALMEM=0 #YUZDE OLARAK BOS KISIM ICIN KULLANILIR WARNINGPROCMEM=10000000 CRITICALPROCMEM=20000000 WARNINGDISK=90 #YUZDE OLARAK DOLULUK ORANI ICIN KULLANILIR CRITICALDISK=95 #YUZDE OLARAK DOLULUK ORANI ICIN KULLANILIR ### Sistemde Cok Fazla Ram Tuketen Processi Kontrol Eder #### topmem=`ps -aux|sort -nr +3|head -1|awk '{print $6}'` if [ $topmem -gt $CRITICALPROCMEM ] then SISTEMSTATE=2 SISTEMMESSAGE="$SISTEMMESSAGE.n `hostname` sunucuda $[topmem/1024/1024] GB ram kullanan process var!!! " elif [ $topmem -gt $WARNINGPROCMEM ] then if [ $SISTEMSTATE -lt 1 ]; then SISTEMSTATE=1; fi SISTEMMESSAGE="$SISTEMMESSAGE.n `hostname` sunucuda $[topmem/1024/1024] GB ram kullanan process var!!! " fi #### Sistemdeki Yuku Kontrol Eder ##### LOAD=`uptime|awk -F, '{ print $4,$5,$6 }'|awk -F: '{print $2}'` ACTIVELOAD=`echo $LOAD|awk '{print $1}'|awk -F. '{ print $1 }'` if [[ $ACTIVELOAD -ge $CRITICALLOAD ]] ;then SISTEMSTATE=2 SISTEMMESSAGE="$SISTEMMESSAGE.n Asiri Yuk. Yuk=$[ACTIVELOAD] " elif [[ $ACTIVELOAD -ge $WARNINGLOAD ]] ;then SISTEMSTATE=1 SISTEMMESSAGE="$SISTEMMESSAGE.n Yuk Artiyor. Yuk=$[ACTIVELOAD] " fi #### Sistemdeki BELLEGI Kontrol Eder ##### TOTALMEM=`free|grep Mem|awk '{print $2}'` FREEMEM=`free|grep Mem|awk '{print $4}'` FREEPERC=$[FREEMEM*100/TOTALMEM] if [[ $CRITICALMEM -ge $FREEPERC ]] ;then SISTEMSTATE=2 SISTEMMESSAGE="$SISTEMMESSAGE.n Bos Bellek Kalmadi. Bos Bellek=$[FREEPERC]%"
  • 2. elif [[ $WARNINGMEM -ge $FREEPERC ]] ;then if [ $SISTEMSTATE -lt 1 ]; then SISTEMSTATE=1; fi SISTEMMESSAGE="$SISTEMMESSAGE.n Bos Bellek Azaldi. Bos Bellek=$[FREEPERC]%" fi ### Disklerdeki Bos Alani Kontrol Eder ##### for DEV in `df -h|awk '{print $1}'|grep "/"` do SIZE=`df -h|grep $DEV|awk '{print $2}'` AVAILSIZE=`df -h|grep $DEV|awk '{print $4}'` USEPERC=`df -h|grep $DEV|awk '{print $5}'|awk -F % '{print $1}'` MOUNTEDON=`df -h|grep $DEV|awk '{print $6}'` if [ `grep -w $MOUNTEDON $DISKEXCLUDE|wc -l` -eq 0 ] ;then if [[ $USEPERC -ge $CRITICALDISK ]] ;then SISTEMSTATE=2 SISTEMMESSAGE="$SISTEMMESSAGE.n $MOUNTEDON Da Cok Az Yer Kaldi.Kalan=$AVAILSIZE" elif [[ $USEPERC -ge $WARNINGDISK ]] ;then if [ $SISTEMSTATE -lt 1 ]; then SISTEMSTATE=1; fi SISTEMMESSAGE="$SISTEMMESSAGE.n $MOUNTEDON Da Az Yer Kaldi.Kalan=$AVAILSIZE" fi fi done echo $SISTEMMESSAGE > /tmp/vyg_monitor_mail.log if [ $SISTEMSTATE -gt 0 ]; then /usr/local/bin/mailtome "`hostname` ONEMLI" /tmp/vyg_monitor_mail.log fi