Performance Monitoring script for UNIX servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Performance Monitoring script for UNIX servers
# 1  
Old 03-19-2014
Performance Monitoring script for UNIX servers

Hi,

I have been working on writing an automated script that will run 24x7 to monitor the performance parameters like CPU,Memory,Disk I/O,Network,SWAP Space etc for all types of Unix servers ( HP-UX,AIX,SOLARIS,LINUX).

Problem is I am confused with the commands top,prstat,vmstat,free,sar etc.

Can anyone help me to understand which is the best command that provides info about CPU and Memory for all or individually(Solaris,AIX,Linux,HP-UX).

Also please share any of the scripts you have for monitoring the performance of Unix servers and any other parameters that are needed to monitor to judge the performance of an Application or Database Server



Thanks in advance....

Regards
SSK250 SmilieSmilie
# 2  
Old 03-19-2014
As a generalization, most basic commands will work on most UNIX flavors. POSIX does not have much to say about what and how system and system management commands look like or how they behave.

Try what I think is the original UNIX Rosetta stone:

Rosetta Stone for Unix

Then you may reduce the scope your project. Plus you will need a running version of each to unit test.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 03-19-2014
Make sure that you read the manual pages on each system even if the command names are the same. You may get slight variations in output column names, positions etc., so you might need to create a flexible script that you can adjust easily, e.g. if you have a command output to:-
Code:
...... | read col1 col2 col3 col4 col5 rest
do
   echo "The val I want is $col5"
done

.... then you need to be careful that you always want column 5.


I hope that this helps you avoid some surprises. Smilie


Robin
# 4  
Old 03-20-2014
Have you considered using a SNMP deamon and check for alert conditions using that.

There are already quite a few commercial status monitoring tools around (Nagios/SolarWinds/Cacti come to mind) that can send SMS/email etc. alerts whenever a number of conditions arise, monitor and graph trends and the like.
# 5  
Old 03-21-2014
Most people monitor RAM and SWAP, but the resulting figures are rather of academic interest, and alarm thresholds are even problematic.
More relevant is the sum of them, virtual memory (let's call it VMEM).
Here is a quick-and-dirty implementation:
Code:
case `uname` in
Linux)
  # deduct some cached data because it is easily reclaimable
  used=`free | awk '
/^[Mm]em/ {used+=$3; eused+=$3-($6+$7)/f; free+=$4}
/^[Ss]wap/ {used+=$3; eused+=$3; free+=$4}
END {print int(eused*100/(used+free))}
' f=2`
  ;;
SunOS)
  used=`swap -s | nawk '{print int($9*100/($11+$9))}'`
  ;;
esac

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

HELP - Resource/Performance Monitoring Script - Red Hat Enterprise Linux Server

Hi all, ------------------------- Linux OS Version/Release: ------------------------- Red Hat Enterprise Linux Server release 5.5 (Tikanga) Linux <hostname> 2.6.18-194.8.1.el5 #1 SMP Wed Jun 23 10:52:51 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux I have a server that hosts 30+ Oracle... (1 Reply)
Discussion started by: newbie_01
1 Replies

2. Solaris

Performance Monitoring

Hi all, I am planning to give a presentation on performance measure. I have decided to focus on the commands which are used to know the performance of the server. I have a idea of prstat,vmstat,netstat, and iostat. Could anybody suggest me any other commands which are used for perforamance... (7 Replies)
Discussion started by: priky
7 Replies

3. Linux

Linux/Unix performance monitoring

This is my first post (yes I'm a newbie).... :D I'm looking for a list of Linux and Unix commands for performance monitoring and a good sight or area on this site that would have man pages and or information on those commands..... Thanks if anyone can take the time to post..... :cool: (14 Replies)
Discussion started by: harrisjl
14 Replies

4. UNIX for Advanced & Expert Users

MOnitoring Software for Unix servers

Guys, I need a monitoring software for my Unix servers. Over the last couple of years, the number has increased to well over 40 servers. All have different applications running on them and it is impossible to go to everyone of them and do checks. I was using Spotlight on Unix. I was... (1 Reply)
Discussion started by: jair
1 Replies

5. UNIX for Dummies Questions & Answers

Unix Performance Monitoring

In the vmstat , there are many columns you can see. Can someone tell me what is the most important column that i need to be watched on, and what value or average value should i watch inorder to determine that im experiencing a cpu bottle neck. What should be my basis. or if you use glance ... (2 Replies)
Discussion started by: kaibiganmi
2 Replies

6. UNIX for Dummies Questions & Answers

Unix performance monitoring counters

Which performance counters you might to define as "The most important counters in checking unix performance" (3 Replies)
Discussion started by: gen4ik
3 Replies

7. UNIX for Dummies Questions & Answers

Performance monitoring

Hello, I am trying to find a way to view current CPU and disk usage. I used to use nmon which worked fine but since an upgrade to our servers this is no longer available. I have tried to get it reinstalled to no avail! Are there any other commands you can use within unix which will allow me... (4 Replies)
Discussion started by: johnwilliams
4 Replies

8. UNIX for Advanced & Expert Users

Performance Monitoring

Hi all The place I work for is about to to place there database server under heavy load for testing and would like the effect recorded as much as possible. Can anyone point me in the right direction with respect to real time system monitoring. I am aware of of 'sar', vmstat etc and hope to... (2 Replies)
Discussion started by: silvaman
2 Replies

9. UNIX for Dummies Questions & Answers

hardware monitoring on unix servers (Sun and Bull AIX)

Hello, I was given the task to write a shell script that must detect hardware problems on Unix Solaris and AIX servers. Problems that should be detected by this script are for example: abnormally high temperature or voltage etc... So, does anyone know if that kind of information is logged in a... (2 Replies)
Discussion started by: VeroL
2 Replies

10. UNIX for Dummies Questions & Answers

Unix performance monitoring via Windows/NT

We are trying to Monitor Unix via Window95/98 on an NT network. Is there anyone that could point us in the direction on software that runs in Windows on a Telnet connection that we could use to accomplish this? We have tried a program called Unix Watcher by Etasoft and can' get it to connect. ... (6 Replies)
Discussion started by: btrout
6 Replies
Login or Register to Ask a Question