473,408 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Monitoring CPU Usage in Linux (Need to integrate it with C#)

18
Hello,

I have a driver program in C# which uses performance counters for windows to get perf stats (CPU Usage) for windows.

But for linux there is no known method in C# or .NET using which you can monitor CPU Usage of remote or local unix system.

I wanted to know that is there any way to achieve this in linux and get performance data in C#. (May be a web service running on Linux and C# program calling web service)?

Can anybody give me any pointer regarding this problem?
Jun 16 '10 #1
4 6253
vinot85
53
First of all, You need to prepare a web service in the Linux machine Language of choice can be Java.

From the java webservice, you could read the CPU performance parameters by using System class. Or, write a C program to measure the CPU parameters and call the same through JNDI.

Finally, deploy the webservice and access it from you C# application on windows machine.
Jul 29 '10 #2
iohos
45
Have you tried using the Top program for viewing the CPU utilization? The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel.
The top command monitors CPU utilization, process statistics, and memory utilization. The top section contains information related to overall system status - uptime, load average, process counts, CPU status, and utilization statistics for both memory and swap space.
Jul 29 '10 #3
Jyoti Ballabh
115 100+
If you have a package called sysstat installed in your system then you could take advantage of -

# apt-gel install sysstat

replace it with the up2date command if you are using the Red Hat Linux version or the RHEL

# up2date sysstat

Then there is the mpstat command which displays activities for each available processor, processor 0 being the first one. Global average activities among all processors are also reported. The mpstat command can be used both on SMP and UP machines, but in the latter, only global average activities will be printed.
Jul 29 '10 #4
ashitpro
542 Expert 512MB
You can implement webservice.

Or

try using telnet from C# application to remote linux box, and execute any of the command suggested by other users.

Then gather the out put and parse it according to your need.
Aug 5 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: MegaZone | last post by:
I'm having some issues with PHP DOMXML - in particular the get_elements_by_tagname method. Now, the PGP docs on this are, well, sparse, so maybe I'm just doing something stupid. I thought this...
5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
0
by: DB2 newsgroup user | last post by:
we need help with the following error. The system is a SUSE Enterprise Server: Linux db2serv 2.4.19-64GB-SMP #1 SMP Thu Mar 20 14:41:55 UTC 2003 i686 unknown Installed is DB2 Workgroup Edition...
5
by: Jim | last post by:
Need help with aggregate function...for each unique product, I need the provider with the cheapest cost factor Here't the table (Table1) ID product provider factor 1 123456 abc...
7
by: Ebay boy | last post by:
I have recently bought a compiler and I have this sample code that includes the following: #include <stdlib.h> #include <string.h> #include <time.h> Unfortunately, my compiler doesn't...
0
by: BFM | last post by:
Hello, I'm just beginning a project, and looking through much documentation, and trying to figure out the best platform to develop the core of my project in/on. The project will consist of a...
10
by: Nemok | last post by:
Hi, I am trying to write an additive encryption algorithm in C++ that will encrypt a text by adding a random numer to each character in a string. The code looks similar to this: for(int...
1
by: hmiller | last post by:
Greetings all, Is anybody familiar with the Unify Dataserver ELS Database? I have some old, old Unify database data files that I had pulled from a Unix machine. I have them on a Red Hat Linux...
7
by: maheswaran | last post by:
HI, All i have developed one task tracking application. But i want to integrate with xampp or some other suit for installing apache , php,mysql and also my application in that suit by just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.