Sponsored Content
Top Forums Shell Programming and Scripting Monitor the CPU load for each process and total Post 302826449 by liviusbr on Thursday 27th of June 2013 08:22:28 AM
Old 06-27-2013
Monitor the CPU load for each process and total

Hi guys,

I have to set up a script which monitors the amount of AVG CPU load per each process and also the total load for a sum of processes.

The processes have the same name, I can only differentiate by port number they listen to, as follows :

Code:
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


Then, my idea is to put the samples into a graph in Zabbix.

Any thoughts on how can I accomplish this ?


Thanks,

Liviu

---------- Post updated 06-27-13 at 03:22 PM ---------- Previous update was 06-26-13 at 10:52 PM ----------

Guys, anyone ?

Last edited by pludi; 06-27-2013 at 09:46 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

load monitor script

I need help in finding a script to monitor loads for 8+ servers on a single console. The goal here is to centralize it and run the script from a single server. Can anyone help on this? Im running this script on each server to monitor the load. while true; do w | grep average | grep -v grep... (7 Replies)
Discussion started by: locabuilt
7 Replies

2. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

3. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

4. Programming

how to monitor the child process on which cpu core

Hi all. Sorry to express my questions wrongly in my early post,I repost my question again here. My pc has dual core, I wirte an application with two process, parents process and child process. My quetion is how to realize :if the child process is on core 0,it will tell me I'm on core 0,if it... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

5. Shell Programming and Scripting

System Health - Cpu, Load, IO Monitor

hello there, can someone please tell me the commands that makes sense, from a production point of view, to be used to make sure CPU, LOAD or IO usages on a Linux or Solaris server isn't too high? I'm aware of vmstat, iostat, sar. But i seriously need real world advice as to what fields in... (1 Reply)
Discussion started by: SkySmart
1 Replies

6. UNIX for Dummies Questions & Answers

Total cpu usage in percent(%)

How to determine the total percentage cpu usage of a server having 4 cpu cores(quad core)? (3 Replies)
Discussion started by: proactiveaditya
3 Replies

7. Shell Programming and Scripting

Restart debian server if one specific process has more than 10 seconds have high cpu load

Hi, could someone give me an example for a debian server script? I need to check a process if the process has a high cpu load (top). If yes the whole server needs to reboot. Thats it, nothing more. ;) Hope someone could help me. Regards woisch (2 Replies)
Discussion started by: woisch
2 Replies

8. Shell Programming and Scripting

Shell script to monitor process with high CPU

Hi, Linux redhat 5.5 I need to write a kshell script that shows all the process that consume 100% CPU (or more. strange but there are time that top shows higger value that 100) and they are active more than 5 minute. The top command shows all the relevat information: The PID of the cpu ,... (0 Replies)
Discussion started by: yoavbe
0 Replies

9. Solaris

Total CPU usage on a server

hi, i am using solaris server. I want to find the total CPU usage on a server. Top command will give that result, but here that command is not working. So anyone can help me to find the total CPU usage. (2 Replies)
Discussion started by: Arasu123
2 Replies

10. Linux

Linux Total Processes - Why monitor it?

Hi Guys, Monitoring 'Total Processes' on Linux servers has been always something you 'should' do. My question is - why? Is it relevant anymore? If you monitor memory and cpu params, you have a pretty good idea about what's going on. Is the number of processes really matter? Thanks (1 Reply)
Discussion started by: DjDeaf
1 Replies
PPPCTL(8)						    BSD System Manager's Manual 						 PPPCTL(8)

NAME
pppctl -- PPP control program SYNOPSIS
pppctl [-v] [-t n] [-p passwd] [host:]Port | LocalSocket [command[;command]...] DESCRIPTION
This utility provides command line control of the ppp(8) daemon. Its primary use is to facilitate simple scripts that control a running dae- mon. The pppctl utility is passed at least one argument, specifying the socket on which ppp is listening. Refer to the 'set server' command of ppp for details. If the socket contains a leading '/', it is taken as an AF_LOCAL socket. If it contains a colon, it is treated as a host:port pair, otherwise it is treated as a TCP port specification on the local machine (127.0.0.1). Both the host and port may be speci- fied numerically if you wish to avoid a DNS lookup or do not have an entry for the given port in /etc/services. All remaining arguments are concatenated to form the command(s) that will be sent to the ppp daemon. If any semi-colon characters are found, they are treated as command delimiters, allowing more than one command in a given 'session'. For example: pppctl 3000 set timeout 300; show timeout Do not forget to escape or quote the ';' as it is a special character for most shells. If no command arguments are given, pppctl enters interactive mode, where commands are read from standard input. When reading commands, the editline(3) library is used, allowing command-line editing (with editrc(5) defining editing behaviour). The history size defaults to 20 lines. The following command line options are available: -v Display all data sent to and received from the ppp daemon. Normally, pppctl displays only non-prompt lines received. This option is ignored in interactive mode. -t n Use a timeout of n instead of the default 2 seconds when connecting. This may be required if you wish to control a daemon over a slow (or even a dialup) link. -p passwd Specify the password required by the ppp daemon. If this switch is not used, pppctl will prompt for a password once it has success- fully connected to ppp. ENVIRONMENT
The following environment variables are understood by pppctl when in interactive mode: EL_SIZE The number of history lines. The default is 20. EL_EDITOR The edit mode. Only values of "emacs" and "vi" are accepted. Other values are silently ignored. This environment variable will override the bind -v and bind -e commands in ~/.editrc. EXAMPLES
If you run ppp in -auto mode, pppctl can be used to automate many frequent tasks (you can actually control ppp in any mode except interactive mode). Use of the -p option is discouraged (even in scripts that are not readable by others) as a ps(1) listing may reveal your secret. The best way to allow easy, secure pppctl access is to create a local server socket in /etc/ppp/ppp.conf (in the correct section) like this: set server /var/run/internet "" 0177 This will instruct ppp to create a local domain socket, with srw------- permissions and no password, allowing access only to the user that invoked ppp. Refer to the ppp(8) man page for further details. You can now create some easy-access scripts. To connect to the internet: #! /bin/sh test $# -eq 0 && time=300 || time=$1 exec pppctl /var/run/internet set timeout $time; dial To disconnect: #! /bin/sh exec pppctl /var/run/internet set timeout 300; close To check if the line is up: #! /bin/sh pppctl -p '' -v /var/run/internet quit | grep ^PPP >/dev/null if [ $? -eq 0 ]; then echo Link is up else echo Link is down fi You can even make a generic script: #! /bin/sh exec pppctl /var/run/internet "$@" You could also use pppctl to control when dial-on-demand works. Suppose you want ppp to run all the time, but you want to prevent dial-out between 8pm and 8am each day. However, any connections active at 8pm should continue to remain active until they are closed or naturally time out. A cron(8) entry for 8pm which runs pppctl /var/run/internet set filter dial 0 deny 0 0 will block all further dial requests, and the corresponding 8am entry pppctl /var/run/internet set filter dial -1 will allow them again. SEE ALSO
ps(1), editline(3), editrc(5), services(5), ppp(8) HISTORY
The pppctl utility first appeared in FreeBSD 2.2.5. BSD
June 26, 1997 BSD
All times are GMT -4. The time now is 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy