07-03-2008
Quote:
Originally Posted by
ghostdog74
why do you need to do things in separate scripts? do your processing in the while loop itself. Its just a program design problem.
Because:
the actual 'input' script outputs something like
Quote:
timestamp process_name pid memory_usage cpu_usage
13:00:00 proc1 1000 500M 50%
13:00:00 proc2 1001 500M 10%
13:00:00 proc3 1002 256M 13%
13:00:01 proc1 1000 500M 50%
13:00:01 proc2 1001 500M 10%
13:00:01 proc3 1002 256M 13%
13:00:02 proc1 1000 500M 50%
13:00:02 proc2 1001 500M 10%
13:00:02 proc3 1002 256M 13%
which is primarily for logging purposes. The 'output' script was going to attempt to take the processes as they were output, and display running averages. As there are, in reality, many processes this will monitor and you would only need to actively monitor one t a time, I used a simple grep on it, which is when i noticed the issue.
Can I work around it? Sure. I can log to a file and tail that, for example, but I'm more curious as to why this is happening. This is less of a 'I have a problem and need a workaround' and more of a 'this is unexpected behaviour, does anyone have an explanation?' kind of query.
Cheers,
Mitch.
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
While installing a firewall, I was pinging the interface from SCO 5.0.6 Openserver box, while no response, I hit "DEL" to cancel, but no cancel. Then all of a sudden I get BOO-KOO traffic lights on HUB and Switch.... Then a kernel trap error. System froze... Proceeded with a cold boot. Now I have... (8 Replies)
Discussion started by: nashvillek5
8 Replies
2. Shell Programming and Scripting
Howdy folks,
I am fairly new to scripting but have lost of expirience in c++, pascal, and a few other. I am trying to complete a file search script that is sent a file name containing data to search that is arranged like this
"id","name","rating"
"1","bob","7"
etc
and an argument to... (1 Reply)
Discussion started by: dyrt
1 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I need to use a double grep so to speak. I need to grep for a particular item say BOB and then for each successful result I need to grep for another item say SMITH.
I tried grep "BOB" filename | grep "SMITH"
but it does not seem to work.
I can achieve my desired result using an... (12 Replies)
Discussion started by: mojoman
12 Replies
4. Shell Programming and Scripting
$>cat file.txt
123 d3
234 abc 3
zyf 23
124 def 8
ghi kz0
...
...
I have the following output on the screen through <some command>.
$> <some command>
abc
def
ghi
...
...
I have to search for each of these patterns in the file.txt and print the lines in file.txt matching the... (4 Replies)
Discussion started by: VNR
4 Replies
5. Ubuntu
Hi everybody,
I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form).
I am trying to extract some ids from within this file, which have certain parameters.
For example, some Of my IDs have the term 'No hit results'... (1 Reply)
Discussion started by: frymor
1 Replies
6. Ubuntu
Hi everybody,
I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form).
I am trying to extract some ids from within this file, which have certain parameters.
For example, some Of my IDs have the term 'No hit results'... (6 Replies)
Discussion started by: frymor
6 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a number of files containing the information below.
"""""
Fundallinfo
6.3950 14.9715 14.0482
"""""
I would like to grep for Fundallinfo and use it to read the next line? I ideally would like to read the three numbers that follow in the next line and... (2 Replies)
Discussion started by: Paul Moghadam
2 Replies
8. Solaris
Hi guys.
You'd have to excuse me a bit, as I'm a noob. I really try to avoid asking questions and do research for whatever linux issues that may arise.
I am experiencing a long wait for the shell to come up when I ssh or telnet into a Sunos 5.10 environment.
It takes 70 seconds to give me... (12 Replies)
Discussion started by: gpenco
12 Replies
9. OS X (Apple)
cat file
1 aaa
2 bbb
3 ccc
4 ddd
In TextEdit, I then copy the characters “ccc” to the clipboard. The problem is that the following command gives no output:
bash-3.2$ pbpaste | grep - file
Desired output:
3 ccc
What should the syntax be for that command? I am using MacOS El... (3 Replies)
Discussion started by: palex
3 Replies
LEARN ABOUT CENTOS
ocf_heartbeat_delay
OCF_HEARTBEAT_DELAY(7) OCF resource agents OCF_HEARTBEAT_DELAY(7)
NAME
ocf_heartbeat_Delay - Waits for a defined timespan
SYNOPSIS
Delay [start | stop | status | monitor | meta-data | validate-all]
DESCRIPTION
This script is a test resource for introducing delay.
SUPPORTED PARAMETERS
startdelay
How long in seconds to delay on start operation.
(optional, integer, default 30)
stopdelay
How long in seconds to delay on stop operation. Defaults to "startdelay" if unspecified.
(optional, integer, default 30)
mondelay
How long in seconds to delay on monitor operation. Defaults to "startdelay" if unspecified.
(optional, integer, default 30)
SUPPORTED ACTIONS
This resource agent supports the following actions (operations):
start
Starts the resource. Suggested minimum timeout: 30.
stop
Stops the resource. Suggested minimum timeout: 30.
status
Performs a status check. Suggested minimum timeout: 30. Suggested interval: 10.
monitor
Performs a detailed status check. Suggested minimum timeout: 30. Suggested interval: 10.
meta-data
Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5.
validate-all
Performs a validation of the resource configuration. Suggested minimum timeout: 5.
EXAMPLE
The following is an example configuration for a Delay resource using the crm(8) shell:
primitive p_Delay ocf:heartbeat:Delay
op monitor depth="0" timeout="30" interval="10"
SEE ALSO
http://www.linux-ha.org/wiki/Delay_(resource_agent)
AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors)
resource-agents UNKNOWN 06/09/2014 OCF_HEARTBEAT_DELAY(7)