Help in making a basic bash script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help in making a basic bash script
# 1  
Old 06-26-2013
Help in making a basic bash script

Hi All,

I am trying to monitor CPU load of few processes, with the same name.
The output that I get from top is the following

28171 root 20 0 1089m 21m 3608 S 103 0.3 15:16.89 /opt/ppp//h264rtptranscoder.bin --videoPort=14504 --audioPort=14505
27589 root 20 0 1060m 23m 3548 S 94 0.3 35:16.57 /opt/ppp/h264rtptranscoder.bin --videoPort=14500 --audioPort=14501

The problem I see here is that top reports my CPU utilisation per core, not avg.
I wanna put the avg load for each process in a nice graph in zabbix.
Anyone who did it before ?

Last edited by liviusbr; 06-26-2013 at 07:08 AM..
# 2  
Old 06-26-2013
Hello,

I can help you to find out the load in UNIX/AIX as follows.

Code:
 
$ vmstat 1 3 | awk '{print$14" "$15" "$16}'
 
 
us sy id
2 3 95
0 0 99
0 1 99
$


Where we can put this code in script and schedule the script timings to per hour or per 5 mins as per your requirement and we can prepare a report later on by same.

Please let me know your thoughts.




Thanks,
R. Singh
# 3  
Old 06-26-2013
I would suggest you go for PERL here unless you cant manage within ZABBIX..
# 4  
Old 06-26-2013
Hi Ravinder,

VMSTAT is good, but does not display the process name/path. Any way to do that ?

---------- Post updated at 05:59 PM ---------- Previous update was at 04:34 PM ----------

I guess ps -aux would do the trick. The processes are differentiated by port. The name is the same.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash on Fedora error on basic script

I am not able to execute bash script on Fedora. They were running on another environment. This is a sample script: #!/usr/bin/bash input="./data/heu/hout1" i=1 j=0 while IFS= read -r file1 do #Some code here done < "$input" #echo $j I get an error: bash: s.sh: command not... (3 Replies)
Discussion started by: ngabrani
3 Replies

2. UNIX for Beginners Questions & Answers

Beginner bash - basic shell script 'while' help...

Hi everyone, first time visitor to these forums here. Keeping a long story short I've been attempting to learn how to code in bash. I have VERY little previous experience with coding languages besides simply copying and pasting batch scripts for Windows. So, with that in mind I've followed a... (4 Replies)
Discussion started by: Meta
4 Replies

3. Shell Programming and Scripting

Making bash script allways executable when transfer ?

Does it possible to make some bash script automatic to be a executable when transfered to another pc...? (5 Replies)
Discussion started by: tomislav91
5 Replies

4. Shell Programming and Scripting

Bash script for making complexes of ligands and receptor

I am working with autodock vina for virtual screening and docking with cygwin. Autodock vina generates conformers for multiple ligands. I want to make the complex of these conformers with receptor. e.g. I have 100 .pdbqt files form vina output and one receptor pdbqt file. By running command- cut... (1 Reply)
Discussion started by: Rajesh Patil
1 Replies

5. Shell Programming and Scripting

Making a bash script and small C program for a homework assignment

Here's the assignment. I'll bold the parts that are rough for me. Unfortunately, that's quite a bit lol. The syntax is, of course, where my issues lie, for the most part. I don't have a lot of programming experience at all :/. I'd post what I've already done, but I'm so lost I really don't know... (1 Reply)
Discussion started by: twk101
1 Replies

6. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

7. Shell Programming and Scripting

bash: making a count

ok basically im trying to count how many people fail a class by comparing there grade by -gt 49 i tried putting a count inside the while loop but i know you cant access a count outside a subshell. is there an easy way to count the number of failures? declare -i failcount=0 awk... (2 Replies)
Discussion started by: nilekyle
2 Replies

8. UNIX for Dummies Questions & Answers

Basic Unix bash script help

Hello there Been using Unix bash scripting for two days now so am very new to this. I am currently doing a project now and i'm basically making a noughts and crosses game (or tic tac toe). I have created the board using an array. When I try and check to see if the array is empty using an If... (3 Replies)
Discussion started by: ChrisHoogie
3 Replies

9. Shell Programming and Scripting

Making a progress gauge in a bash script

Hello once again: One thing that seems to be a nice feature is a progress gauge... so I can see how long an operation will take for a task to complete if it is requiring a lot of processing or the file is enormous. I have seen references to gauge operations, but I don't know anything about it or... (1 Reply)
Discussion started by: ccox85
1 Replies

10. UNIX for Dummies Questions & Answers

Basic question for making remote mount points

I'm on SunOS 5.8. I'm not sure of the exact terminology, but I want to make a "remote mount" from my server to another server. (Basically I want to create one of the mount points on my server be a shared volume that's on another server here). So if I do a df -k, I want to see all of the volumes... (1 Reply)
Discussion started by: FredSmith
1 Replies
Login or Register to Ask a Question