onstat -d chunks perl monitor


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting onstat -d chunks perl monitor
# 1  
Old 07-25-2012
onstat -d chunks perl monitor

I have a file I need to monitor with a perl script with the following format. I need to send off a 0 if it is above 95 in the 5th colum and a 1 if it is below. Any help on a simple perl script would be great.
Code:
75424958       999975         983170         /dev/rmetrochunk00 98.32
760c2dd8       512000         511947         /dev/rmetrochunk01 99.99
760c3018       512000         511947         /dev/rmetrochunk02 99.99
760c31f0       512000         511947         /dev/rmetrochunk03 99.99
760c33c8       1024000        969376         /dev/rmetrochunk04 94.67
760c35a0       1024000        867971         /dev/rmetrochunk05 84.76


Last edited by jim mcnamara; 07-26-2012 at 11:17 AM..
# 2  
Old 07-25-2012
somthing like this?

Code:
$a="75424958 999975 983170 /dev/rmetrochunk00 98.32";
@ar = split(' ',$a);

if ($ar[4]>95)
{
print "0 ";
}
else
{
print "1";
}

# 3  
Old 07-26-2012
My example is of the contents of the file so no this won't work.....

Here is a better example.
Code:
bash-3.00$ more onstat.log | awk '{print($5,$4)}'
98.32 /dev/rmetrochunk00
99.99 /dev/rmetrochunk01
99.99 /dev/rmetrochunk02
99.99 /dev/rmetrochunk03
94.67 /dev/rmetrochunk04
84.76 /dev/rmetrochunk05
100.00 /dev/rmetrochunk06
99.99 /dev/rmetrochunk100
99.22 /dev/rmetrochunk101
90.93 /dev/rscout_dbs

Moderator's Comments:
Mod Comment please use [code] ... [/code] tags to enclose data or code fragments

Quote:
Originally Posted by abblandior
Code:
$a="75424958 999975 983170 /dev/rmetrochunk00 98.32";
@ar = split(' ',$a);

if ($ar[4]>95)
{
print "0 ";
}
else
{
print "1";
}


Last edited by jim mcnamara; 07-26-2012 at 11:16 AM..
# 4  
Old 07-26-2012
Oh sorry , then i missunderstud . I thought you need perl example.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modification of perl script to split a large file into chunks of 5000 chracters

I have a perl script which splits a large file into chunks.The script is given below use strict; use warnings; open (FH, "<monolingual.txt") or die "Could not open source file. $!"; my $i = 0; while (1) { my $chunk; print "process part $i\n"; open(OUT, ">part$i.log") or die "Could... (4 Replies)
Discussion started by: gimley
4 Replies

2. Shell Programming and Scripting

Move files from one directory to another in chunks

All, I have an application that is not working properly and the company is 'in the process' of fixing it. In the meantime, I want to write a bash script work-around. However, what I thought was going to be simple is seemingly not. Need: - Move files from one directory to another in... (3 Replies)
Discussion started by: hburnswell
3 Replies

3. Infrastructure Monitoring

Searching for Saas Monitor service which monitor my servers which are sitting in different providers

Sorry if this is the wrong forum Searching for Saas Monitor service which monitor my servers which are sitting in different providers . This monitor tool will take as less CPU as possible , and will send info about the server to main Dashboard. The info I need is CPU / RAM / my servers status (... (1 Reply)
Discussion started by: umen
1 Replies

4. Shell Programming and Scripting

Chunks of bash shell programming

I am going to provide a chunks of codes that I do not understand. Please help with them in a layman's terms. 1) ${DEBUG:-0} -------------------------------------------------------------------------- 2) print "${1}" ... (7 Replies)
Discussion started by: lg123
7 Replies

5. Red Hat

Free() corrupted unsorted chunks

We are migrating Pro*C code from SOLARIS to LINUX-Redhat. While migrating we face memory de-allocation issue intermittently when accessing large volume of data. Below is the part of the code(since code is big I am putting the part of the code where the issue comes): ... (8 Replies)
Discussion started by: Karunx
8 Replies

6. Shell Programming and Scripting

Splitting a file into chunks of 1TB

Hi I have a file with different filesystems with there sizes. I need to split them in chucks of 1TB. The file looks like vf_MTLHQNASF07_Wkgp2 187428400 10601AW1 vf_MTLHQNASF07_Wkgp2 479504596 10604AW1 vf_MTLHQNASF07_Wkgp2 19940 10605AID vf_MTLHQNASF07_Wkgp2 1242622044... (4 Replies)
Discussion started by: bombcan
4 Replies

7. Shell Programming and Scripting

Combining chunks of data

Hi there! Need help on some issue, I have data like this: 123 456 789 012 i need it to be like this: 123789 456012 Anyone has any idea how to do this? Thanks! Regards, Ken How to use code tags (8 Replies)
Discussion started by: kennethtls
8 Replies

8. Shell Programming and Scripting

perl script to monitor 2 processes

I have two processes that I need to keep running. The first process is a server, the second is basically a canvas for creating images which get saved to a directory. So I plan on using launchd (Mac OS 10.5) on a server to check every minute or so to make sure two things are true: 1) Both apps... (3 Replies)
Discussion started by: Solerous
3 Replies

9. Shell Programming and Scripting

remove chunks of text from file

All, So, I have an ldif file that contains about 6500 users worth of data. Some users have a block of text I'd like to remove, while some don't. Example (block of text in question is the block starting with "authAuthority: ;Kerberosv5"): User with text block: # username, users,... (7 Replies)
Discussion started by: staze
7 Replies
Login or Register to Ask a Question