01-26-2018
From your description, I am not at all sure that I understand what you are trying to do.
Are you trying to create a file that looks like the file you showed us in post #1 from unspecified input sources? If this is what you want, how are we supposed to guess where this data comes from?
Or, do you have a text file like the file you showed us in post #1 from which you want to extract a list of login names, a list of user IDs, or a list of real names? If this is what you want, which of those three lists do you want? And, what form should that list take? (All values on one line with a comma between values? All values on one line with a tab between them? Each value on a separate line? ...)
If you want a list of real names, you need to give us some way to clearly identify where that name starts and ends in your file. (In you sample data sometimes it is the 5th word, sometimes it is the 5th and 6th word, sometimes it is the complete line with the 1st 4 fields and the last field removed and then removing leading and trailing spaces on what is left, and sometimes it is the complete line with the 1st 4 fields and the last 2 fields removed and then removing the leading and trailing spaces. The starting character position and ending character position vary between lines, so we can't just use character positions.)
Once you have your file or list, what are you going to do with it?
You said you tried RTFM. Which pages in the manual did you try to read? Did you look at cut and tail? Did you look at awk?
Which HPUX release are you using?
Which shell are you using?
8 More Discussions You Might Find Interesting
1. Windows & DOS: Issues & Discussions
Is there an easy way to view all printers on a local
machine via command line or a script?
I'm looking for the equivalent of clicking on
"START, CONTROL PANEL, PRINTERS AND FAXES"
to view the devices.
I then want to cat it to a file where I would use
it later.
Thanks (3 Replies)
Discussion started by: gseyforth
3 Replies
2. HP-UX
Hey, new here, so be nice! I'm trying to write a little script to automate the user creation process on one of our boxes. But I would like to be able to use the templates that we have set up in SAM. Is the information in these templates stored in a file somewhere, that I can reference in my... (5 Replies)
Discussion started by: paqman
5 Replies
3. HP-UX
How can I add a user to a specific group without using SAM? I know I can user modprpw -G, but that will overwrite any groups the user is in with the ones I specify.
I need to assume that I do not know what groups the user is already in, so I can't put them in the modprpw command. I just need... (2 Replies)
Discussion started by: paqman
2 Replies
4. HP-UX
How to reactivate any users (root or non root) by command(no SAM)
HP-UX 11.11 (7 Replies)
Discussion started by: arm_naja
7 Replies
5. HP-UX
Hi I hope this is easy and sorry if I am using the wrong HP terms.
I am looking for a way to glean the command line information from a process I run in SAM?
In AIX I can just select any options I want for particular process and hit F6 and the command line is shown on the screen for use in... (3 Replies)
Discussion started by: KmJohnson
3 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a command line that will display a sorted list of logged in users. Just display the username and no other... (5 Replies)
Discussion started by: kofine05
5 Replies
7. UNIX for Advanced & Expert Users
hi, i have an AIX6.1 machine and i modified a user's profile so that it creates history file for each ip address that connects with this user. the reason i did this is because more than 1 person connects with the same user so i want to keep track of command run by all of them. therefore, in the... (5 Replies)
Discussion started by: omonoiatis9
5 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies
LEARN ABOUT DEBIAN
sam_overview
SAM_OVERVIEW(8) Corosync Cluster Engine Programmer's Manual SAM_OVERVIEW(8)
NAME
sam_overview - Overview of the Simple Availability Manager
OVERVIEW
The SAM library provide a tool to check the health of an application. The main purpose of SAM is to restart a local process when it fails
to respond to a healthcheck request in a configured time interval.
During sam_initialize(3), a duplicate copy of the process is created using the fork(3) system call. This duplicate process copy contains
the logic for executing the SAM server. The SAM server is responsible for requesting healthchecks from the active process, and controlling
the lifecycle of the active process when it fails. If the active process fails to respond to the healthcheck request sent by the SAM
server, it will be sent a user configurable signal (default SIGTERM) to request shutdown of the application. After a configured time
interval, the process will be forcibly killed by being sent a SIGKILL signal. Once the active process terminates, the SAM server will cre-
ate a new active process.
The Simple Availability Manager is meant to be used in conjunction with the cpg service. Used together, it is possible to restart a cpg
process that fails healthchecking during operation.
The main features of SAM include:
o A configurable recovery policy.
o A configurable time interval for health check operations.
o A notification via signal before recovery action is taken.
o A mechanism to indicate to the application the number of times an active process has been created by the SAM server.
o Both application driven health checking and event driven health checking.
Initializing SAM
The SAM library is initialized by sam_initialize(3). sam_initalize(3) may only be called once per process. Calling it more then once has
undefined results and is not recommended or tested.
Setting warning callback
User configurable signal (default SIGTERM) is sent to the application when a recovery action is planned. The application can use the sig-
nal(3) system call to monitor for this signal.
There are no special constraints on what SAM apis may be called in a warning callback. After time_interval expires, a SIGKILL signal is
sent to the active process to force its termination.
Registering the active process
The active process is registered with SAM by calling sam_register(3). This function should only be called one time in a process. After a
recovery action is taken, the new active process will begin execution at the next line of code in a user process after sam_register(3).
Enabling event driven healthchecking
Two types of healthchecking are available to the user. The first model is one where the user application healthchecks during its normal
operation. It is never requested to healtcheck, and if the active process doesn't respond within the time interval, the process will be
restarted.
A more useful mechanism for healthchecking is event driven healthchecking. Because this model is directed by the SAM server, It isn't nec-
essary to guess or add timers to the active process to signal a healthcheck operation is successful. To use event driven healthchecking,
the sam_hc_callback_register(3) function should be executed.
BUGS
SEE ALSO
sam_initialize(3), sam_finalize(3), sam_start(3), sam_stop(3), sam_register(3), sam_warn_signal_set(3), sam_hc_send(3), sam_hc_call-
back_register(3)
corosync Man Page 12/01/2009 SAM_OVERVIEW(8)