Link to home
Start Free TrialLog in
Avatar of fosiul01
fosiul01Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Linux processes monitor and utilization graph

HI
as far i belived there is not any thing on the self to  monitor processes and graph their utilization... ..

but may be i am wrong.. so please advise me .. if im wrong.
what i am after is :

i want to monitor : Process and their utilization and make a graph. its simple word make a bench mark system

example : when i isntall  a brand new os with some services (anywhintg)

the script or  program with start to monitor all the process or atlest first 10 high cpu and memory base process . and will create  a graph for that.

the reason is : suppose one process "mysqld" is normally using 10% cpu.. now its jumped to 80% cpu.. now we know where is the issue. from it will tell us from when it started ..

example : we us Vritualbox.. so we have 3 vms ..
now if we monitor those 3 vm whose cpu utilization is 30%., now if some one jumped to 80% , we know whic is problem and also we will be able to tell from when .. by looking at graph..


is there any script or cacti graph or n agios  .. or anything out there to do this task ??


or i might start to think to build some thing from scratch ..

thanks for your help ..
SOLUTION
Avatar of raysonlee
raysonlee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of raysonlee
raysonlee

sysstat, atop and many more...
Avatar of sugunakar
you can install munin and write a custom plugin to get the desired output.

OR you can enable sar in your system and store the historical data with you as well.
you can use ksar  or the other tool listed at below which would convert sar output to rrdgraphs.
http://www.trickytools.com/php/sar2rrd.php
Avatar of fosiul01

ASKER

Hi thanks for response .. but let me try to explain again

i know what those tools does(sysstat, atop ) and i used all off them..  
lets starts from  bellow commands

 ps auxf | sort -nr -k 4 | head -10
root      2256 14.5  6.9 877704 428720 ?       Sl   09:12  13:51  \_ /usr/lib/virtualbox/VirtualBox --comment xxxx --startvm e30d01f7-3f4c-495a-a873-026979b67c1a --no-startvm-errormsgbox
root      2354 10.5  5.5 789692 341192 ?       Sl   09:13   9:50  \_ /usr/lib/virtualbox/VirtualBox --comment xxxx --startvm 7bf80cef-c6b7-4370-865b-46beeb638d5d --no-startvm-errormsgbox
root      2283 10.5  3.0 646912 187692 ?       Sl   09:12  10:01  \_ /usr/lib/virtualbox/VirtualBox --comment xxx --startvm 72e2e333-a114-482c-aa33-9b23e7c469ff --no-startvm-errormsgbox
root      1316  1.1  0.9 143508 56180 tty7     Ss+  09:11   1:04      \_ /usr/bin/Xorg :0 -br -verbose -audit 0 -novtswitch -auth /var/run/gdm3/auth-for-Debian-gdm-3sqzK2/database -nolisten tcp vt7
root      2207  0.8  0.6 493216 39596 ?        Sl   09:11   0:47 /usr/lib/virtualbox/VirtualBox
root      2169  0.0  0.3 222084 20480 ?        S    09:11   0:00              \_ python /usr/bin/system-config-printer-applet
root      2147  0.0  0.3 440268 20360 ?        S    09:11   0:01              \_ nautilus
root      2134  0.0  0.3 372280 22824 ?        S    09:11   0:02              \_ gnome-panel
root      2345  0.0  0.2 228332 13476 ?        Sl   09:13   0:02 gnome-terminal
root      2162  0.0  0.2 290488 15356 ?        S    09:11   0:00 /usr/lib/gnome-applets/mixer_applet2 --oaf-activate-iid=OAFIID:GNOME_MixerApplet_Factory --oaf-ior-fd=18
root@Vbox1:~#

as you see first 3 process consume most memory and cpu.

now i need to keep  on eye those process also if any new process starts to use more cpu and ram ..  ( and graph is + point)

with a perl script + mysql i will be able to do what i want ..

but i wanted to see if there is any tools or linxu command which i dont know might be help to complete my task .



if you want to report you can try mrtg but if you want monitor memory usage... cpu usage.. you can try monit its simple to use and can run tasks when it reaches certain parameters
@simoesp

i am not saying... totall memory or cpu uses..  

i am after system wide cpu and memory uses per p rocess..

@simoesp

could you be more specifiq please..

I use nagios  and cacti ..  how ever
could you please provide me the document of monit where it saying it allow to monitor per process of a system ??
you can also try munin

it does the mrtg for the process etc..

http://munin-monitoring.org/
@simoesp

"Monit can examine how much system resources a service is using. This test can only be used within a system or process service entry in the Monit control file."

can it be any resouces ??

example :
root      2256 14.5  6.9 877704 428720 ?       Sl   09:12  13:51  \_ /usr/lib/virtualbox/VirtualBox --comment xxxx --startvm e30d01f7-3f4c-495a-a873-026979b67c1a --no-startvm-errormsgbox
root      2354 10.5  5.5 789692 341192 ?       Sl   09:13   9:50  \_ /usr/lib/virtualbox/VirtualBox --comment xxxx --startvm 7bf80cef-c6b7-4370-865b-46beeb638d5d --no-startvm-errormsgbox
root      2283 10.5  3.0 646912 187692 ?       Sl   09:12  10:01  \_ /usr/lib/virtualbox/VirtualBox --comment xxx --startvm 72e2e333-a114-482c-aa33-9b23e7c469ff --no-startvm-errormsgbox

those 3 resource are not any default linux resource  like (mysqld,apache2 or smpd)..

so how some one will mention those services  in monit control panel >??


ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks  for providing that , although I am trying to build some thing for universal sytem..
but that script will do my job for time being ..

i will have to do some workway round ..

may be will have to ask few perl question to get my answer ..



good luck on perl :)

For nagios, you could use the plugin "check_mk" as an agent-based solution.

You could then define in the nagios server (check_mk config) for what processes you need full performance data (processor and memory usage, and also count of running processes)

so you could specify mysql, VirtualBox, ... as processes to monitor.

check_mk is compatible with the graphing solution pnp4nagios, so you could store the performance data as RRD