KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

JRUN CPU test Constant bad when CPU usage is Good :(

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
Executionher



Joined: 21 May 2010
Posts: 4

PostPosted: Wed Mar 30, 2011 2:50 am    Post subject: JRUN CPU test Constant bad when CPU usage is Good :( Reply with quote

Hi We have a shell script testing the CPU of our UBUNTU server: Process:%CPU usage (avarage)

#!/bin/sh

if [ $# -ge 2 ]
then
OS=`uname`
case $OS in
AIX) PSLIST='ps -Ao comm,pcpu';;
Linux) PSLIST='ps h -eo ucmd,pcpu';;
FreeBSD) PSLIST='ps -axco command,%cpu';;
NetBSD) PSLIST='ps -axco command,%cpu';;
OpenBSD) PSLIST='ps -axco command,%cpu';;
SunOS) PSLIST='ps -eo fname,pcpu';;
*) echo 'ScriptRes:Unknown:script is not designed for '$OS
exit;;
esac
$PSLIST | awk 'BEGIN { maxusage=0 } $1=="'$1'" {if ($2>maxusage) {maxusage=$2}} \
END { if (maxusage<='$2') {printf("ScriptRes:Ok:%d %%\n",maxusage)} else {printf("ScriptRes:Bad:%d %%\n",maxusage)} }'
else
echo "ScriptRes:Unknown:not enough parameters specified"
fi[/b]

This script was working correctly and for some or other reason it just became bad and is constantly bad It sucks

When I test it I get these results:

[10:50:03 AM] Script executed, correct result received:
----------
- Status: Unknown
- Reply: not enough parameters specified
----------

Any help here guys??

Regards CBW
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Wed Mar 30, 2011 6:19 am    Post subject: JRUN CPU test Constant bad when CPU usage is Good :( Reply with quote

This Script does not test CPU of your UBUNTU server.
It checks CPU usage of specific process.

Looks like you have not specified required parameters for the script.
This script requires two parameters: <Process Name> <MaxLimit>
E.g parameters may look like: Xorg 10
These parameters should be specified in Params field of Test properties dialog

Please check the manual or visit our web site for more information about Shell Script test parameters:
http://www.ks-soft.net/hostmon.eng/mframe.htm#tests.htm#chkShell
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index