- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- How do i get current cpu and memory utilization in...
Operating System - Linux
1820475
Members
3347
Online
109624
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 03:45 PM
тАО11-17-2005 03:45 PM
How do i get current cpu and memory utilization in linux using the c programming
I am writting the snmp agent for one device fo r that i need to send the traps when cpu and memory utilization execded the set thresholds for this i want know how do i get the current cpu and memory utilization using the c programs. If you have any progrmas please forward to me.
Thanks in advance
Thanks and Regards
Nataraju K R
Thanks in advance
Thanks and Regards
Nataraju K R
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 06:30 PM
тАО11-17-2005 06:30 PM
Re: How do i get current cpu and memory utilization in linux using the c programming
You can call external commands to get utilization info (say vmstat) from your program, get the output in and parse it.
If you need an snmp agent to monitor cpu and mem util just use net-snmp. Once installed you can set your thresholds in snmpd.conf.
-Ross
If you need an snmp agent to monitor cpu and mem util just use net-snmp. Once installed you can set your thresholds in snmpd.conf.
-Ross
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2005 04:31 AM
тАО11-18-2005 04:31 AM
Re: How do i get current cpu and memory utilization in linux using the c programming
Check the code for uptime, and free.
Both are minimal programs accessing the
appropriate data from the kernel.
Both are minimal programs accessing the
appropriate data from the kernel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2005 05:33 AM
тАО11-20-2005 05:33 AM
Re: How do i get current cpu and memory utilization in linux using the c programming
I am sure there are dozens of agents written that already do what you are going to invent, and a lot more, and a lot more secure.
Maybe look at places like: http://net-snmp.sourceforge.net/
Still, of you want to only partially reinvent this wheel, check out sources for sar/top/vmstat.
For example:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/procps/procps/vmstat.c?rev=1.30
fwiw,
Hein.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP