Solaris CPU/memory status monitoring (Shell script or c++)


 
Thread Tools Search this Thread
Top Forums Programming Solaris CPU/memory status monitoring (Shell script or c++)
# 1  
Old 05-08-2009
Solaris CPU/memory status monitoring (Shell script or c++)

i'm trying to find a way to monitor the CPU/Memory status of a solaris station using vmstat. I like to write a small script to periodically run vmstat and store the output. Can anyone show me how (preferrably in C++ if possible)? Thanks in advance.
# 2  
Old 05-12-2009
Why C++ to do something that a shell script seems better suited to ?
# 3  
Old 05-12-2009
Quote:
Originally Posted by jlliagre
Why C++ to do something that a shell script seems better suited to ?
No reason really, i'm just not familiar with shell script. Shell script is also find if you already have one that i can use?
# 4  
Old 05-12-2009
I have no script available but that would be trivial to write a oneliner called from the crontab to achieve that.
# 5  
Old 05-12-2009
Quote:
Originally Posted by jlliagre
I have no script available but that would be trivial to write a oneliner called from the crontab to achieve that.
and that's why i was saying i'm not familiar at all with shell script. It is not trivial to me.
# 6  
Old 05-12-2009
It would help if you describe better your requirements.

"Periodically run vmstat"
Code:
 EDITOR=vi crontab -e
...
<when> <what>

with "when" being something depending on the sampling interval you are looking for and "what" being:
"run vmstat and store the output":
Code:
 vmstat options > outputfile.timestamp

There are many free and commercial tools that would do a better job to collect and display that data though.
# 7  
Old 05-12-2009
Quote:
Originally Posted by jlliagre
It would help if you describe better your requirements.

"Periodically run vmstat"
Code:
 EDITOR=vi crontab -e
...
<when> <what>

with "when" being something depending on the sampling interval you are looking for and "what" being:
"run vmstat and store the output":
Code:
 vmstat options > outputfile.timestamp

There are many free and commercial tools that would do a better job to collect and display that data though.
I'm looking at crontab now to see how it works. Thanks a lot for pointing that out.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Monitoring shell script if object is down and it should update the child objects status as well

Viewers Please help me to get out of the below issue.. Thanks in advance Required shell script for Monitoring status of the objects and it should update the child objects status as well. Requirements:- 1. We are working on IIB (IBM Integration Bus v10) and trying to implement the broker ('... (0 Replies)
Discussion started by: dsreddy447
0 Replies

2. Shell Programming and Scripting

Shell script for logging cpu and memory usage of a Linux process

I am looking for a way to log and graphically display cpu and RAM usage of linux processes over time. Since I couldn't find a simple tool to so (I tried zabbix and munin but installation failed) I started writing a shell script to do so The script file parses the output of top command through... (2 Replies)
Discussion started by: andy_dufresne
2 Replies

3. Shell Programming and Scripting

Shell script to find Memory status in AIX

Hi All, There is a shell script that captures Memory status in AIX 6.1 64 bits! I need it to be validated by shell script experts for the following: Shell Script: cat memusageAIX.sh #!/usr/bin/ksh # # Memory usage under AIX # USED=`svmon -G | head -2 | tail -1 | awk '{ print $3... (1 Reply)
Discussion started by: a1_win
1 Replies

4. Shell Programming and Scripting

shell script to alert cpu memory and disk usage help please

Hi all can any one help me to script monitoring CPU load avg when reaches threshold value and disk usage if it exceeds some % tried using awk but when df -h out put is in two different lines awk doesnt work for the particular output in two different line ( output for df -h is in two... (7 Replies)
Discussion started by: robo
7 Replies

5. Linux

Memory monitoring and sending alert mail to users in network using shell script

i m workiing on a shell script which may monitors network memory and send alert to user if it increase a threshold (1 Reply)
Discussion started by: navdeep5673
1 Replies

6. Solaris

[problem]Make minimalis CPU and Memory Solaris 10

Dear All master We have Sunfire memory 16G memory and 8 Processor. I install with Solaris 10, but i think resource that use all proccess is very much, I installed this machine 3 times, twice install Oracle the load process make machine is very slow. in new install process like this,... (1 Reply)
Discussion started by: moslemovic
1 Replies

7. HP-UX

HPUX monitoring and alerting script per CPU

Hi Guys, Hopefully someone would be able to help me out. Basically I have an HPUX 11.11i system which is backed up by Data Protector 4.5. Every so often the vdba process hangs and chews up 100% of one of the systems CPU resources. As our monitoring tool can only monitor on a per system basis... (3 Replies)
Discussion started by: fulhamfcboy
3 Replies

8. UNIX for Dummies Questions & Answers

monitoring cpu and memory of the unix box

Hi all, Unix has the TOP and SAR command to monitor machine's performance. Can it be used in a script to alert if the cpu utilization is more than 80 or memory used is more than 90. Is SAR preferable than TOP? Please advise. (3 Replies)
Discussion started by: er_ashu
3 Replies

9. UNIX for Advanced & Expert Users

command for CPU online/offline status in bash shell

Hi , How do i check that the CPU is online/offline in a multi CPU machine in Linux ? i tired /proc/cpuinfo dmesg nothing gave me the currect CPU status. Pls help !! (5 Replies)
Discussion started by: sars
5 Replies

10. UNIX for Advanced & Expert Users

CPU monitoring script

I looking for a very basic, script that monitors the load on the cpu and writes it to a text file. Can anyone help please? (4 Replies)
Discussion started by: alpha_manic
4 Replies
Login or Register to Ask a Question