Hi everybody,
I want to write a script that checks memory usage of my RHEL box, and ran
as a cron job say every 10 minutes.
I could write the Perl script to run a system command like "ps aux", parse
that information and kill a job if >90% of the total system memory (and I
realise most of
Dave Tang wrote:
> Hi everybody,
>
> I want to write a script that checks memory usage of my RHEL box, and
> ran as a cron job say every 10 minutes.
>
> I could write the Perl script to run a system command like "ps aux",
> parse that information and kill a job if >90% of the total system memory
On Mon, 08 Feb 2010 22:52:37 +1000, Shawn H Corey
wrote:
Dave Tang wrote:
Hi everybody,
I want to write a script that checks memory usage of my RHEL box, and
ran as a cron job say every 10 minutes.
I could write the Perl script to run a system command like "ps aux",
parse that information
Dave Tang wrote:
> Very recently a user wrote a script that crashed the server, by using
> all the memory. So also I wanted to capture the process information too.
> Is this information available in the /proc directory?
Yes, google "linux proc".
--
Just my 0.0002 million dollars worth,
Sh
On Sun, 7 Feb 2010, Patrick Dupre wrote:
Hello,
I have been unsuccessful in getting the piddle values when I store them
in a hash so, I am asking to the list.
This works OK:
test_pdl (array)
pdl *array
CODE:
PDL -> converttype (&array, PDL_D, 1) ;
Sorry, I finally I know how to do it.
Hi Dave
Have you ever tried module Proc-ProcessTable? It is a wonderful tool
to collect process information such as PID, cmdline, CPU usage and Mem
usage.
> Hi everybody,
>
> I want to write a script that checks memory usage of my RHEL box, and ran as
> a cron job say every 10 minutes.
>
> I coul
On Feb 3, 2:26 pm, jwkr...@shaw.ca ("John W. Krahn") wrote:
> PolyPusher wrote:
> > Hi All,
>
> Hello,
>
> > I have some Perl experience but has been awhile. I mainly write
> > SKILL lisp programs for Cadence CAD for a layout group(we are a IC
> > design center).
>
> > I have a CBR(describes circ
I'm trying to figure out a way to compare a couple values to see if they are
sequential or not.
I'm running a for loop and grabbing a value and setting a variable through each
iteration. At the end I would like to examine the results and see if they are
sequential or not.
If the values are l
> "CS" == Curt Shaffer writes:
CS> I'm trying to figure out a way to compare a couple values to see
CS> if they are sequential or not. I'm running a for loop and
CS> grabbing a value and setting a variable through each iteration. At
CS> the end I would like to examine the results and
OK. So I have tried some things. I guess the largest issue that I can't find an
answer for elsewhere is how to evaluate variables to be >, = or <100 in one
evaluation.
Before I get there, obviously I need to get the variables.
Here is what I am trying to do for that:
@hping_array = ();
$hcount
On 2/8/10 Mon Feb 8, 2010 3:55 PM, "Curt Shaffer"
scribbled:
> OK. So I have tried some things. I guess the largest issue that I can't find
> an answer for elsewhere is how to evaluate variables to be >, = or <100 in one
> evaluation.
>
> Before I get there, obviously I need to get the variabl
> "CS" == Curt Shaffer writes:
CS> OK. So I have tried some things. I guess the largest issue that I
CS> can't find an answer for elsewhere is how to evaluate variables to
CS> be >, = or <100 in one evaluation. Before I get there, obviously
CS> I need to get the variables.
CS> @hp
What is the proper syntax for a comparison at the end of a subroutine to
stop the script if a certain variable is "0" or ''?
sub routine{
(get data and process it)
if $varA = '' || $varA = "0" {
(stop script, print error message to user)
}
else{
(continue with script)
}
--
To unsubscribe, e-mai
On 2/8/10 Mon Feb 8, 2010 4:56 PM, "Chris Coggins"
scribbled:
> What is the proper syntax for a comparison at the end of a subroutine to
> stop the script if a certain variable is "0" or ''?
>
> sub routine{
> (get data and process it)
> if $varA = '' || $varA = "0" {
> (stop script, print err
On 2/8/10, Chris Coggins wrote:
> What is the proper syntax for a comparison at the end of a subroutine to
> stop the script if a certain variable is "0" or ''?
>
> sub routine{
> (get data and process it)
> if $varA = '' || $varA = "0" {
> (stop script, print error message to user)
> }
> else{
>
Thanks Jim. I see my error now. I didn't realize you could just backtick in a
for like that.
On Feb 8, 2010, at 7:06 PM, Jim Gibson wrote:
> On 2/8/10 Mon Feb 8, 2010 3:55 PM, "Curt Shaffer"
> scribbled:
>
>> OK. So I have tried some things. I guess the largest issue that I can't find
>> an
Thanks for the clue. I have narrowed some things down. The counter is much
nicer. I just need to get a better split I think as I'm not getting the
grouping I would like.
On Feb 8, 2010, at 7:19 PM, Uri Guttman wrote:
>> "CS" == Curt Shaffer writes:
>
> CS> OK. So I have tried some things
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
> On 2/8/10, Chris Coggins wrote:
>> What is the proper syntax for a comparison at the end of a subroutine to
>> stop the script if a certain variable is "0" or ''?
>>
>> sub routine{
>> (get data and process it)
>> if $varA = '' || $varA = "0" {
>> (sto
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
> On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
>> On 2/8/10, Chris Coggins wrote:
>>> What is the proper syntax for a comparison at the end of a subroutine to
>>> stop the script if a certain variable is "0" or ''?
>>>
>>> sub routine{
>>> (get data and p
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> if (defined $var && ($var eq '' || $var eq '0')) {
7> #code
7> }
7> to handle cases where $var = undef. undef acts like it is a blank
7> string when used as a string.
blah..
unless( $var ) {
is all you need for that si
Thanks Jim. I used
exit(0) unless $varA;
and it worked good from command line. When I try the script through a
browser pointing to the file like so
http://domain.com/cgi-bin/script.pl?varA=10
the script executes as it should.
But when I try to send 0 as the value (?varA=0), I get a code 500
On 2/8/10 Mon Feb 8, 2010 5:45 PM, "Chris Coggins"
scribbled:
> Thanks Jim. I used
>
> exit(0) unless $varA;
>
> and it worked good from command line. When I try the script through a
> browser pointing to the file like so
> http://domain.com/cgi-bin/script.pl?varA=10
> the script executes
Chris Coggins wrote:
I'm adding this exit step into the script to keep people from trying
to execute it outside of the normal web interface. The script and
browser communicate normally if the script is executed through its
original form. What I'm trying to prevent is someone trying to execute
On 2/8/10 Mon Feb 8, 2010 6:07 PM, "Chris Coggins"
scribbled:
>
>
> Chris Coggins wrote:
>> I'm adding this exit step into the script to keep people from trying
>> to execute it outside of the normal web interface. The script and
>> browser communicate normally if the script is executed throu
Jim Gibson wrote:
On 2/8/10 Mon Feb 8, 2010 6:07 PM, "Chris Coggins"
scribbled:
Chris Coggins wrote:
I'm adding this exit step into the script to keep people from trying
to execute it outside of the normal web interface. The script and
browser communicate normally if the script is
Ok. So again, thanks for getting me on the right track. I am now at my compare
routine. This is where I cannot figure out how to compare within 100. My first
instinct is to write something like the following:
#!/usr/bin/perl -w
for (1 .. 5){
my $hping = `sudo hping3 www.microsoft.com -S
Hi Dave,
There is a tool sysusage which is a open source coded in perl. It
might be worth to have a look.
2010/2/8 Dave Tang :
> Hi everybody,
>
> I want to write a script that checks memory usage of my RHEL box, and ran as
> a cron job say every 10 minutes.
>
> I could write the Perl script to r
At 9:17 PM -0500 2/8/10, Curt Shaffer wrote:
Ok. So again, thanks for getting me on the right track. I am now at
my compare routine. This is where I cannot figure out how to compare
within 100.
My first instinct is to write something like the following:
#!/usr/bin/perl -w
for (1 .. 5){
I a
On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
> > "7" == 7 <7stud.7s...@gmail.com> writes:
>
> 7> if (defined $var && ($var eq '' || $var eq '0')) {
>
> 7> #code
>
> 7> }
>
> 7> to handle cases where $var = undef. undef acts like it is a blank
> 7> string when used as a string
On Mon, Feb 8, 2010 at 9:00 PM, 7 <7stud.7s...@gmail.com> wrote:
> On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
>
>> > "7" == 7 <7stud.7s...@gmail.com> writes:
>>
>> 7> if (defined $var && ($var eq '' || $var eq '0')) {
>>
>> 7> #code
>>
>> 7> }
>>
>> 7> to handle cases where $
On Mon, Feb 8, 2010 at 6:45 PM, Chris Coggins wrote:
> Thanks Jim. I used
>
> exit(0) unless $varA;
>
That form of unless is especially poor style.
> "CS" == Curt Shaffer writes:
CS> #!/usr/bin/perl -w
still no warnings and strict. USE THEM.
do it now. add them and declare all your variables. it will save your
ass.
CS> for (1 .. 5){
CS> my $hping = `sudo hping3 www.microsoft.com -S -p 80 -c 1`;
CS> push @hpin
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
>> "7" == 7 <7stud.7s...@gmail.com> writes:
7> 7> if (defined $var && ($var eq '' || $var eq '0')) {
7> 7> #code
7> 7> }
7> 7> to handle c
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> Because unless and until statements are harder to maintain, NO ONE
should
7> use them--least of all beginners.
7> Because unless and until statements are harder to *read and maintain*, NO
ONE
7> should use them--least of all be
On Mon, Feb 8, 2010 at 9:33 PM, Uri Guttman wrote:
> > "7" == 7 <7stud.7s...@gmail.com> writes:
>
they both read fine in english which is why they we included by
> larry.
They don't both read fine. To many people, unless is a confusing construct.
Larry has made plenty of mistakes design
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> On Mon, Feb 8, 2010 at 9:33 PM, Uri Guttman wrote:
>> > "7" == 7 <7stud.7s...@gmail.com> writes:
>>
7> they both read fine in english which is why they we included by
>> larry.
7> They don't both read fine. To many people, u
36 matches
Mail list logo