09-08-2009
Depending on what version of sar you have, the -x|X switches are pid specific.
For a process monitor, I'd probably want it to run all the time and then periodically grab the ps output to determine if the process is under|over your thresholds. One large loop with a sleep at the end. Every iteration through the loop would take another snapshot of the state of your processes and make comparisons. You could also store the results of the previous few snapshots calculating averages.
Since you're going through all the work, you could make it more generic than just your specific process (winbind) and pass variables or have a configuration file to monitor any process you like for whatever attribute you like. Have a look at chapter 31 in Expert Shell Scripting for more.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
For vertitas netbackup 6.0
I have media server :Solaris
Client server: Windows
I want to restart the netbackup service on the media server .
plz suggest ASAP. (1 Reply)
Discussion started by: saurabh84g
1 Replies
2. Solaris
Can any one please tell me the command for NFS client service restart.This is to resolve, NFS mount slowness issue.Mount is very slow for both read and write operations.The below commands are not helping out in this situation.
---------- Post updated at 08:59 AM ---------- Previous update was... (1 Reply)
Discussion started by: ksvaisakh
1 Replies
3. HP-UX
Hi All,
May i please know if it is possible to write a script to check the log messages and automatically restart a service if it is failed or it is stopped.
Appreciate your suggestions.
Thanks in advance.
regards,
Eajaz (2 Replies)
Discussion started by: ajazshariff
2 Replies
4. Shell Programming and Scripting
Hi All,
Requirement : I need to check for some services in my environment and restart the service if its not running.
I have written script to check the script if its running or not. While if its not running i need to restart it using ./start command. But it will ask for password prompt and i... (4 Replies)
Discussion started by: pradeepbaliga
4 Replies
5. Shell Programming and Scripting
Hello,
Currently i am handling admin activity of wasserver, its parts of teamcenter,
wasserver is used to maintain IDSM service which is involved in data transfer activity. due to some reason IDSM service gets down and have to restart this service manually. ... (0 Replies)
Discussion started by: chetan0412
0 Replies
6. SuSE
Hi,
Beside using crontab, what is other application we can set it? Normally I check using command crontab -l.
Any other path I need to check? Please guide me.
Thanks. (2 Replies)
Discussion started by: mzainal
2 Replies
7. Shell Programming and Scripting
hi ,
can anyone please tell me to how to restart a service without root or i need a root access for it.
as a user i am getting this type of error :
nkchand@(tendcer0h1) nkchand $ service /opt/Nimsoft/bin/niminit stop
ksh: service: not found. (1 Reply)
Discussion started by: nkchand
1 Replies
8. Red Hat
Hello,
I'l like to create a script that restart a service (/etc/init.d/httpd restart) and also check if after restart the service is actually running. Sometimes it happen that at the first try the service fails to restart.
Thanks (2 Replies)
Discussion started by: bazzola
2 Replies
9. Red Hat
Hello
How do I restart init.d ?? (centos 6.5)
Thanks (2 Replies)
Discussion started by: mnnn
2 Replies
10. Red Hat
When I update the server with new SSL certificates, and restart httpd, I get errors :
# service httpd restart
Stopping httpd:
rm: cannot remove `/usr/local/apache2/bin/httpd/logs/httpd.pid': Not a directory
Starting httpd: ... (0 Replies)
Discussion started by: anaigini45
0 Replies
LEARN ABOUT HPUX
serialize
serialize(2) System Calls Manual serialize(2)
NAME
serialize() - force target process to run serially with other processes
SYNOPSIS
DESCRIPTION
The system call is used to force the target process referenced by the pid value passed in to run serially with other processes also marked
for serialization. If the value of pid is zero, then the currently running process is marked for serialization. Once a process has been
marked by the process stays marked until process completion, unless is reissued on the serialized process with timeshare set to 1. If
timeshare is set to 1, the process specified in pid will be returned to normal timeshare scheduling algorithms.
This call is used to improve process throughput since process throughput usually increases for large processes when they are executed seri-
ally instead of allowing each program to run for only a short period of time. By running large processes one at a time, the system makes
more efficient use of the CPU as well as system memory, since each process does not end up constantly faulting in its working set, to only
have the pages stolen when another process starts running. As long as there is enough memory in the system, processes marked by behave no
differently from other processes in the system. However, once memory becomes tight, processes marked by are run one at a time with the
highest priority processes being run first. Each process runs for a finite interval of time before another serialized process is allowed
to run.
RETURN VALUE
returns zero upon successful completion, or nonzero if the system call failed.
ERRORS
If fails, it sets (see errno(2)) to the following value:
The pid passed in does not exist.
WARNINGS
The user has no way of forcing an execution order on serialized processes.
AUTHOR
was developed by HP.
SEE ALSO
serialize(1), privileges(5).
serialize(2)