Programming :: Get System Info Like Up Time - No Of Process ?

May 26, 2010

I want to get system info like up time, no of process etc. for up time i got the got from net but it is giving me error. i.e.

error:

Following is the code i m using

Code:

Whats wrong with the code?

View 2 Replies


ADVERTISEMENT

General :: Get The Values For The User Time And System Time For A Process?

Aug 4, 2009

get the values for the user time and system time for a process.i have tried getrusage to get values of ru_utime and ru_stimebut these don't seem to be correct

View 3 Replies View Related

Programming :: Get The Creation Time Of A Process Via Pid In C++

Mar 22, 2010

Scenario: ( in C++ code)

I need a process A to be able to get the start time of process B. I have the PID of the process B.

I would have thought there would be a simple system call to make by passing in the pid of Process B, but I don't thing there is??!!

So my other thought is to create a script that will be passed the pid and either I can read the file creation of /proc/<PID>/stat or I could also parse the start time of ps on the <PID>. This script can be ran from the C++ code. My difficulty is capturing this information in the C++ code. If I run exec ( or system if not a script) I need the results in a program variable....not stdout.

My only solution is write it to a tmp file and read it back into the program variable. Seems rather arguious but a least it would work.

Background - I need to port Windows code ( GetProcessTimes(creationtime,...))

View 4 Replies View Related

Programming :: Retrieve All Process That Use Over 10% CPU Time?

Apr 23, 2010

Writing a bash shell script that list all process that use over 10% CPU time?

View 1 Replies View Related

Programming :: Checking Os And Process State At Run Time?

May 11, 2010

How can i check what operating system, i am running on, at run time?Moreover, how can i retrieve that current state of process?

View 4 Replies View Related

Programming :: Extracting Auditing Info Using Awk System And Ausearch?

Aug 25, 2010

I'm a linux newbie and scripting novice and I'm trying to pull auditing info and dump it into a file. I made some login changes so it would get audited but I don't want to have to sift through the log to see who the user was and what was done. This is what I have below here and I can't seem to get it to extract the info want using the event id. The "ausearch -a $10" from the script should get it from the 10th column but it's not working.If I can get this to work I would like to add additional aureport options.

#!/bin/bash
yyyy=`date "+%Y"`
mm=`date "+%m"`

[code]...

View 6 Replies View Related

Programming :: Kill More Than One Process In System?

Apr 27, 2010

I wanted to know how to kill more than one process in unix??
e.g- I have problem statement as
"Write a shell script to Kill all processes started from your login "

View 11 Replies View Related

Programming :: Process Of Creating System Call?

Mar 24, 2011

how to create a new system call Linux? what is the process of creating ?my project is to create a system call for displaying owner of a file..where exactly we have to write the system call code? and where are the places need to change ?

View 5 Replies View Related

Server :: Mpstat Output Interpret And Process Info?

May 19, 2011

I've got a system that is maxing out CPU. Running "mpstat -P ALL 3 5" shows the following.

Quote:

08:30:21 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
08:30:24 PM all 100.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1001.00
08:30:24 PM 0 100.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1001.00

[code]....

All 5 groups show the same. My first question is why would CPU0 be the only one with intr/s and the others do not? Info.The OS is RHEL 5.4 running as a VM on ESXi 4.1. Memory doesn't appear to be an issue, the system has 8 GB and its only using about 1.5 GB. Second question, I'm positive the process that is the problem is the tomcat process. Does anyone know a good way to see whats happening with a specific process?

View 6 Replies View Related

Programming :: Calling System Calls In C Runtime (in The Run-time)?

Sep 23, 2010

I know there is a way to call winapi in runtime in windows. I want to ask how can I call a system call in gcc in runtime (when I don't know what it can be)? I don't mean syscall that I think is for calling only system calls and not library functions.

View 4 Replies View Related

Programming :: Print The Current Time Of My System With A Batch File ?

Dec 25, 2010

How can I print the current time of my system with a batch file. My os is ubuntu.

View 4 Replies View Related

OpenSUSE Install :: Can`t Install Suse 11.3 - Every Time System Shut Down In Install Process

Jan 30, 2011

I tried to install suse 11.3 but every time the system shut down in the install process it never finish

I think that the FAN does not work

I have an Acer Aspire 5720z

View 3 Replies View Related

Fedora :: Each Time Yum Updates Repo Info

Mar 13, 2010

Each time i type yum search <something> .. some 2 to 3 mb are dloaded.. is that updates of the repos configured? how do i stop it updating each time ?

View 3 Replies View Related

General :: Review The Boot-time Info That's Going To The Console?

Feb 18, 2011

I'd really like to be able to examine all the information that flys off the top of my terminal when my system boots (off of fd0, the only way I've done it, so far): review of "similar threads" yields nothing; seemingly not a man pages item; have not found any how-to's that cover this; the daemons for logging are third-to-the-last before logon prompt (and still displayed, the ONLY reason I know THAT); seems like it should be a compile-time sw-switch settng (sub-optimal since I'm still not comfortable with compiling kernels); but I was hoping it's already being captured in some log file somewhere that I'm as yet unaware exists. I do realize that if I had a printing console, this would be unnecessary.

View 2 Replies View Related

General :: Real Time Info About Disk Activity?

Feb 18, 2011

kernel 2.6.21.5, Slackware 12.0 How can I obtain real time information about disk activity (processes transfering data to/from the hard disk)?

View 3 Replies View Related

Programming :: Displaying Process Id In Shell Script But There Is No Such Process?

Nov 9, 2010

I have a shell script to identify whether the process is running or not. If the process is not running, then I execute another script file to run my application. Below is my script and saved this script as monitorprocess.sh Code: #!/bin/bash

result=$(ps -ef | grep -v grep | grep "applicationname.sh" | awk '{print $2}')
echo $result
if [ "$result" == "" ];

[code]...

View 4 Replies View Related

Programming :: Difference Between Init.rc Process And Normal Process?

Mar 31, 2011

Is there any difference in cpu usage for process in init.rc(runs automatic when boot is happened) and manually running process. Will these both have same priority by default...?

View 1 Replies View Related

Programming ::get The PID Of The Process Giving Kill Signal To A Process?

Nov 26, 2008

I tried googling but didn't get any answer for this.I have a process called "abc" and it is running with PID "123".I have a putty session opened with PID "999".I am giving kill -TERM 123 from putty session.My process "abc" before dying it should catch the PID of the terminal which provided TERM signal to it.Is there any way to find this out

View 2 Replies View Related

Ubuntu :: How To Get System Info

Jan 6, 2011

how do i get system info on desktop

View 1 Replies View Related

Fedora :: 11 Boot Time / System Hangs For A Very Long Time On Starting Udev?

Sep 25, 2009

When booting Fedora 11, my system hangs for a very long time on starting udev. Sometimes I get an I/O error. However, my hardware is fine. I do eventually get in to the system.

View 7 Replies View Related

Fedora Installation :: Set The Time In The System Tray To The Standard AM/PM Setting Instead Of Military Time?

Jan 29, 2010

Just making one last tweak with my fresh install of F12KDE. I need to . How do I do this

View 2 Replies View Related

Ubuntu Servers :: System Time Runs Slow Hareware Time Run Right?

Apr 11, 2011

I am running my Ubuntu 32 bit server on top of Windows 7 64 bit with VirualBox. It's a 2 core Atom. It's been working good for about half a year. But the last about 6 weeks the system time only in Ubuntu is going slow. About -8 per 24 hours! I can only guess because I have more things running in my Windows 7 and Ubuntu.

I can set it right by coping the hareware time to system time with this command:

Code:
hwclock --hctosys

I want to run a crontab to have that command run every minute. But it don't seem to run.

[Code]...

View 9 Replies View Related

General :: Short A Time Can Time (system Program) Measure?

Apr 15, 2010

I'm just wondering what the limits for time are. I have a program that always takes exactly 20 ms, so I assume this is the lowest it can measure, but I want to see if there's some sort of documentation of this.

View 3 Replies View Related

Software :: How To Get Info About System Libraries

Feb 23, 2011

I installed ARB in my pc...while running arb below error is occur...
- arb_ntree: error while loading shared libraries: libXm.so.4: cannot open shared object file: No such file or directory
ARB done

This type error also occur while running phylip programs
- drawtree: error while loading shared libraries: libXm.so.4: cannot open shared object file: No such file or directory

I dont know that my system contains this library or not...how I find that? My system is Fedora....

View 4 Replies View Related

Programming :: Showing Process Id But There Is No Such Process?

Nov 9, 2010

I have a shell script to identify whether the process is running or not. If the process is not running, then I execute another script file to run my application. Below is my script and saved this script as monitorprocess.sh

Code:
#!/bin/bash
result=$(ps -ef | grep -v grep | grep "applicationname.sh" | awk '{print $2}')

[code]...

View 14 Replies View Related

Programming :: Function Handler Is Called One Time Only Instead 2 Times If The 2 Timers Expires At A Time

Mar 2, 2011

I am using Debian linux. I have 100 timers running. If a timer expired which will generate a signal and it was mapped to a same function handler. All the timers are mapped to one function handler. The problem is if the timer expires one at a time, the function handler called at a time. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times. Is it possible to invoke the function handler as many times based on timer expirary happens simultaneoulsy?

View 14 Replies View Related

Ubuntu Servers :: System Info On Ssh Login - One Does, One Does Not?

Dec 27, 2010

I have two 10.04.1LTS command line servers running different overall jobs. One is an upgrade that started as 9.10 and was upgraded to 10.04LTS when it came out. It has since been upgraded to a 10.04.1LTS server. It's ssh login displays the following:

Code:
bob@b-desktp:~$ ssh admin@192.168.0.153
admin@192.168.0.153's password:
Linux server.nnbob.net 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux
Ubuntu 10.04.1 LTS
code....

No mail.Last login: Mon Dec 27 17:00:10 2010 from b-desktp.nnbob.net.Notice the nice system information presented there. How do I get the other (upgraded) server to do that too?

View 6 Replies View Related

General :: CentOS 5 - Two Yum Process At Same Time?

Jul 14, 2011

I started to use linux (CentOS 5) 1 week ago. And I took lot of imformation from this forum. Is it possible to install two program at same time?
Total download size: 67 M
Is this ok [y/N]: y
Downloading Packages:
jdk-6u24-linux-i586.rpm 19% [========-] 6.0 kB/s | 13 MB 153:51 ETA
It is so boring to wait and I have to wait there is nothing to do something else just centOs text.

View 8 Replies View Related

Programming :: Get The Current Time As Provided From NTP (not The Currently Set Time On The Server)?

Jun 9, 2010

Is there a way to get the current time as provided from NTP (not the currently set time on the server)?

View 4 Replies View Related

Programming :: Set Time Using Settimeofday But It Sets Local Time?

Jan 12, 2010

I am trying to set time using settimeofday in linux. But it sets local time. i.e works like SetLocalTime in windows. But I want to set system time(like SetSystemTime in windows). I could'nt find no other api in linux. What should i do? I had tried with mktime/gmtime apis

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved