- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- CPU MONITORING SCRIPT
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО04-13-2007 12:41 AM
тАО04-13-2007 12:41 AM
CPU MONITORING SCRIPT
I need a script that can monitor the cpu utilization. If the cpu usage reached 90% it will send an sms alert. Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2007 12:52 AM
тАО04-13-2007 12:52 AM
Re: CPU MONITORING SCRIPT
if you have glance, please see:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=690675
otherwise,for example:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1057532
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1022986
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2007 12:58 AM
тАО04-13-2007 12:58 AM
Re: CPU MONITORING SCRIPT
This problem is solved many times over, please (google) look aroudn for prior solutions, see how close they are to what you need and adpat if needed.
You may find that prior solutions also though the whole problem through for a little longer and refined that rules. For example... you just indicate "If the cpu usage reached 90%". I ask... for how long?
shoudl any spike trigger this? Any everage over n minutes?
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2007 01:02 AM
тАО04-13-2007 01:02 AM
Re: CPU MONITORING SCRIPT
Have a look at SEP's script at:
http://www.hpux.ws/system.perf.sh
also, why are you worry about your CPU usage reaching 90?
When the CPU usage reaches 99% or even 100%, this is a good sign that your system is working well and it only when this situation persist over a long period that you should be "worried"
look into measureware also.
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2007 01:06 AM
тАО04-13-2007 01:06 AM
Re: CPU MONITORING SCRIPT
Here is the script that I create, but it doesn't seems rite. It keep on sending email eventhough the cpu idle is 95%.
sar -u 1 1 |awk '{print $5}' | if [ "$5" -le 95 ]; then
echo "High CPU Utilization" | mailx -s 'cpu reach 85% PLS CALL ADMIN' admin@admin.com
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2007 01:22 AM
тАО04-13-2007 01:22 AM
Re: CPU MONITORING SCRIPT
#!/usr/bin/sh
PCT=$(sar -u 1 1 | tail -1 | awk '{print $5}')
if (( ${PCT} <= 10 )) ; then
echo "CPU Usage is currently at ${PCT}. Please call an admin" | mailx -s "CPU Usage at ${PCT}" me@my.com
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2007 01:27 AM
тАО04-13-2007 01:27 AM
Re: CPU MONITORING SCRIPT
Isn't field 5 "%idle" ?
So, you want to get mail if the CPU is Less or equal to 95% idle ?!
Can you show field 5 in your debug ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2007 01:40 AM
тАО04-13-2007 01:40 AM