Sponsored Content
Top Forums Shell Programming and Scripting Printing the Status of a Process in an Instance Post 302286453 by zaxxon on Wednesday 11th of February 2009 07:27:38 AM
Old 02-11-2009
I just copied&pasted it to my putty:

Code:
root@isau02:/data/tmp/testfeld> cat infile
Processes in Instance: oc4j_as1.mxb01981s001.naretail.na.com
---------------------------------+--------------------+---------+-----
ias-component | process-type |pid | status
---------------------------------+--------------------+---------+-----
ASG | ASG |N/A | Down
OC4JGroup:default_group | OC4J:IP-BO-C-I~ |21242 |Alive
OC4JGroup:default_group | OC4J:P-BO-M10 |N/A | Down
OC4JGroup:default_group | OC4Jc4j_soa |21240 | Alive
HTTP_Server | HTTP_Server |21239 | Alive
root@isau02:/data/tmp/testfeld> cat mach.ksh
awk -F"|" '
      $NF ~ /Alive/ {r+=1; a+=1; print}
      $NF ~ /Down/ {r+=1; d+=1; print}
END{if( a != r ) {print "some not up!"}}
' infile
root@isau02:/data/tmp/testfeld> ./mach.ksh
ASG | ASG |N/A | Down
OC4JGroup:default_group | OC4J:IP-BO-C-I~ |21242 |Alive
OC4JGroup:default_group | OC4J:P-BO-M10 |N/A | Down
OC4JGroup:default_group | OC4Jc4j_soa |21240 | Alive
HTTP_Server | HTTP_Server |21239 | Alive
some not up!
root@isau02:/data/tmp/testfeld> awk --version
GNU Awk 3.1.5


Anyway, another way of many ways; maybe this works on your box:
Code:
FILE=infile; if [[ `grep -cE "Alive|Down" ${FILE}` != `grep -c Alive ${FILE}` ]]; then echo some not up; else echo all up; fi

 

10 More Discussions You Might Find Interesting

1. AIX

Process status display

On AIX 5.2, I use "ps -ef " command to display the process status, the field of command looks like: , the detailed contents are: # ps -ef |grep rtesfmrt Display: osa 32455 1 0 18:20 - 1:57 The origianl format shoud be: osa 32455 1 0 18:20 - 1:57 ... (2 Replies)
Discussion started by: Frank2004
2 Replies

2. Shell Programming and Scripting

How to check if another instance of the process is running

Hi, I am writing a shell script to invoke a C++ program. Before I start the C++ program (oi7loadbalancer), I am checking if the process is already running. I start the process only if it is not already running. I have the following check in my script. proccount=`ps -f -u $USER_NAME | grep... (8 Replies)
Discussion started by: sim
8 Replies

3. UNIX for Advanced & Expert Users

Getting status of a signal in process?

Hi all, How can a process be aware of the signals it handles. I looked at available signal API, but couldn't find any help. If a process defines it own handler for a signal, the default handler for that signal becomes overridden. I am interested in getting to know the... (2 Replies)
Discussion started by: bluehive
2 Replies

4. Programming

process status

hello everybody!! i want to post a question! is there any way to get process status using C commands? To be more specific, i want to know whether a process is running or is stop or killed. thanks in advance! (3 Replies)
Discussion started by: nicos
3 Replies

5. UNIX for Advanced & Expert Users

Status of a Linux process

All, I have fair amount of knowledge about shell scripting, but only liitle on system administration. I would like to know how to analyze whether the particular linux process is alive or not ? If it is alive, will it affect the performace of other process ?. Also is it still consuming... (1 Reply)
Discussion started by: apsprabhu
1 Replies

6. UNIX for Dummies Questions & Answers

Multiple instance of same process

;)Hi Everyone, I am using solaris 5.10. I have a java process running in server mode in unix. The problem is that it automatically forks i.e creates a child process. I mean suddenly two instances of that process start running , in which the process-id of first instance is the parent... (0 Replies)
Discussion started by: glamo_2312
0 Replies

7. UNIX for Advanced & Expert Users

Multiple Instance Of Same Process

Hi Everyone, I am using solaris 5.10. I have a java process running in server mode in unix. The problem is that it automatically forks i.e creates a child process. I mean suddenly two instances of that process start running , in which the process-id of first instance is the parent... (5 Replies)
Discussion started by: glamo_2312
5 Replies

8. Shell Programming and Scripting

How to check the process status

Hi, I have a cron job which runs every ten minutes, now i hav to check the process whether it is running or not only once and then this should be sent to a log file.. crontab : 00,10,20,30,40,50 * * * * a process check ps = 'ps -ef |grep a ' if then echo " Success" >... (3 Replies)
Discussion started by: NehaKrish
3 Replies

9. Shell Programming and Scripting

Process Instance not running properly.

I have run 10 instances of the process eg, process name is BG nohup /WP01IRB1_irbapp/IRBWPROD/RB/bin/BG -c 1 -t 23 -a '-caTop TESTBILLCYCLE='5FEB13_81PT19NPT''>a.txt & nohup /WP01IRB1_irbapp/IRBWPROD/RB/bin/BG -c 2 -t 23 -a '-caTop TESTBILLCYCLE='5FEB13_81PT19NPT''>b.txt & nohup... (3 Replies)
Discussion started by: ankitknit
3 Replies

10. UNIX for Advanced & Expert Users

How to check a single process instance is always running?

Hi, I want to write one program in C in Unix OS which will check the running status of a process time to time. If the process is stopped somehow by any means, it will ensure that the process is restarted and only one copy of the process image should run in memory at any point of time for the user.... (2 Replies)
Discussion started by: sanzee007
2 Replies
cupsd.conf(5)						      Easy Software Products						     cupsd.conf(5)

NAME
cupsd.conf - server configuration file for cups DESCRIPTION
The cupsd.conf file configures the CUPS scheduler, cupsd(8). It is normally located in the /etc/cups directory. Each line in the file can be a configuration directive, a blank line, or a comment. Comment lines start with the # character. The configu- ration directives are intentionally similar to those used by the popular Apache web server software and are described below. DIRECTIVES
The following directives are understood by cupsd. Consult the CUPS Software Administrators Manual for a detailed description: AccessLog Defines the access log filename. Allow Allows access from the named hosts or addresses. AuthClass Specifies the authentication class (User, Group, System) AuthType Specifies the authentication type (None, Basic, Digest) AutoPurgeJobs Specifies whether to purge job history data automatically when it is no longer required for quotas. BrowseAddress Specifies a broadcast address for outgoing printer information packets. BrowseAllow Allows incoming printer information packets from the named host or address. BrowseDeny Denies incoming printer information packets from the named host or address. BrowseInterval Specifies the maximum interval between printer information broadcasts. BrowseOrder Specifies the order of printer information access control (allow,deny or deny,allow) BrowsePoll Specifies a server to poll for printer information. BrowsePort Specifies the port to listen to for printer information packets. BrowseProtocols Specifies the protocols to use for printer browsing. BrowseRelay Specifies that printer information packets should be relayed from one host or network to another. BrowseShortNames Specifies whether remote printers will use short names ("printer") or not ("printer@server"). This option is ignored if more than one remote printer exists with the same name. BrowseTimeout Specifies the maximum interval between printer information updates before remote printers will be removed from the list of available printers. Browsing Specifies whether or not remote printer browsing should be enabled. Classification Specifies the security classification of the server. ClassifyOverride Specifies whether to allow users to override the classification of individual print jobs. ConfigFilePerm Specifies the permissions for all configuration files that the scheduler writes. DataDir Specified the directory where data files can be found. DefaultCharset Specifies the default character set to use for text. DefaultLanguage Specifies the default language to use for text and web content. Deny Denies access to the named host or address. DocumentRoot Specifies the root directory for the internal web server documents. Encryption Specifies the level of encryption that is required for a particular location. ErrorLog Specifies the error log filename. FilterLimit Specifies the maximum cost of filters that are run concurrently. FilterNice Specifies the scheduling priority ("nice" value) of filters that are run to print a job. FontPath Specifies the search path for fonts. Group Specifies the group name or ID that will be used when executing external programs. HideImplicitMembers Specifies whether to hide members of implicit classes. HostNameLookups Specifies whether or not to do reverse lookups on client addresses. ImplicitAnyClasses Specifies whether or not to create implicit classes for local and remote printers, e.g. "AnyPrinter" from "Printer", "Printer@server1", and "Printer@server2". ImplicitClasses Specifies whether or not to create implicit classes from identical remote printers. KeepAlive Specifies whether or not to support HTTP Keep-Alive. KeepAliveTimeout Specifies the connection timeout for HTTP Keep-Alive. <Limit methods> ... </Limit> <LimitExcept methods> ... </LimitExcept> Specifies the HTTP methods that are being limited inside a location. LimitRequestBody Specifies the maximum size of any print job request. <Location /path> ... </Location> Specifies access control for the named location. LogFilePerm Specifies the permissions for all log files that the scheduler writes. LogLevel Specifies the logging level (none, warn, error, info, debug, or debug2) MaxClients Specifies the maximum number of simultaneous clients to support. MaxCopies Specifies the maximum number of copies that a user can print of each job. MaxJobs Specifies the maximum number of simultaneous jobs to support. MaxJobsPerPrinter Specifies the maximum number of simultaneous jobs per printer to support. MaxJobsPerUser Specifies the maximum number of simultaneous jobs per user to support. MaxLogSize Specifies the maximum size of the log files before they are rotated (0 to disable rotation) MaxRequestSize Specifies the maximum request/file size in bytes (0 for no limit) Order Specifies the order of HTTP access control (allow,deny or deny,allow) PageLog Specifies the page log filename. Port Specifies a port number to listen to for HTTP requests. PreserveJobFiles Specifies whether or not to preserve job files after they are printed. PreserveJobHistory Specifies whether or not to preserve the job history after they are printed. Printcap Specifies the filename for a printcap file that is updated automatically with a list of available printers (needed for legacy applica- tions) PrintcapGUI Specifies whether to generate option panel definition files on some operating systems. RemoteRoot Specifies the username that is associated with unauthenticated root accesses. RequestRoot Specifies the directory to store print jobs and other HTTP request data. Require Specifies that user or group authentication is required. RIPCache Specifies the maximum amount of memory to use when converting images and PostScript files to bitmaps for a printer. RunAsUser Specifies that the scheduler should run as the unpriviledged user set with the User directive. Satisfy Specifies whether all or any limits set for a Location must be satisfied to allow access. ServerAdmin Specifies the email address of the server administrator. ServerBin Specifies the directory where backends, CGIs, daemons, and filters may be found. ServerCertificate Specifies the encryption certificate to use. ServerKey Specifies the encryption key to use. ServerName Specifies the fully-qualified hostname of the server. ServerRoot Specifies the directory where the server configuration files can be found. SystemGroup Specifies the group to use for System class authentication. TempDir Specifies the directory where temporary files are stored. Timeout Specifies the HTTP request timeout in seconds. User Specifies the user name or ID that is used when running external programs. SEE ALSO
classes.conf(5), cupsd(8), mime.convs(5), mime.types(5), printers.conf(5), CUPS Software Administrators Manual, http://localhost:631/docu- mentation.html COPYRIGHT
Copyright 1993-2002 by Easy Software Products, All Rights Reserved. 12 August 2002 Common UNIX Printing System cupsd.conf(5)
All times are GMT -4. The time now is 02:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy